API Reference
The AgentShield HTTP APIs. Two services, two authentication schemes, one error envelope. Rendered from the OpenAPI contracts in the repository.
AgentShield exposes two HTTP APIs on separate origins. They never share authentication.
| API | Default origin | Callers | Authentication | Contract |
|---|---|---|---|---|
| Gateway API | http://127.0.0.1:8081 | Agents | Ed25519 request signature | docs/api/gateway.openapi.yaml |
| Control plane API | http://127.0.0.1:8080 | Humans and automation acting for them | Bearer session | docs/api/control-plane.openapi.yaml |
Every endpoint in this reference is rendered at build time from those OpenAPI 3.1 files, so the reference cannot list an operation the contract does not define.
Conventions
- JSON only. Requests and responses are
application/jsonwith UTF-8. - Versioned paths. Management routes live under
/api/v1/...; enforcement routes under/api/v1/runtime/.... Health routes are/health/liveand/health/readyon every service. - Strict bodies. Unknown fields are rejected with
400 validation_failed. - UUID identifiers for agents, policies, approvals, decisions, and executions.
- Timestamps are RFC 3339 in UTC.
- Pagination. List routes that page accept
limitand an opaquecursor, and returnitemswithnext_cursor. - Errors use one envelope everywhere. See Error responses.
- Security headers. Responses carry
X-Content-Type-Options: nosniff,X-Frame-Options: DENY,Referrer-Policy: no-referrer, andCache-Control: no-store.
Gateway operations
| Method | Path | Summary |
|---|---|---|
| GET | /health/live | Process liveness |
| GET | /health/ready | Readiness |
| POST | /api/v1/runtime/authorize | Authorize one tool call |
| POST | /api/v1/runtime/execute | Execute a previously allowed tool call |
Control plane operations
| Method | Path | Summary |
|---|---|---|
| GET | /health/live | Process liveness |
| GET | /health/ready | Readiness |
| POST | /api/v1/sessions | Create a human session |
| GET | /api/v1/sessions/current | The caller's user, organization, role, and session expiry |
| DELETE | /api/v1/sessions/current | End the session that made this request |
| POST | /api/v1/sessions/current/password | Change the caller's password and end their other sessions |
| GET | /api/v1/members | List the organization's members |
| POST | /api/v1/members | Add a user with a generated temporary password |
| PATCH | /api/v1/members/{userId} | Change a member's role or status |
| POST | /api/v1/members/{userId}/invitation | Email a new invitation and close the previous link |
| POST | /api/v1/invitations/lookup | Who an open invitation is for |
| POST | /api/v1/invitations/accept | Choose a password and close the invitation |
| GET | /api/v1/alerts | Content analysis alerts, newest first |
| PATCH | /api/v1/alerts/{alertId} | Acknowledge or resolve an alert |
| GET | /api/v1/evidence | Evidence bundles the event relay stored |
| GET | /api/v1/evidence/{evidenceId} | Read one bundle after checking its SHA-256 |
| GET | /api/v1/metrics/reliability | Tool reliability over the last N minutes |
| GET | /api/v1/agents | List agents in the caller's organization |
| POST | /api/v1/agents | Register an agent public key |
| GET | /api/v1/agents/{agentId} | Get one agent |
| POST | /api/v1/agents/{agentId}/revoke | Revoke an agent and its active credentials |
| POST | /api/v1/agents/{agentId}/suspend | Suspend an agent without retiring its key |
| POST | /api/v1/agents/{agentId}/resume | Let a suspended agent call again |
| POST | /api/v1/agents/{agentId}/credentials/rotate | Add a new public key and mark the previous key rotated |
| GET | /api/v1/policies | List policies in the caller's organization |
| POST | /api/v1/policies | Create a policy and its first immutable version |
| GET | /api/v1/policies/{policyId} | Read one policy and the document of its current version |
| PUT | /api/v1/policies/{policyId} | Append a new policy version and move the current pointer |
| GET | /api/v1/approvals | List approval requests |
| POST | /api/v1/approvals | Record an approval request for an existing authorization decision(reserved) |
| POST | /api/v1/approvals/{approvalId}/approve | Approve the exact bound payload |
| POST | /api/v1/approvals/{approvalId}/reject | Reject an approval request |
| GET | /api/v1/events | List redacted security events |
| GET | /api/v1/incidents | List security incidents |
| GET | /api/v1/audit | List hash-chain links for the caller's organization |
| GET | /api/v1/audit/exports | List exported audit head copies |
| POST | /api/v1/audit/exports | Export the current audit head hash |
| GET | /api/v1/chaos/scenarios | List the chaos scenario catalog |
| GET | /api/v1/chaos/experiments | List the 50 most recent experiments |
| POST | /api/v1/chaos/experiments | Start a chaos experiment |
| GET | /api/v1/chaos/experiments/{experimentId} | Read one chaos experiment |
Reserved operations
The contract reserves POST /api/v1/approvals for a gateway service identity. The control plane does not register it, because the gateway is the only writer of approval requests. Calls return 404.
In addition to the contract, the control plane serves GET /api/v1/events/stream, a server-sent events stream for the console. See Events.
Guides by topic
Authentication
Agent management
Policy management
Approval management
Tool execution
Events
Error responses
Status codes
Was this page helpful?