Credential Lifecycle
Register, rotate, suspend, resume, and revoke agent credentials, and what the gateway does at each stage.
An agent's credential is its Ed25519 public key. The control plane manages its lifecycle; the gateway enforces it on every request.
States
| Agent status | Credential | Gateway behavior |
|---|---|---|
active | one active key | Requests authenticate and are evaluated by policy |
suspended | key stays active | Requests authenticate and are denied: agent is suspended |
revoked | every key revoked | Requests are denied: agent is revoked. Permanent |
Suspended and revoked agents are denied with a recorded, audited decision rather than a bare 401. You can see exactly what a disabled agent tried to do.
Operations
All operations are on the control plane and require a bearer session.
| Operation | Route | Roles | Event |
|---|---|---|---|
| Register | POST /api/v1/agents | owner, admin, operator | agent.registered |
| Rotate key | POST /api/v1/agents/{agentId}/credentials/rotate | owner, admin | credential.rotated |
| Suspend | POST /api/v1/agents/{agentId}/suspend | owner, admin | agent.suspended |
| Resume | POST /api/v1/agents/{agentId}/resume | owner, admin | agent.resumed |
| Revoke | POST /api/v1/agents/{agentId}/revoke | owner, admin | agent.revoked |
Register
curl -s http://127.0.0.1:8080/api/v1/agents \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"name":"billing-agent","framework":"langgraph","public_key":"<43-char base64url>"}'The public key must decode to exactly 32 bytes. Names are unique per organization, and a public key can be registered only once across the system (409 conflict otherwise).
Rotate
Rotation needs an active agent with exactly one active credential. It marks that credential rotated and stores the new public key as active, in one transaction:
curl -s -X POST http://127.0.0.1:8080/api/v1/agents/$AGENT_ID/credentials/rotate \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"public_key":"<new 43-char base64url>"}'{ "id": "…", "agent_id": "…", "algorithm": "ed25519", "fingerprint": "<sha256 hex>", "status": "active" }Rotation is immediate. Requests signed with the old seed fail authentication as soon as it commits.
Generate a new seed on the agent host and derive its public key.
Call rotate with the new public key.
Restart or reconfigure the agent with the new seed.
Destroy the old seed.
A suspended or revoked agent cannot be rotated.
Suspend and resume
Suspend changes the agent status and leaves the key in place. Use it to stop an agent quickly while you investigate, without forcing a key change. Resume returns a suspended agent to active. A revoked agent cannot be resumed.
Revoke
Revoke sets the agent and every one of its credentials to revoked and records revoked_at. It cannot be undone; the console asks for confirmation. Register a new agent if the workload needs to run again.
Validity windows
Credentials carry not_before and an optional not_after. The gateway treats a credential as active only inside that window. The control plane's registration and rotation routes create credentials that are valid from creation with no expiry.
When to use which
| Situation | Action |
|---|---|
| Seed may have leaked | Rotate immediately, then investigate events signed with the old key |
| Agent behaving unexpectedly | Suspend, review events and incidents, then resume or revoke |
| Workload retired | Revoke |
| Scheduled hygiene | Rotate on your own schedule; AgentShield does not expire keys automatically |
Implementation references
Was this page helpful?
Human Approvals
How require_approval holds a call for a person, how approvals are bound to the exact request, and how they are consumed exactly once.
System Architecture
The complete AgentShield system. Processes, libraries, data stores, how they communicate, and why the boundaries are drawn where they are.