Stop an agent
Pause an agent, or stop it and every agent under it for good, with one change that takes effect at its next token request.
APIRFC 7662
When an agent misbehaves, or its job is done, one change to its status stops it, and every agent created under it. Each token request walks up from the agent to the user at the top of its chain, and any link that isn’t active stops it, so agents under a stopped one need no change of their own. This guide is for agent owners, security teams and incident responders.
Before you start:
- Who can do it: a realm administrator (a group holding
RealmOwner). A user can’t stop an agent, but can stop it acting for them (Let users remove agents). - Where: today this is done through the API, as
below, with your session in
$CVYUH_SESSION(Call the API). - What you need: the agent’s id, here
invoice-agent.
Choose how far to go
Section titled “Choose how far to go”| Change | Effect | Undo? |
|---|---|---|
| Quarantine | No new tokens for the agent or anything under it | Yes: set it back to active |
| Kill | No new tokens for the agent or anything under it, ever | No |
| Retire | As kill, for an agent you’re done with | No |
| Deactivate the user at the top of its chain | Every agent under them stops | Reactivate the user |
The user at the top of a chain isn’t always the agent’s business owner. Deactivating an owner who isn’t at the top leaves their agents running, unless a provider you receive signals from reports the owner disabled (Receive signals): stop those agents here.
Stop it
Section titled “Stop it”-
To pause it, quarantine it:
Terminal window curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/agent/invoice-agent \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "status": "quarantined" }' -
To stop it for good, kill it, or retire it when it’s simply done:
Terminal window curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/agent/invoice-agent \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "status": "killed" }'Send
"retired"to retire it.
Check it worked
Section titled “Check it worked”- New token requests are refused from the moment the change is saved. The agent sees
invalid_clienton its next request, with no further detail. - Tokens already out read inactive when an API checks them (see Check a token at your API).
- The gateway refuses them once its revocation list refreshes. Every agent that’s no longer active, and every agent under it, is listed there.
- Delegated tokens in which the agent acts for a user end too.
- Pending approvals. An agent quarantined while it waits for its owner’s approval collects nothing.
- On the trail. The change is recorded as
AGENT_QUARANTINED,AGENT_KILLEDorAGENT_RETIRED, with the status before and after and who made it (Follow what an agent did), and is sent to anyone following the agent through Send signals.
Undo it
Section titled “Undo it”Only a quarantine can be undone. Set the agent back to active to release it, and the agents under it with it
(recorded as AGENT_RELEASED):
curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/agent/invoice-agent \ -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \ -H "Content-Type: application/json" \ -d '{ "status": "active" }'Related
Section titled “Related”- AI agents: statuses, and the chain check at every token request.
- Introspection: how an API learns a token is inactive.
- Requests and refusals: where the gateway refuses stopped agents.
- Follow what an agent did: the status change on the trail.