{"openapi":"3.1.0","info":{"title":"AWS Risk Analysis Agent","version":"2.0"},"paths":{"/":{"get":{"summary":"Home","operationId":"home__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/logs":{"get":{"summary":"Logs","operationId":"logs_logs_get","parameters":[{"name":"account_id","in":"query","required":false,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/link-project":{"post":{"summary":"Link Project","description":"Attach a verified Supabase sign-in to an existing API-key project.","operationId":"link_project_auth_link_project_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/history":{"get":{"summary":"History","operationId":"history_history_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}},{"name":"account_id","in":"query","required":false,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/project":{"get":{"summary":"Project Info","operationId":"project_info_project_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/account-bindings/{aws_account_id}":{"delete":{"summary":"Unbind Account","operationId":"unbind_account_admin_account_bindings__aws_account_id__delete","parameters":[{"name":"aws_account_id","in":"path","required":true,"schema":{"type":"string","title":"Aws Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/drift/events":{"get":{"summary":"Drift Events Endpoint","operationId":"drift_events_endpoint_drift_events_get","parameters":[{"name":"account_id","in":"query","required":false,"schema":{"type":"string","title":"Account Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/logs/{log_id}":{"get":{"summary":"Get Log","operationId":"get_log_logs__log_id__get","parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"integer","title":"Log Id"}},{"name":"account_id","in":"query","required":false,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/logs/by-uuid/{analysis_id}":{"get":{"summary":"Get Log By Uuid","operationId":"get_log_by_uuid_logs_by_uuid__analysis_id__get","parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}},{"name":"account_id","in":"query","required":false,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/egraph/{analysis_id}":{"get":{"summary":"Get Graph","description":"Get infrastructure graph data for a completed scan.\n\nReturns infrastructure graph with nodes, edges, orphaned resources, and statistics.","operationId":"get_graph_egraph__analysis_id__get","parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/compliance/{analysis_id}":{"get":{"summary":"Get Compliance","description":"Evaluate compliance frameworks (CIS AWS 1.5, SOC 2) against a completed scan.\n\nFor each control, checks if the mapped EMFIRGE rule fired in the scan findings.\nRule fired → control FAIL. Rule not fired → control PASS.\nReturns pass/fail per control + overall percentages for each framework.","operationId":"get_compliance_compliance__analysis_id__get","parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/simulate":{"post":{"summary":"Simulate","description":"Single-phase SSE simulation: Haiku for narrative + deterministic BFS for attack chain.\nFast (~2-4s), reliable, cheap. No Sonnet needed.\nRate limited to 10 requests/minute per IP.","operationId":"simulate_simulate_post","parameters":[{"name":"raw","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Raw"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/simulate/remaining":{"get":{"summary":"Simulate Remaining","description":"Returns how many simulations remain today for the account that owns this analysis.","operationId":"simulate_remaining_simulate_remaining_get","parameters":[{"name":"analysis_id","in":"query","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/usage/remaining":{"get":{"summary":"Usage Remaining","description":"Returns daily usage counts, hiding usage for accounts outside the tenant.","operationId":"usage_remaining_usage_remaining_get","parameters":[{"name":"account_id","in":"query","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/remediation/generate-insight":{"post":{"summary":"Generate Remediation Insight","description":"Generate AI-powered 'What this fixes' and 'Why it matters' text for a single finding.\nRate limited to 5 requests/minute per IP.\nNever errors beyond 429 — falls back to static text derived from the finding if Gemini fails.","operationId":"generate_remediation_insight_remediation_generate_insight_post","parameters":[{"name":"raw","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Raw"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemediationInsightRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemediationInsightResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/remediation/generate-terraform":{"post":{"summary":"Generate Terraform","operationId":"generate_terraform_remediation_generate_terraform_post","parameters":[{"name":"raw","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Raw"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TerraformGenerateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TerraformGenerateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/branches/compare":{"post":{"summary":"Compare Branches Endpoint","operationId":"compare_branches_endpoint_branches_compare_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/branches":{"post":{"summary":"Create Branch Endpoint","operationId":"create_branch_endpoint_branches_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Branches Endpoint","operationId":"list_branches_endpoint_branches_get","parameters":[{"name":"base_analysis_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/branches/capabilities":{"get":{"summary":"Branch Capabilities Endpoint","description":"List supported branch mutation resource types, operations, and constraints.","operationId":"branch_capabilities_endpoint_branches_capabilities_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MutationCapabilities"}}}}}}},"/branches/{branch_id}":{"get":{"summary":"Get Branch Endpoint","description":"Read branch metadata and ordered changes without returning its base snapshot.","operationId":"get_branch_endpoint_branches__branch_id__get","parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","title":"Branch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/branches/{branch_id}/fork":{"post":{"summary":"Fork Branch Endpoint","operationId":"fork_branch_endpoint_branches__branch_id__fork_post","parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","title":"Branch Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/branches/{branch_id}/plans/terraform":{"post":{"summary":"Terraform Plan Endpoint","operationId":"terraform_plan_endpoint_branches__branch_id__plans_terraform_post","parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","title":"Branch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/branches/{branch_id}/plans/cloudformation":{"post":{"summary":"Cloudformation Plan Endpoint","operationId":"cloudformation_plan_endpoint_branches__branch_id__plans_cloudformation_post","parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","title":"Branch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/branches/{branch_id}/plans/aws-api":{"post":{"summary":"Aws Api Plan Endpoint","operationId":"aws_api_plan_endpoint_branches__branch_id__plans_aws_api_post","parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","title":"Branch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/branches/{branch_id}/plans/aws-cli":{"post":{"summary":"Aws Cli Plan Endpoint","operationId":"aws_cli_plan_endpoint_branches__branch_id__plans_aws_cli_post","parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","title":"Branch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/branches/{branch_id}/in-use-evidence/estimate":{"get":{"summary":"In Use Evidence Estimate","operationId":"in_use_evidence_estimate_branches__branch_id__in_use_evidence_estimate_get","parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","title":"Branch Id"}},{"name":"sources","in":"query","required":false,"schema":{"type":"string","default":"cloudtrail_events,cloudwatch_metrics","title":"Sources"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvidenceEstimate"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/branches/{branch_id}/in-use-evidence":{"post":{"summary":"Collect In Use Evidence","operationId":"collect_in_use_evidence_branches__branch_id__in_use_evidence_post","parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","title":"Branch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/branches/{branch_id}/changes":{"post":{"summary":"Add Branch Change Endpoint","operationId":"add_branch_change_endpoint_branches__branch_id__changes_post","parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","title":"Branch Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Change"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/branches/{branch_id}/plans/{plan_id}/handback":{"get":{"summary":"Plan Handback Endpoint","operationId":"plan_handback_endpoint_branches__branch_id__plans__plan_id__handback_get","parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","title":"Branch Id"}},{"name":"plan_id","in":"path","required":true,"schema":{"type":"string","title":"Plan Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/handback/verify":{"post":{"summary":"Verify Handback Endpoint","operationId":"verify_handback_endpoint_handback_verify_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/branches/{branch_id}/handback":{"get":{"summary":"Typed Handback Endpoint","operationId":"typed_handback_endpoint_branches__branch_id__handback_get","parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","title":"Branch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/branches/{branch_id}/handback/verify":{"post":{"summary":"Verify Typed Handback Endpoint","operationId":"verify_typed_handback_endpoint_branches__branch_id__handback_verify_post","parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","title":"Branch Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/branches/{branch_id}/diff":{"get":{"summary":"Branch Diff Endpoint","operationId":"branch_diff_endpoint_branches__branch_id__diff_get","parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","title":"Branch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiffResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/branches/{branch_id}/verdict":{"get":{"summary":"Branch Verdict Endpoint","operationId":"branch_verdict_endpoint_branches__branch_id__verdict_get","parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","title":"Branch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CombinedVerdict"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/branches/{branch_id}/rollback":{"post":{"summary":"Rollback Branch Endpoint","operationId":"rollback_branch_endpoint_branches__branch_id__rollback_post","parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","title":"Branch Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/branches/{branch_id}/rollback-to-count":{"post":{"summary":"Rollback Branch To Count Endpoint","operationId":"rollback_branch_to_count_endpoint_branches__branch_id__rollback_to_count_post","parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","title":"Branch Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/branches/{branch_id}/discard":{"post":{"summary":"Discard Branch Endpoint","operationId":"discard_branch_endpoint_branches__branch_id__discard_post","parameters":[{"name":"branch_id","in":"path","required":true,"schema":{"type":"string","title":"Branch Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/remediation/verify-fix":{"post":{"summary":"Verify Fix","description":"Simulate applying a fix for a specific finding and return the impact.\n\n1. Look up FIX_MUTATIONS[rule_id]\n2. If not found → return {can_simulate: false}\n3. Load infrastructure from DB\n4. Deep-copy, apply mutation\n5. Rebuild graph, run rules, diff findings, calculate score delta\n6. Return VerifyFixResponse\n\nPure computation — no LLM calls, no side effects. Should be <1s.","operationId":"verify_fix_remediation_verify_fix_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyFixRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyFixResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/remediation/fix":{"post":{"summary":"Unified Fix","description":"Unified fix endpoint: generates HCL + verifies it in one call.\n\nFlow:\n1. If rule_id has a deterministic mutation → verify instantly + generate HCL in parallel\n2. If not → generate HCL via Claude → parse HCL → simulate → verify\n3. Fallback: if HCL parsing fails → return HCL without verification\n\nReturns both the terraform fix AND the verification result.\nRate limited: 5/min per IP + 10/day per account.","operationId":"unified_fix_remediation_fix_post","parameters":[{"name":"raw","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Raw"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TerraformGenerateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/github/install-url":{"get":{"summary":"Github Install Url","operationId":"github_install_url_github_install_url_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/github/repos":{"get":{"summary":"Github Repos","operationId":"github_repos_github_repos_get","parameters":[{"name":"installation_id","in":"query","required":true,"schema":{"type":"integer","title":"Installation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/github/pr":{"post":{"summary":"Create Github Pr","operationId":"create_github_pr_github_pr_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitHubPRRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitHubPRResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/github/webhook":{"post":{"summary":"Github Webhook","operationId":"github_webhook_github_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/github/index-tf":{"post":{"summary":"Index Tf Repo","description":"Manually trigger TF indexing for a repo. Called after GitHub App install.","operationId":"index_tf_repo_github_index_tf_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TFIndexRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TFIndexResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/github/index-status":{"get":{"summary":"Tf Index Status","description":"Check TF indexing status for a repo.","operationId":"tf_index_status_github_index_status_get","parameters":[{"name":"installation_id","in":"query","required":true,"schema":{"type":"integer","title":"Installation Id"}},{"name":"repo","in":"query","required":true,"schema":{"type":"string","title":"Repo"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ci/api-key":{"post":{"summary":"Create Ci Key","description":"Create a CI/CD API key for an installation. User stores this in GitHub Secrets.","operationId":"create_ci_key_ci_api_key_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CIAPIKeyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CIAPIKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ci/api-keys":{"get":{"summary":"List Ci Keys","description":"List CI/CD API keys for an installation (shows prefixes only).","operationId":"list_ci_keys_ci_api_keys_get","parameters":[{"name":"installation_id","in":"query","required":true,"schema":{"type":"integer","title":"Installation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ci/analyze":{"post":{"summary":"Ci Analyze","description":"CI/CD Gate: Analyze a PR for security impact using FULL infrastructure simulation.\n\nFlow:\n1. Authenticate via API key\n2. Fetch PR diff from GitHub, parse .tf changes\n3. Load last scan's infrastructure from DB\n4. For each TF resource change: deep-copy infra, mutate, rebuild graph, run all rules\n5. Diff findings (new vs original), calculate real score delta\n6. Detect new attack paths (BFS from internet)\n7. Return structured response with pass/warn/fail + findings + attack paths\n\nThis is NOT a static lint — it simulates the PR against your actual live infrastructure.","operationId":"ci_analyze_ci_analyze_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CIAnalyzeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CIAnalyzeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/feedback":{"post":{"summary":"Submit Feedback","operationId":"submit_feedback_feedback_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Feedback","operationId":"list_feedback_feedback_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"key","in":"query","required":false,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analyze":{"post":{"summary":"Analyze","operationId":"analyze_analyze_post","parameters":[{"name":"raw","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Raw"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AWSCredentials"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analyze/stream":{"post":{"summary":"Analyze Stream","operationId":"analyze_stream_analyze_stream_post","parameters":[{"name":"raw","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Raw"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AWSCredentials"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/simulate/component":{"post":{"summary":"Simulate Component","description":"Simulate adding/modifying a component in the infrastructure.\n\n1. Load infrastructure from DB\n2. Deep-copy and mutate based on component config\n3. Rebuild graph, run BFS, run all checks\n4. Diff findings (new vs original)\n5. Calculate risk delta\n6. Call Claude Haiku for narrative prose\n7. Return structured response\n\nShares rate limits with /simulate (10/min per IP, 3/day per account).\nNO side effects — no drift events, no analysis saves.","operationId":"simulate_component_simulate_component_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComponentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/privacy/purge":{"post":{"summary":"Purge User Data","description":"Delete all stored data for the AWS account that owns this role.\nRe-assumes the role to verify caller controls the account.\nDeletes from analysis_logs, drift_events, simulation_logs + S3 reports.","operationId":"purge_user_data_privacy_purge_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurgeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ALBConfig":{"properties":{"component_type":{"type":"string","const":"load_balancer","title":"Component Type","default":"load_balancer"},"lb_type":{"type":"string","enum":["ALB","NLB"],"title":"Lb Type","default":"ALB"},"https_only":{"type":"boolean","title":"Https Only","default":true},"waf_attached":{"type":"boolean","title":"Waf Attached","default":false},"target_instance_ids":{"items":{"type":"string"},"type":"array","title":"Target Instance Ids","default":[]}},"type":"object","title":"ALBConfig"},"APIGatewayConfig":{"properties":{"component_type":{"type":"string","const":"api_gateway","title":"Component Type","default":"api_gateway"},"gw_type":{"type":"string","enum":["REST","HTTP"],"title":"Gw Type","default":"HTTP"},"auth":{"type":"string","enum":["none","iam","cognito"],"title":"Auth","default":"none"},"is_public":{"type":"boolean","title":"Is Public","default":true},"waf_attached":{"type":"boolean","title":"Waf Attached","default":false}},"type":"object","title":"APIGatewayConfig"},"AWSCredentials":{"properties":{"role_arn":{"type":"string","title":"Role Arn"},"region":{"type":"string","title":"Region"}},"type":"object","required":["role_arn","region"],"title":"AWSCredentials"},"BranchChangeRecord":{"properties":{"op":{"type":"string","title":"Op"},"resource_type":{"type":"string","title":"Resource Type"},"resource_id":{"type":"string","title":"Resource Id"},"fields":{"additionalProperties":true,"type":"object","title":"Fields"}},"type":"object","required":["op","resource_type","resource_id"],"title":"BranchChangeRecord","description":"Normalized persisted mutation without request-only concurrency metadata."},"BranchDetail":{"properties":{"branch_id":{"type":"string","title":"Branch Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"base_analysis_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Analysis Id"},"num_changes":{"type":"integer","title":"Num Changes"},"changes":{"items":{"$ref":"#/components/schemas/BranchChangeRecord"},"type":"array","title":"Changes"},"branch_revision":{"type":"string","title":"Branch Revision"}},"type":"object","required":["branch_id","name","status","num_changes","branch_revision"],"title":"BranchDetail","description":"Read-only branch metadata and ordered changes, excluding the base snapshot."},"CIAPIKeyRequest":{"properties":{"installation_id":{"type":"integer","title":"Installation Id"},"repo":{"type":"string","title":"Repo"}},"type":"object","required":["installation_id","repo"],"title":"CIAPIKeyRequest"},"CIAPIKeyResponse":{"properties":{"api_key":{"type":"string","title":"Api Key"},"repo":{"type":"string","title":"Repo"},"message":{"type":"string","title":"Message","default":""}},"type":"object","required":["api_key","repo"],"title":"CIAPIKeyResponse"},"CIAnalyzeRequest":{"properties":{"repo":{"type":"string","title":"Repo"},"pr_number":{"type":"integer","title":"Pr Number"},"base_ref":{"type":"string","title":"Base Ref","default":"main"},"head_ref":{"type":"string","title":"Head Ref","default":""},"analysis_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Id"}},"type":"object","required":["repo","pr_number"],"title":"CIAnalyzeRequest","description":"Request body for CI/CD security analysis of a PR."},"CIAnalyzeResponse":{"properties":{"status":{"type":"string","title":"Status"},"score_delta":{"type":"integer","title":"Score Delta","default":0},"new_findings":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"New Findings","default":[]},"resolved_findings":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Resolved Findings","default":[]},"new_toxic_combos":{"items":{"type":"string"},"type":"array","title":"New Toxic Combos","default":[]},"summary":{"type":"string","title":"Summary","default":""},"scan_age_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Scan Age Hours"}},"type":"object","required":["status"],"title":"CIAnalyzeResponse","description":"Response from CI/CD security analysis."},"Change":{"properties":{"op":{"type":"string","title":"Op"},"resource_type":{"type":"string","title":"Resource Type"},"resource_id":{"type":"string","title":"Resource Id","default":""},"fields":{"additionalProperties":true,"type":"object","title":"Fields"},"expected_change_count":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Expected Change Count"},"branch_revision":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$"},{"type":"null"}],"title":"Branch Revision"}},"type":"object","required":["op","resource_type"],"title":"Change"},"CombinedVerdict":{"properties":{"deletion":{"$ref":"#/components/schemas/DeletionLens"},"verdict":{"type":"string","enum":["pass","warn","block"],"title":"Verdict"},"branch_revision":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Revision"},"modeled_state_unchanged":{"type":"boolean","title":"Modeled State Unchanged","default":false},"native_added":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Native Added"},"native_removed":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Native Removed"},"scanner_added":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Scanner Added"},"scanner_removed":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Scanner Removed"},"score_before":{"type":"integer","title":"Score Before","default":0},"score_after":{"type":"integer","title":"Score After","default":0},"score_delta":{"type":"integer","title":"Score Delta","default":0},"newly_internet_reachable":{"items":{"type":"string"},"type":"array","title":"Newly Internet Reachable"},"no_longer_internet_reachable":{"items":{"type":"string"},"type":"array","title":"No Longer Internet Reachable"},"newly_exposed":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Newly Exposed"},"no_longer_exposed":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"No Longer Exposed"},"reasons":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Reasons"},"plans":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Plans"},"possible_service_impacts":{"items":{"type":"string"},"type":"array","title":"Possible Service Impacts"},"lost_dependencies":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Lost Dependencies"},"lost_connectivity":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Lost Connectivity"},"deletion_impacts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Deletion Impacts"},"scanner_available":{"type":"boolean","title":"Scanner Available","default":false},"scanner_status":{"additionalProperties":{"type":"string"},"type":"object","title":"Scanner Status"},"coverage_warnings":{"items":{"type":"string"},"type":"array","title":"Coverage Warnings"},"collection_warnings":{"items":{"type":"string"},"type":"array","title":"Collection Warnings"},"cost_delta":{"additionalProperties":true,"type":"object","title":"Cost Delta"},"cost_delta_monthly_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Delta Monthly Usd"},"cost_unknown_notes":{"items":{"type":"string"},"type":"array","title":"Cost Unknown Notes"},"introduces_privilege_escalation":{"type":"boolean","title":"Introduces Privilege Escalation","default":false},"escalation_paths":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Escalation Paths"},"limits_introduced":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Limits Introduced"},"limits_resolved":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Limits Resolved"},"summary":{"type":"string","title":"Summary"}},"type":"object","required":["verdict","summary"],"title":"CombinedVerdict"},"ComponentRequest":{"properties":{"config":{"oneOf":[{"$ref":"#/components/schemas/EC2Config"},{"$ref":"#/components/schemas/RDSConfig"},{"$ref":"#/components/schemas/S3Config"},{"$ref":"#/components/schemas/LambdaConfig"},{"$ref":"#/components/schemas/ALBConfig"},{"$ref":"#/components/schemas/APIGatewayConfig"},{"$ref":"#/components/schemas/ElastiCacheConfig"},{"$ref":"#/components/schemas/ECSConfig"},{"$ref":"#/components/schemas/SGRuleConfig"},{"$ref":"#/components/schemas/IAMPolicyConfig"}],"title":"Config","discriminator":{"propertyName":"component_type","mapping":{"api_gateway":"#/components/schemas/APIGatewayConfig","ec2_instance":"#/components/schemas/EC2Config","ecs_service":"#/components/schemas/ECSConfig","elasticache":"#/components/schemas/ElastiCacheConfig","iam_policy":"#/components/schemas/IAMPolicyConfig","lambda_function":"#/components/schemas/LambdaConfig","load_balancer":"#/components/schemas/ALBConfig","rds_instance":"#/components/schemas/RDSConfig","s3_bucket":"#/components/schemas/S3Config","sg_rule":"#/components/schemas/SGRuleConfig"}}},"analysis_id":{"type":"string","title":"Analysis Id"}},"type":"object","required":["config","analysis_id"],"title":"ComponentRequest"},"DataLost":{"properties":{"resource_id":{"type":"string","title":"Resource Id"},"resource_type":{"type":"string","title":"Resource Type"},"why":{"type":"string","title":"Why"}},"type":"object","required":["resource_id","resource_type","why"],"title":"DataLost"},"DeletionCoverage":{"properties":{"can_see":{"items":{"type":"string"},"type":"array","title":"Can See"},"cannot_see":{"items":{"type":"string"},"type":"array","title":"Cannot See"}},"type":"object","title":"DeletionCoverage"},"DeletionImpact":{"properties":{"resource_id":{"type":"string","title":"Resource Id"},"resource_type":{"type":"string","title":"Resource Type"},"relation":{"type":"string","title":"Relation"},"depth":{"type":"integer","title":"Depth"},"via":{"type":"string","title":"Via"}},"type":"object","required":["resource_id","resource_type","relation","depth","via"],"title":"DeletionImpact"},"DeletionLens":{"properties":{"data_lost":{"items":{"$ref":"#/components/schemas/DataLost"},"type":"array","title":"Data Lost"},"recovery_points":{"items":{"$ref":"#/components/schemas/RecoveryPoint"},"type":"array","title":"Recovery Points"},"impacts":{"items":{"$ref":"#/components/schemas/DeletionImpact"},"type":"array","title":"Impacts"},"max_depth":{"type":"integer","title":"Max Depth","default":0},"coverage":{"$ref":"#/components/schemas/DeletionCoverage"},"in_use_evidence":{"items":{"$ref":"#/components/schemas/EvidenceRecord"},"type":"array","title":"In Use Evidence"}},"type":"object","title":"DeletionLens"},"DiffResult":{"properties":{"added_nodes":{"items":{"type":"string"},"type":"array","title":"Added Nodes"},"removed_nodes":{"items":{"type":"string"},"type":"array","title":"Removed Nodes"},"modified_nodes":{"items":{"type":"string"},"type":"array","title":"Modified Nodes"},"added_edges":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Added Edges"},"removed_edges":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Removed Edges"},"deletion_impacts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Deletion Impacts"},"lost_dependencies":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Lost Dependencies"},"lost_connectivity":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Lost Connectivity"},"coverage_warnings":{"items":{"type":"string"},"type":"array","title":"Coverage Warnings"},"collection_warnings":{"items":{"type":"string"},"type":"array","title":"Collection Warnings"},"added_findings":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Added Findings"},"removed_findings":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Removed Findings"},"score_before":{"type":"integer","title":"Score Before","default":0},"score_after":{"type":"integer","title":"Score After","default":0},"score_delta":{"type":"integer","title":"Score Delta","default":0},"security_score_before":{"type":"integer","title":"Security Score Before","default":0},"security_score_after":{"type":"integer","title":"Security Score After","default":0},"availability_score_before":{"type":"integer","title":"Availability Score Before","default":0},"availability_score_after":{"type":"integer","title":"Availability Score After","default":0},"disaster_recovery_score_before":{"type":"integer","title":"Disaster Recovery Score Before","default":0},"disaster_recovery_score_after":{"type":"integer","title":"Disaster Recovery Score After","default":0},"cost_score_before":{"type":"integer","title":"Cost Score Before","default":0},"cost_score_after":{"type":"integer","title":"Cost Score After","default":0},"score_notes":{"items":{"type":"string"},"type":"array","title":"Score Notes"},"cost_delta":{"additionalProperties":true,"type":"object","title":"Cost Delta"},"cost_delta_monthly_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Delta Monthly Usd"},"newly_internet_reachable":{"items":{"type":"string"},"type":"array","title":"Newly Internet Reachable"},"no_longer_internet_reachable":{"items":{"type":"string"},"type":"array","title":"No Longer Internet Reachable"},"newly_exposed":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Newly Exposed"},"no_longer_exposed":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"No Longer Exposed"},"modeled_state_unchanged":{"type":"boolean","title":"Modeled State Unchanged","default":false},"branch_revision":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Revision"}},"type":"object","title":"DiffResult","description":"Deterministic result of comparing two infrastructure snapshots."},"EC2Config":{"properties":{"component_type":{"type":"string","const":"ec2_instance","title":"Component Type","default":"ec2_instance"},"instance_type":{"type":"string","title":"Instance Type","default":"t3.micro"},"public_ip":{"type":"boolean","title":"Public Ip","default":false},"sg_ids":{"items":{"type":"string"},"type":"array","title":"Sg Ids","default":[]},"subnet_id":{"type":"string","title":"Subnet Id","default":""},"imdsv2_required":{"type":"boolean","title":"Imdsv2 Required","default":true}},"type":"object","title":"EC2Config"},"ECSConfig":{"properties":{"component_type":{"type":"string","const":"ecs_service","title":"Component Type","default":"ecs_service"},"launch_type":{"type":"string","enum":["FARGATE","EC2"],"title":"Launch Type","default":"FARGATE"},"privileged":{"type":"boolean","title":"Privileged","default":false},"resource_limits":{"type":"boolean","title":"Resource Limits","default":true},"public_ip":{"type":"boolean","title":"Public Ip","default":false}},"type":"object","title":"ECSConfig"},"ElastiCacheConfig":{"properties":{"component_type":{"type":"string","const":"elasticache","title":"Component Type","default":"elasticache"},"engine":{"type":"string","enum":["redis","memcached"],"title":"Engine","default":"redis"},"in_vpc":{"type":"boolean","title":"In Vpc","default":true},"encryption_in_transit":{"type":"boolean","title":"Encryption In Transit","default":true},"auth_enabled":{"type":"boolean","title":"Auth Enabled","default":true}},"type":"object","title":"ElastiCacheConfig"},"EstimateResource":{"properties":{"resource_type":{"type":"string","title":"Resource Type"},"resource_id":{"type":"string","title":"Resource Id"},"sources":{"items":{"type":"string"},"type":"array","title":"Sources"}},"type":"object","required":["resource_type","resource_id","sources"],"title":"EstimateResource"},"EvidenceCall":{"properties":{"source":{"type":"string","title":"Source"},"api":{"type":"string","title":"Api"},"max_requests":{"type":"integer","title":"Max Requests"},"billable":{"type":"boolean","title":"Billable"},"note":{"type":"string","title":"Note"},"pricing_url":{"type":"string","title":"Pricing Url"}},"type":"object","required":["source","api","max_requests","billable","note","pricing_url"],"title":"EvidenceCall"},"EvidenceEstimate":{"properties":{"estimate_id":{"type":"string","title":"Estimate Id"},"branch_revision":{"type":"string","title":"Branch Revision"},"window_days":{"type":"integer","title":"Window Days"},"sources":{"items":{"type":"string"},"type":"array","title":"Sources"},"resources":{"items":{"$ref":"#/components/schemas/EstimateResource"},"type":"array","title":"Resources"},"calls":{"items":{"$ref":"#/components/schemas/EvidenceCall"},"type":"array","title":"Calls"},"max_resources":{"type":"integer","title":"Max Resources"}},"type":"object","required":["estimate_id","branch_revision","window_days","sources","resources","calls","max_resources"],"title":"EvidenceEstimate"},"EvidenceRecord":{"properties":{"resource_id":{"type":"string","title":"Resource Id"},"resource_type":{"type":"string","title":"Resource Type"},"source":{"type":"string","title":"Source"},"status":{"type":"string","enum":["ok","no_data","denied","error","incomplete","unknown"],"title":"Status"},"used":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Used"},"holds_data":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Holds Data"},"window_days":{"type":"integer","title":"Window Days"},"observed_at":{"type":"string","title":"Observed At"},"last_event_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Event At"},"event_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Name"},"metrics":{"items":{"$ref":"#/components/schemas/MetricSummary"},"type":"array","title":"Metrics"}},"type":"object","required":["resource_id","resource_type","source","status","used","window_days","observed_at"],"title":"EvidenceRecord"},"FeedbackRequest":{"properties":{"message":{"type":"string","title":"Message"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","default":""},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","default":""},"page":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page","default":""},"aws_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Account Id","default":""}},"type":"object","required":["message"],"title":"FeedbackRequest"},"GitHubPRRequest":{"properties":{"installation_id":{"type":"integer","title":"Installation Id"},"repo":{"type":"string","title":"Repo"},"finding":{"additionalProperties":true,"type":"object","title":"Finding"},"hcl":{"type":"string","title":"Hcl"}},"type":"object","required":["installation_id","repo","finding","hcl"],"title":"GitHubPRRequest"},"GitHubPRResponse":{"properties":{"pr_url":{"type":"string","title":"Pr Url"},"pr_number":{"type":"integer","title":"Pr Number"},"branch":{"type":"string","title":"Branch"}},"type":"object","required":["pr_url","pr_number","branch"],"title":"GitHubPRResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IAMPolicyConfig":{"properties":{"component_type":{"type":"string","const":"iam_policy","title":"Component Type","default":"iam_policy"},"role_name":{"type":"string","title":"Role Name"},"action":{"type":"string","enum":["attach","detach"],"title":"Action","default":"attach"},"policy_name":{"type":"string","title":"Policy Name","default":""}},"type":"object","required":["role_name"],"title":"IAMPolicyConfig"},"LambdaConfig":{"properties":{"component_type":{"type":"string","const":"lambda_function","title":"Component Type","default":"lambda_function"},"in_vpc":{"type":"boolean","title":"In Vpc","default":false},"subnet_ids":{"items":{"type":"string"},"type":"array","title":"Subnet Ids","default":[]},"role_type":{"type":"string","enum":["least_privilege","admin"],"title":"Role Type","default":"least_privilege"},"timeout":{"type":"integer","title":"Timeout","default":30},"runtime":{"type":"string","title":"Runtime","default":"python3.11"}},"type":"object","title":"LambdaConfig"},"MetricSummary":{"properties":{"metric":{"type":"string","title":"Metric"},"statistic":{"type":"string","title":"Statistic"},"datapoints":{"type":"integer","title":"Datapoints"},"peak":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Peak"},"latest":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latest"}},"type":"object","required":["metric","statistic","datapoints"],"title":"MetricSummary"},"MutationCapabilities":{"properties":{"operations":{"items":{"type":"string"},"type":"array","title":"Operations"},"resources":{"items":{"$ref":"#/components/schemas/ResourceMutationCapability"},"type":"array","title":"Resources"}},"type":"object","required":["operations","resources"],"title":"MutationCapabilities"},"MutationConstraint":{"properties":{"operations":{"items":{"type":"string"},"type":"array","title":"Operations"},"kind":{"type":"string","title":"Kind"},"fields":{"items":{"type":"string"},"type":"array","title":"Fields"},"required_fields":{"items":{"type":"string"},"type":"array","title":"Required Fields"},"allowed_fields":{"items":{"type":"string"},"type":"array","title":"Allowed Fields"},"message":{"type":"string","title":"Message"}},"type":"object","required":["operations","kind","message"],"title":"MutationConstraint"},"PurgeRequest":{"properties":{"role_arn":{"type":"string","title":"Role Arn"},"region":{"type":"string","title":"Region","default":"us-east-1"}},"type":"object","required":["role_arn"],"title":"PurgeRequest"},"RDSConfig":{"properties":{"component_type":{"type":"string","const":"rds_instance","title":"Component Type","default":"rds_instance"},"engine":{"type":"string","title":"Engine","default":"postgres"},"publicly_accessible":{"type":"boolean","title":"Publicly Accessible","default":false},"encrypted":{"type":"boolean","title":"Encrypted","default":true},"multi_az":{"type":"boolean","title":"Multi Az","default":false},"subnet_id":{"type":"string","title":"Subnet Id","default":""},"sg_ids":{"items":{"type":"string"},"type":"array","title":"Sg Ids","default":[]},"deletion_protection":{"type":"boolean","title":"Deletion Protection","default":false}},"type":"object","title":"RDSConfig"},"RecoveryPoint":{"properties":{"resource_id":{"type":"string","title":"Resource Id"},"kind":{"type":"string","title":"Kind"},"source_id":{"type":"string","title":"Source Id"}},"type":"object","required":["resource_id","kind","source_id"],"title":"RecoveryPoint"},"RemediationInsightRequest":{"properties":{"rule_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Id"},"severity":{"type":"string","title":"Severity"},"issue":{"type":"string","title":"Issue"},"recommendation":{"type":"string","title":"Recommendation"},"resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Id"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region"},"aws_service":{"type":"string","title":"Aws Service"},"attack_path":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Attack Path","default":[]},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id"}},"type":"object","required":["severity","issue","recommendation","aws_service"],"title":"RemediationInsightRequest"},"RemediationInsightResponse":{"properties":{"what_this_fixes":{"type":"string","title":"What This Fixes"},"why_it_matters":{"type":"string","title":"Why It Matters"}},"type":"object","required":["what_this_fixes","why_it_matters"],"title":"RemediationInsightResponse"},"ResourceMutationCapability":{"properties":{"resource_type":{"type":"string","title":"Resource Type"},"operations":{"items":{"type":"string"},"type":"array","title":"Operations"},"constraints":{"items":{"$ref":"#/components/schemas/MutationConstraint"},"type":"array","title":"Constraints"}},"type":"object","required":["resource_type","operations"],"title":"ResourceMutationCapability"},"S3Config":{"properties":{"component_type":{"type":"string","const":"s3_bucket","title":"Component Type","default":"s3_bucket"},"is_public":{"type":"boolean","title":"Is Public","default":false},"encrypted":{"type":"boolean","title":"Encrypted","default":true},"versioning":{"type":"boolean","title":"Versioning","default":true},"has_cloudfront":{"type":"boolean","title":"Has Cloudfront","default":false}},"type":"object","title":"S3Config"},"SGRuleConfig":{"properties":{"component_type":{"type":"string","const":"sg_rule","title":"Component Type","default":"sg_rule"},"sg_id":{"type":"string","title":"Sg Id"},"action":{"type":"string","enum":["add","remove"],"title":"Action","default":"add"},"port":{"type":"integer","title":"Port","default":443},"protocol":{"type":"string","enum":["tcp","udp"],"title":"Protocol","default":"tcp"},"source":{"type":"string","title":"Source","default":"0.0.0.0/0"}},"type":"object","required":["sg_id"],"title":"SGRuleConfig"},"SimulateRequest":{"properties":{"query":{"type":"string","title":"Query"},"analysis_id":{"type":"string","title":"Analysis Id"}},"type":"object","required":["query","analysis_id"],"title":"SimulateRequest"},"TFIndexRequest":{"properties":{"installation_id":{"type":"integer","title":"Installation Id"},"repo":{"type":"string","title":"Repo"}},"type":"object","required":["installation_id","repo"],"title":"TFIndexRequest"},"TFIndexResponse":{"properties":{"status":{"type":"string","title":"Status"},"resources_found":{"type":"integer","title":"Resources Found","default":0},"repo":{"type":"string","title":"Repo","default":""},"message":{"type":"string","title":"Message","default":""}},"type":"object","required":["status"],"title":"TFIndexResponse"},"TerraformGenerateRequest":{"properties":{"rule_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Id"},"severity":{"type":"string","title":"Severity"},"issue":{"type":"string","title":"Issue"},"recommendation":{"type":"string","title":"Recommendation"},"resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Id"},"resource_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Type"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region"},"aws_service":{"type":"string","title":"Aws Service"},"attack_path":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Attack Path","default":[]},"blast_radius":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Blast Radius","default":0},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id"},"analysis_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Id"}},"type":"object","required":["severity","issue","recommendation","aws_service"],"title":"TerraformGenerateRequest"},"TerraformGenerateResponse":{"properties":{"hcl":{"type":"string","title":"Hcl"},"filename":{"type":"string","title":"Filename"},"valid":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Valid"},"errors":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Errors"}},"type":"object","required":["hcl","filename"],"title":"TerraformGenerateResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerifyFixRequest":{"properties":{"analysis_id":{"type":"string","title":"Analysis Id"},"rule_id":{"type":"string","title":"Rule Id"},"resource_id":{"type":"string","title":"Resource Id"}},"type":"object","required":["analysis_id","rule_id","resource_id"],"title":"VerifyFixRequest"},"VerifyFixResponse":{"properties":{"can_simulate":{"type":"boolean","title":"Can Simulate"},"findings_removed":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Findings Removed","default":[]},"findings_added":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Findings Added","default":[]},"toxic_combos_resolved":{"items":{"type":"string"},"type":"array","title":"Toxic Combos Resolved","default":[]},"toxic_combos_created":{"items":{"type":"string"},"type":"array","title":"Toxic Combos Created","default":[]},"score_before":{"type":"integer","title":"Score Before","default":0},"score_after":{"type":"integer","title":"Score After","default":0},"score_delta":{"type":"integer","title":"Score Delta","default":0},"safe_to_apply":{"type":"boolean","title":"Safe To Apply","default":true}},"type":"object","required":["can_simulate"],"title":"VerifyFixResponse"}}}}