Skip to content
Workforce IdentityMarkdown

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.
ChangeEffectUndo?
QuarantineNo new tokens for the agent or anything under itYes: set it back to active
KillNo new tokens for the agent or anything under it, everNo
RetireAs kill, for an agent you’re done withNo
Deactivate the user at the top of its chainEvery agent under them stopsReactivate 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.

  1. 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" }'
  2. 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.

  • New token requests are refused from the moment the change is saved. The agent sees invalid_client on 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_KILLED or AGENT_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.

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):

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": "active" }'