{"openapi":"3.1.0","info":{"title":"Compliancly.ai AI Agent (Sentinel)","description":"Autonomous multi-agent pentest orchestrator.","version":"0.1.0"},"paths":{"/health":{"get":{"tags":["meta"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/ready":{"get":{"tags":["meta"],"summary":"Ready","operationId":"ready_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/v1/runs":{"post":{"tags":["runs"],"summary":"Start Run","description":"Create a run and kick off the executor in a background task.","operationId":"start_run_v1_runs_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["runs"],"summary":"List Runs","operationId":"list_runs_v1_runs_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Page Size"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/RunStatus"},{"type":"null"}],"title":"Status"}},{"name":"asset_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Asset Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/runs/recent":{"get":{"tags":["runs"],"summary":"List Recent Runs","description":"Most recent runs across the tenant. Defined BEFORE /{run_id} so FastAPI\nmatches the literal 'recent' before treating it as a UUID path-param.","operationId":"list_recent_runs_v1_runs_recent_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":5,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RunRead"},"title":"Response List Recent Runs V1 Runs Recent Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/runs/{run_id}":{"get":{"tags":["runs"],"summary":"Get Run","operationId":"get_run_v1_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/runs/{run_id}/cancel":{"post":{"tags":["runs"],"summary":"Cancel Run","description":"Mark a run cancelled. Executor checks status and exits next tick.","operationId":"cancel_run_v1_runs__run_id__cancel_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/runs/{run_id}/steps":{"get":{"tags":["runs"],"summary":"List Steps","operationId":"list_steps_v1_runs__run_id__steps_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StepRead"},"title":"Response List Steps V1 Runs  Run Id  Steps Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/runs/{run_id}/findings":{"get":{"tags":["runs"],"summary":"List Findings","operationId":"list_findings_v1_runs__run_id__findings_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FindingRead"},"title":"Response List Findings V1 Runs  Run Id  Findings Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/runs/stats/summary":{"get":{"tags":["stats"],"summary":"Get Stats","operationId":"get_stats_v1_runs_stats_summary_get","parameters":[{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Super-admin only: stats for a specific tenant. Non-super-admins ignore this and see their own tenant.","title":"Tenant Id"},"description":"Super-admin only: stats for a specific tenant. Non-super-admins ignore this and see their own tenant."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunStats"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tools":{"get":{"tags":["tools"],"summary":"Get Tool Catalog","operationId":"get_tool_catalog_v1_tools_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ToolDescriptor"},"type":"array","title":"Response Get Tool Catalog V1 Tools Get"}}}}}}},"/v1/scan-schedules":{"post":{"tags":["schedules"],"summary":"Create Scan Schedule","operationId":"create_scan_schedule_v1_scan_schedules_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanScheduleCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanScheduleRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["schedules"],"summary":"List Scan Schedules","operationId":"list_scan_schedules_v1_scan_schedules_get","parameters":[{"name":"asset_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Asset Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ScanScheduleRead"},"title":"Response List Scan Schedules V1 Scan Schedules Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/scan-schedules/{schedule_id}":{"get":{"tags":["schedules"],"summary":"Get Scan Schedule","operationId":"get_scan_schedule_v1_scan_schedules__schedule_id__get","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanScheduleRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["schedules"],"summary":"Update Scan Schedule","operationId":"update_scan_schedule_v1_scan_schedules__schedule_id__patch","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Schedule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanScheduleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanScheduleRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["schedules"],"summary":"Delete Scan Schedule","operationId":"delete_scan_schedule_v1_scan_schedules__schedule_id__delete","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Schedule Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/assets/{asset_id}/report":{"get":{"tags":["report"],"summary":"Get Asset Report","description":"Aggregate report bundle: asset metadata + runs + findings +\ncompliance framework rollup. Drives the printable report page.","operationId":"get_asset_report_v1_assets__asset_id__report_get","parameters":[{"name":"asset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Asset Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Asset Report V1 Assets  Asset Id  Report Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/scan-schedules/run-now":{"post":{"tags":["super-admin"],"summary":"Admin Run Scan Cron","description":"Manually trigger one cron tick — useful for smoke tests / debugging.\n\nRe-uses the schedule due-filter in `fire_due_schedules()`, so it will\nonly fire schedules whose `next_run_at <= NOW()`.","operationId":"admin_run_scan_cron_v1_admin_scan_schedules_run_now_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Run Scan Cron V1 Admin Scan Schedules Run Now Post"}}}}}}}},"components":{"schemas":{"AgentKind":{"type":"string","enum":["orchestrator","recon","exploit","privilege","code","compliance","reporter","patchman"],"title":"AgentKind","description":"The roles in the multi-agent loop."},"Cadence":{"type":"string","enum":["daily","weekly","monthly"],"title":"Cadence","description":"How often a scheduled scan runs."},"FindingRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"run_id":{"type":"string","format":"uuid","title":"Run Id"},"title":{"type":"string","title":"Title"},"severity":{"type":"string","title":"Severity"},"asset_target":{"type":"string","title":"Asset Target"},"description":{"type":"string","title":"Description"},"proof_of_concept":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Proof Of Concept"},"suggested_fix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Fix"},"cve_ids":{"items":{"type":"string"},"type":"array","title":"Cve Ids"},"cvss_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cvss Score"},"epss_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Epss Score"},"cwe_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cwe Id"},"owasp_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owasp Category"},"confidence":{"type":"number","title":"Confidence"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","run_id","title","severity","asset_target","description","proof_of_concept","suggested_fix","cve_ids","cvss_score","epss_score","cwe_id","owasp_category","confidence","created_at"],"title":"FindingRead"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status","default":"ok"},"service":{"type":"string","title":"Service"},"version":{"type":"string","title":"Version"},"db_ok":{"type":"boolean","title":"Db Ok"},"llm_gateway_ok":{"type":"boolean","title":"Llm Gateway Ok"},"qdrant_ok":{"type":"boolean","title":"Qdrant Ok"},"registered_tools":{"type":"integer","title":"Registered Tools"}},"type":"object","required":["service","version","db_ok","llm_gateway_ok","qdrant_ok","registered_tools"],"title":"HealthResponse"},"RunCreate":{"properties":{"asset_id":{"type":"string","format":"uuid","title":"Asset Id"},"target":{"type":"string","maxLength":2048,"minLength":3,"title":"Target"},"objective":{"type":"string","maxLength":2000,"minLength":10,"title":"Objective"},"mode":{"$ref":"#/components/schemas/RunMode","default":"observe"},"max_steps":{"anyOf":[{"type":"integer","maximum":200.0,"minimum":1.0},{"type":"null"}],"title":"Max Steps"},"max_wall_clock_seconds":{"anyOf":[{"type":"integer","maximum":7200.0,"minimum":30.0},{"type":"null"}],"title":"Max Wall Clock Seconds"},"max_llm_cost_usd":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.1},{"type":"null"}],"title":"Max Llm Cost Usd"},"scan_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Scan Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["asset_id","target","objective"],"title":"RunCreate"},"RunList":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RunRead"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"}},"type":"object","required":["items","total","page","page_size"],"title":"RunList"},"RunMode":{"type":"string","enum":["passive","observe","active","aggressive"],"title":"RunMode","description":"Aggressiveness of the run."},"RunRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"tenant_id":{"type":"string","format":"uuid","title":"Tenant Id"},"asset_id":{"type":"string","format":"uuid","title":"Asset Id"},"scan_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Scan Id"},"target":{"type":"string","title":"Target"},"objective":{"type":"string","title":"Objective"},"mode":{"$ref":"#/components/schemas/RunMode"},"status":{"$ref":"#/components/schemas/RunStatus"},"max_steps":{"type":"integer","title":"Max Steps"},"max_wall_clock_seconds":{"type":"integer","title":"Max Wall Clock Seconds"},"max_llm_cost_usd":{"type":"number","title":"Max Llm Cost Usd"},"steps_count":{"type":"integer","title":"Steps Count"},"findings_count":{"type":"integer","title":"Findings Count"},"llm_cost_usd":{"type":"number","title":"Llm Cost Usd"},"llm_calls_count":{"type":"integer","title":"Llm Calls Count"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","tenant_id","asset_id","scan_id","target","objective","mode","status","max_steps","max_wall_clock_seconds","max_llm_cost_usd","steps_count","findings_count","llm_cost_usd","llm_calls_count","summary","error_message","started_at","finished_at","created_at","updated_at"],"title":"RunRead"},"RunStats":{"properties":{"by_status":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Status"},"runs_last_7d":{"type":"integer","title":"Runs Last 7D"},"cost_last_7d_usd":{"type":"number","title":"Cost Last 7D Usd"},"total_findings_emitted":{"type":"integer","title":"Total Findings Emitted"},"avg_runtime_seconds":{"type":"number","title":"Avg Runtime Seconds"},"running_count":{"type":"integer","title":"Running Count"}},"type":"object","required":["by_status","runs_last_7d","cost_last_7d_usd","total_findings_emitted","avg_runtime_seconds","running_count"],"title":"RunStats"},"RunStatus":{"type":"string","enum":["pending","running","paused","succeeded","failed","cancelled","budget_exceeded","timeout"],"title":"RunStatus"},"ScanScheduleCreate":{"properties":{"asset_id":{"type":"string","format":"uuid","title":"Asset Id"},"target":{"type":"string","maxLength":2048,"minLength":3,"title":"Target"},"objective":{"type":"string","maxLength":2000,"minLength":10,"title":"Objective"},"cadence":{"$ref":"#/components/schemas/Cadence"},"mode":{"$ref":"#/components/schemas/RunMode","default":"observe"},"max_llm_cost_usd":{"type":"number","maximum":100.0,"minimum":0.1,"title":"Max Llm Cost Usd","default":1.0},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["asset_id","target","objective","cadence"],"title":"ScanScheduleCreate"},"ScanScheduleRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"tenant_id":{"type":"string","format":"uuid","title":"Tenant Id"},"asset_id":{"type":"string","format":"uuid","title":"Asset Id"},"cadence":{"$ref":"#/components/schemas/Cadence"},"enabled":{"type":"boolean","title":"Enabled"},"next_run_at":{"type":"string","format":"date-time","title":"Next Run At"},"last_run_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Run At"},"last_run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Last Run Id"},"mode":{"$ref":"#/components/schemas/RunMode"},"objective":{"type":"string","title":"Objective"},"target":{"type":"string","title":"Target"},"max_llm_cost_usd":{"type":"number","title":"Max Llm Cost Usd"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","tenant_id","asset_id","cadence","enabled","next_run_at","last_run_at","last_run_id","mode","objective","target","max_llm_cost_usd","created_by","created_at","updated_at"],"title":"ScanScheduleRead"},"ScanScheduleUpdate":{"properties":{"cadence":{"anyOf":[{"$ref":"#/components/schemas/Cadence"},{"type":"null"}]},"mode":{"anyOf":[{"$ref":"#/components/schemas/RunMode"},{"type":"null"}]},"objective":{"anyOf":[{"type":"string","maxLength":2000,"minLength":10},{"type":"null"}],"title":"Objective"},"max_llm_cost_usd":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.1},{"type":"null"}],"title":"Max Llm Cost Usd"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"ScanScheduleUpdate"},"StepKind":{"type":"string","enum":["thought","tool_call","tool_result","handoff","finding","decision","error"],"title":"StepKind"},"StepRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"run_id":{"type":"string","format":"uuid","title":"Run Id"},"sequence":{"type":"integer","title":"Sequence"},"agent":{"$ref":"#/components/schemas/AgentKind"},"kind":{"$ref":"#/components/schemas/StepKind"},"status":{"$ref":"#/components/schemas/StepStatus"},"title":{"type":"string","title":"Title"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Name"},"tool_input":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tool Input"},"tool_output":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tool Output"},"tool_duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tool Duration Ms"},"llm_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llm Model"},"llm_input_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Llm Input Tokens"},"llm_output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Llm Output Tokens"},"llm_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Llm Cost Usd"},"llm_latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Llm Latency Ms"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","run_id","sequence","agent","kind","status","title","body","tool_name","tool_input","tool_output","tool_duration_ms","llm_model","llm_input_tokens","llm_output_tokens","llm_cost_usd","llm_latency_ms","error_code","error_message","created_at"],"title":"StepRead"},"StepStatus":{"type":"string","enum":["ok","error","skipped","blocked"],"title":"StepStatus"},"ToolDescriptor":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"safety_class":{"type":"integer","title":"Safety Class"},"safety_name":{"type":"string","title":"Safety Name"},"input_schema":{"additionalProperties":true,"type":"object","title":"Input Schema"}},"type":"object","required":["name","description","safety_class","safety_name","input_schema"],"title":"ToolDescriptor"},"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"}}}}