{"openapi":"3.1.0","info":{"title":"RANNTA Agent Firewall","description":"Authorization and risk-control layer for autonomous agent execution.","version":"0.8.0"},"paths":{"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"}}}}}}},"/v1/admin/tenants":{"get":{"summary":"List Tenants","operationId":"list_tenants_v1_admin_tenants_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TenantResponse"},"type":"array","title":"Response List Tenants V1 Admin Tenants Get"}}}}},"security":[{"AdminBearer":[]}]},"post":{"summary":"Create Or Update Tenant","operationId":"create_or_update_tenant_v1_admin_tenants_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTenantRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"AdminBearer":[]}]}},"/v1/admin/tenants/{tenant_id}":{"get":{"summary":"Get Tenant","operationId":"get_tenant_v1_admin_tenants__tenant_id__get","security":[{"AdminBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/tenants/{tenant_id}/keys":{"post":{"summary":"Create Tenant Key","operationId":"create_tenant_key_v1_admin_tenants__tenant_id__keys_post","security":[{"AdminBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Tenant Keys","operationId":"list_tenant_keys_v1_admin_tenants__tenant_id__keys_get","security":[{"AdminBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyResponse"},"title":"Response List Tenant Keys V1 Admin Tenants  Tenant Id  Keys Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/keys/{key_id}/revoke":{"post":{"summary":"Revoke Key","operationId":"revoke_key_v1_admin_keys__key_id__revoke_post","security":[{"AdminBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sessions/register":{"post":{"summary":"Register Session","operationId":"register_session_v1_sessions_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterSessionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"TenantApiKey":[]}]}},"/v1/judge":{"post":{"summary":"Judge Action","operationId":"judge_action_v1_judge_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JudgeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JudgeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"TenantApiKey":[]}]}},"/v1/verify":{"post":{"summary":"Verify","operationId":"verify_v1_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"TenantApiKey":[]}]}},"/v1/consume":{"post":{"summary":"Consume","operationId":"consume_v1_consume_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsumeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsumeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"TenantApiKey":[]}]}},"/v1/execute":{"post":{"summary":"Execute","operationId":"execute_v1_execute_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"TenantApiKey":[]}]}},"/v1/verdict/{verdict_id}":{"get":{"summary":"Get Verdict","operationId":"get_verdict_v1_verdict__verdict_id__get","security":[{"TenantApiKey":[]}],"parameters":[{"name":"verdict_id","in":"path","required":true,"schema":{"type":"string","title":"Verdict Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Verdict V1 Verdict  Verdict Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/proof/{verdict_id}":{"get":{"summary":"Get Proof","operationId":"get_proof_v1_proof__verdict_id__get","security":[{"TenantApiKey":[]}],"parameters":[{"name":"verdict_id","in":"path","required":true,"schema":{"type":"string","title":"Verdict Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Get Proof V1 Proof  Verdict Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/usage":{"get":{"summary":"Get Account Usage","operationId":"get_account_usage_v1_account_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageSummaryResponse"}}}}},"security":[{"TenantApiKey":[]}]}},"/v1/account/audit":{"get":{"summary":"Get Account Audit","operationId":"get_account_audit_v1_account_audit_get","security":[{"TenantApiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"}},{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ActionType":{"type":"string","enum":["transfer","swap","approve","contract_call","payment","other"],"title":"ActionType"},"ApiKeyResponse":{"properties":{"key_id":{"type":"string","title":"Key Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"key_prefix":{"type":"string","title":"Key Prefix"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},"type":"object","required":["key_id","tenant_id","key_prefix","name","status","created_at","updated_at"],"title":"ApiKeyResponse"},"AuditEventResponse":{"properties":{"audit_id":{"type":"string","title":"Audit Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"api_key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Id"},"event_type":{"type":"string","title":"Event Type"},"resource_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Type"},"resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Id"},"status_code":{"type":"integer","title":"Status Code"},"summary":{"additionalProperties":true,"type":"object","title":"Summary"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["audit_id","tenant_id","event_type","status_code","summary","created_at"],"title":"AuditEventResponse"},"AuditListResponse":{"properties":{"events":{"items":{"$ref":"#/components/schemas/AuditEventResponse"},"type":"array","title":"Events"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["events"],"title":"AuditListResponse"},"ConsumeRequest":{"properties":{"verdict_id":{"type":"string","maxLength":128,"minLength":1,"title":"Verdict Id"},"decision_hash":{"type":"string","maxLength":64,"minLength":64,"title":"Decision Hash"},"consumer":{"type":"string","maxLength":128,"minLength":1,"title":"Consumer"},"session_id":{"type":"string","maxLength":128,"minLength":1,"title":"Session Id"},"consumer_proof":{"$ref":"#/components/schemas/ConsumerProof"}},"type":"object","required":["verdict_id","decision_hash","consumer","session_id","consumer_proof"],"title":"ConsumeRequest"},"ConsumeResponse":{"properties":{"verdict_id":{"type":"string","title":"Verdict Id"},"consumed":{"type":"boolean","title":"Consumed"},"consumer":{"type":"string","title":"Consumer"},"decision_hash":{"type":"string","title":"Decision Hash"}},"type":"object","required":["verdict_id","consumed","consumer","decision_hash"],"title":"ConsumeResponse"},"ConsumerProof":{"properties":{"issued_at":{"type":"integer","exclusiveMinimum":0.0,"title":"Issued At"},"authorization":{"additionalProperties":true,"type":"object","title":"Authorization"}},"type":"object","required":["issued_at","authorization"],"title":"ConsumerProof"},"CreateApiKeyRequest":{"properties":{"name":{"type":"string","maxLength":160,"minLength":1,"title":"Name"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["name"],"title":"CreateApiKeyRequest"},"CreateTenantRequest":{"properties":{"tenant_id":{"anyOf":[{"type":"string","maxLength":96,"minLength":1},{"type":"null"}],"title":"Tenant Id"},"name":{"type":"string","maxLength":160,"minLength":1,"title":"Name"},"status":{"$ref":"#/components/schemas/TenantStatus","default":"active"},"plan":{"$ref":"#/components/schemas/TenantPlan","default":"pilot"},"monthly_request_limit":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Monthly Request Limit"},"monthly_judgement_limit":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Monthly Judgement Limit"}},"type":"object","required":["name"],"title":"CreateTenantRequest"},"ExecuteRequest":{"properties":{"verdict_id":{"type":"string","title":"Verdict Id"},"adapter":{"type":"string","maxLength":64,"minLength":1,"title":"Adapter","default":"dry_run"}},"type":"object","required":["verdict_id"],"title":"ExecuteRequest"},"ExecuteResponse":{"properties":{"verdict_id":{"type":"string","title":"Verdict Id"},"success":{"type":"boolean","title":"Success"},"adapter":{"type":"string","title":"Adapter"},"execution_id":{"type":"string","title":"Execution Id"},"details":{"additionalProperties":true,"type":"object","title":"Details"}},"type":"object","required":["verdict_id","success","adapter","execution_id","details"],"title":"ExecuteResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"JudgeRequest":{"properties":{"agent_id":{"type":"string","maxLength":128,"minLength":1,"title":"Agent Id"},"action":{"$ref":"#/components/schemas/ActionType"},"chain":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Chain"},"asset":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Asset"},"amount":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Amount"},"destination":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Destination"},"intent":{"type":"string","maxLength":2048,"minLength":1,"title":"Intent"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["agent_id","action","intent"],"title":"JudgeRequest"},"JudgeResponse":{"properties":{"verdict_id":{"type":"string","title":"Verdict Id"},"verdict":{"$ref":"#/components/schemas/Verdict"},"risk_score":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Risk Score"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence"},"reasons":{"items":{"$ref":"#/components/schemas/Reason"},"type":"array","title":"Reasons"},"policy_version":{"type":"string","title":"Policy Version"},"decision_hash":{"type":"string","title":"Decision Hash"},"signature":{"type":"string","title":"Signature"},"signing_key_id":{"type":"string","title":"Signing Key Id"},"issued_at":{"type":"string","title":"Issued At"},"expires_at":{"type":"string","title":"Expires At"}},"type":"object","required":["verdict_id","verdict","risk_score","confidence","reasons","policy_version","decision_hash","signature","signing_key_id","issued_at","expires_at"],"title":"JudgeResponse"},"Reason":{"properties":{"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"},"severity":{"type":"string","title":"Severity"}},"type":"object","required":["code","message","severity"],"title":"Reason"},"RegisterSessionRequest":{"properties":{"signed_policy_payload":{"type":"string","minLength":1,"title":"Signed Policy Payload"},"policy_authorization":{"additionalProperties":true,"type":"object","title":"Policy Authorization"}},"type":"object","required":["signed_policy_payload","policy_authorization"],"title":"RegisterSessionRequest"},"RegisterSessionResponse":{"properties":{"registered":{"type":"boolean","title":"Registered"},"session_id":{"type":"string","title":"Session Id"},"policy_hash":{"type":"string","title":"Policy Hash"},"pq_public_key_hash":{"type":"string","title":"Pq Public Key Hash"},"expires_at_ms":{"type":"integer","title":"Expires At Ms"}},"type":"object","required":["registered","session_id","policy_hash","pq_public_key_hash","expires_at_ms"],"title":"RegisterSessionResponse"},"TenantPlan":{"type":"string","enum":["pilot","starter","growth","enterprise"],"title":"TenantPlan"},"TenantResponse":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"status":{"$ref":"#/components/schemas/TenantStatus"},"plan":{"$ref":"#/components/schemas/TenantPlan"},"monthly_request_limit":{"type":"integer","title":"Monthly Request Limit"},"monthly_judgement_limit":{"type":"integer","title":"Monthly Judgement Limit"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["tenant_id","name","status","plan","monthly_request_limit","monthly_judgement_limit","created_at","updated_at"],"title":"TenantResponse"},"TenantStatus":{"type":"string","enum":["active","suspended","disabled"],"title":"TenantStatus"},"UsageSummaryResponse":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"period_start":{"type":"string","title":"Period Start"},"period_end":{"type":"string","title":"Period End"},"requests":{"type":"integer","title":"Requests"},"judgements":{"type":"integer","title":"Judgements"},"monthly_request_limit":{"type":"integer","title":"Monthly Request Limit"},"monthly_judgement_limit":{"type":"integer","title":"Monthly Judgement Limit"}},"type":"object","required":["tenant_id","period_start","period_end","requests","judgements","monthly_request_limit","monthly_judgement_limit"],"title":"UsageSummaryResponse"},"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"},"Verdict":{"type":"string","enum":["ALLOW","DENY","REVIEW"],"title":"Verdict"},"VerifyRequest":{"properties":{"verdict_id":{"type":"string","title":"Verdict Id"},"decision_hash":{"type":"string","title":"Decision Hash"}},"type":"object","required":["verdict_id","decision_hash"],"title":"VerifyRequest"},"VerifyResponse":{"properties":{"valid":{"type":"boolean","title":"Valid"},"verdict_id":{"type":"string","title":"Verdict Id"},"signature_valid":{"type":"boolean","title":"Signature Valid","default":false}},"type":"object","required":["valid","verdict_id"],"title":"VerifyResponse"}},"securitySchemes":{"AdminBearer":{"type":"http","scheme":"bearer"},"TenantApiKey":{"type":"http","scheme":"bearer"}}}}