{"openapi":"3.1.0","info":{"title":"Warden API","version":"1.0.0","description":"Register every AI agent your company runs, log every action it takes, and let procurement verify the audit trail.","contact":{"name":"Warden","url":"https://warden.flowvolt.io","email":"support@warden.flowvolt.io"}},"servers":[{"url":"https://warden.flowvolt.io"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Per-tenant API key. Provision one in /workspace/settings."}},"schemas":{"Agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"name":{"type":"string"},"owner":{"type":"string","nullable":true},"purpose":{"type":"string","nullable":true},"source":{"type":"string","enum":["internal","external"]},"model":{"type":"string","nullable":true},"mandate":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","paused","unmanaged"]},"last_seen_at":{"type":"string","format":"date-time"}}},"AuditEntry":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"agent_slug":{"type":"string"},"action_type":{"type":"string"},"summary":{"type":"string","nullable":true},"status":{"type":"string","enum":["done","failed","blocked","pending_approval"]},"cost_usd":{"type":"number","nullable":true},"created_at":{"type":"string","format":"date-time"}}},"Error":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"type":"string"}}}}},"security":[{"bearerAuth":[]}],"paths":{"/api/warden/agents":{"get":{"summary":"List registered agents","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"agents":{"type":"array","items":{"$ref":"#/components/schemas/Agent"}}}}}}},"401":{"description":"Missing or invalid bearer key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Register or upsert an agent","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"type":"string","pattern":"^[a-z0-9_-]+$"},"name":{"type":"string"},"owner":{"type":"string"},"purpose":{"type":"string"},"source":{"type":"string","enum":["internal","external"]},"model":{"type":"string"},"mandate":{"type":"string","description":"One-line description of what the agent is allowed to do."}}}}}},"responses":{"200":{"description":"Agent registered","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"agent":{"$ref":"#/components/schemas/Agent"}}}}}}}}},"/api/warden/log":{"post":{"summary":"Log one action taken by an agent","description":"Auto-registers the agent as unmanaged if not previously seen.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["agent","action_type"],"properties":{"agent":{"type":"string","description":"Agent slug"},"action_type":{"type":"string","description":"Short identifier (e.g. email.sent, deal.updated)"},"summary":{"type":"string","description":"One-line human-readable description"},"payload":{"type":"object","additionalProperties":true},"status":{"type":"string","enum":["done","failed","blocked","pending_approval"],"default":"done"},"cost_usd":{"type":"number"}}}}}},"responses":{"200":{"description":"Logged","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"id":{"type":"string","format":"uuid"},"agent_status":{"type":"string"},"auto_registered":{"type":"boolean"}}}}}}}}},"/api/warden/public/{tenant}":{"get":{"summary":"Public Glass Workforce view","description":"Read-only, no authentication. Returns the agents and recent audit events the tenant has chosen to publish.","security":[],"parameters":[{"name":"tenant","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"tenant":{"type":"string"},"agents":{"type":"array","items":{"$ref":"#/components/schemas/Agent"}},"recent":{"type":"array","items":{"$ref":"#/components/schemas/AuditEntry"}}}}}}}}}}},"webhooks":{"agent.registered":{"post":{"summary":"Fired when a new agent is registered (manually or via auto-register).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"string","enum":["agent.registered"]},"tenant_id":{"type":"string"},"occurred_at":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"source":{"type":"string"}}}}}}}},"responses":{"200":{"description":"Acknowledge with 2xx"}}}},"audit.event.logged":{"post":{"summary":"Fired for every action logged to the audit trail.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"string","enum":["audit.event.logged"]},"tenant_id":{"type":"string"},"occurred_at":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"id":{"type":"string"},"agent":{"type":"string"},"action_type":{"type":"string"},"status":{"type":"string"},"summary":{"type":"string","nullable":true}}}}}}}},"responses":{"200":{"description":"Acknowledge with 2xx"}}}},"intake.completed":{"post":{"summary":"Fired when an EU AI Act intake is completed for an agent.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"string","enum":["intake.completed"]},"tenant_id":{"type":"string"},"occurred_at":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"agent_slug":{"type":"string"},"classification":{"type":"string","enum":["prohibited","high_risk","limited_risk","minimal_risk"]},"completed_at":{"type":"string","format":"date-time"}}}}}}}},"responses":{"200":{"description":"Acknowledge with 2xx"}}}}}}