---
title: "Ci Analyze"
method: POST
path: "/ci/analyze"
---

# Ci Analyze

`POST /ci/analyze`

## Request

- Base URL: `https://emfirge.cloud` (the document declares no server; this is the origin it was published from)
- URL: `https://emfirge.cloud/ci/analyze`
- Auth: none declared

CI/CD Gate: Analyze a PR for security impact using FULL infrastructure simulation.

Flow:
1. Authenticate via API key
2. Fetch PR diff from GitHub, parse .tf changes
3. Load last scan's infrastructure from DB
4. For each TF resource change: deep-copy infra, mutate, rebuild graph, run all rules
5. Diff findings (new vs original), calculate real score delta
6. Detect new attack paths (BFS from internet)
7. Return structured response with pass/warn/fail + findings + attack paths

This is NOT a static lint — it simulates the PR against your actual live infrastructure.

## Request body

- CIAnalyzeRequest: Request body for CI/CD security analysis of a PR.
  - `repo` string, required
  - `pr_number` integer, required
  - `base_ref` string
  - `head_ref` string
  - `analysis_id` string, nullable

## Response `200`

Successful Response

- CIAnalyzeResponse: Response from CI/CD security analysis.
  - `status` string, required
  - `score_delta` integer
  - `new_findings` object[]
  - `resolved_findings` object[]
  - `new_toxic_combos` string[]
  - `summary` string
  - `scan_age_hours` number, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/emfirge/apis/aws-risk-analysis-agent.md) · [All operations](https://skmtc.dev/emfirge/apis/aws-risk-analysis-agent/llms.txt) · [OpenAPI document](https://skmtc.dev/emfirge/apis/aws-risk-analysis-agent/revisions/149a9263d07a?raw)
