AI agents
Give each AI agent an identity of its own, with an owner, a risk class and a status, no secret to leak, and one change that stops it and everything under it.
AvailableAPIRFC 6749, RFC 7523
An agent is an AI agent or other automation registered in your realm as an identity of its own. Each one has a purpose, a risk class, a business owner who answers for it, and a status you can change at any time. It gets short-lived tokens with no password or shared secret, and every token tells your APIs that an agent is calling, which one, how risky it is and who owns it.
Register every agent that calls your APIs, whether it works on its own account or for a user. Then a user can let it act for them through token exchange, it can ask its owner before a sensitive action through backchannel authentication, and you can stop it with one change.
Before you begin
Section titled “Before you begin”- Who can do it: a realm administrator: a member of a group that holds
RealmOwnerin this realm or a realm above it (Delegated administration).RealmViewercan read agents but not change them. - Where: today this is done through the API (Call the API shows how to get
$CVYUH_SESSION). Users see the agents acting for them on their own AI Agents page. - First: the user who will be the agent’s business owner exists, and your API’s scopes are among the realm’s
(
scopesinoauth2Settings).
How it works
Section titled “How it works”What an agent is
Section titled “What an agent is”| Field | What it holds |
|---|---|
uid | Its ID, unique in the realm. Required |
displayName | Its name. Required |
purpose | What it’s for, at most 512 characters. Required |
riskClass | minimal, limited, high or unacceptable. Required |
autonomyTier | 1 to 4: how far it acts without a human. Required |
status | active, quarantined, killed or retired. Required |
statusChangedAt | When its status last moved. The realm stamps it; a write that sets it is refused |
expiresAt | When it stops, if ever |
businessOwner | The one user accountable for it, who approves what it asks |
technicalOwner | The users or teams who run it; an agent may have several |
parent | The agent or user it was created under. Set once, never changed |
framework | Names you keep for your own records |
How it gets tokens
Section titled “How it gets tokens”An agent holds no password and no secret. It gets tokens through an OAuth client linked to it, proving itself
with a signed assertion only: with a key it holds (registeredKey), with a one-time assertion you mint for it
(amBootstrap), or with its platform’s workload identity (spiffe, see Workload identity).
Its tokens carry claims your APIs and the gateway can decide on:
{ "sub": "6f1c2a9e-4b7d-4e3a-9c51-2d8f0b7a1e44", "client_id": "invoice-agent-client", "principal_type": "agent", "mode": "autonomous", "risk_class": "high", "autonomy_tier": 2, "business_owner": "maya"}| Claim | What it says |
|---|---|
sub | The agent’s ID in the realm, which never changes |
principal_type | agent for an agent, user for a user |
mode | autonomous when the agent acts on its own account; delegated when it acts for a user through token exchange |
risk_class, autonomy_tier | Copied from the agent |
business_owner | The owner, by the realm’s naming attribute, such as their username. Absent when the agent has none |
When it acts for a user, the user is sub and the agent is in act, with the same claims.
Quarantine and release
Section titled “Quarantine and release”Quarantine an agent to pause it: it gets no new tokens and acts for no one, and neither does any agent created
under it. Set it back to active to release it. A quarantine is sent as account-disabled, and a release as
account-enabled, to anyone following the agent through
Send signals.
Kill and retire
Section titled “Kill and retire”Kill an agent to stop it for good: it and every agent created under it get no new tokens, ever, and the tokens already issued across that whole subtree are revoked. They read inactive at Introspection and are refused by the gateway. Retire an agent you’re done with; like a kill, it’s final.
Killed and retired are final: no one can bring the agent back or move it to another parent. To replace one, create a new agent. Every status change is written to the audit trail, and a kill is sent as account-disabled, as a quarantine is.
The chain check
Section titled “The chain check”Every token request walks the agent’s chain up through parent to the user at the top. Every link must be active
and unexpired, and that user’s account must be active. So one change stops a whole tree: deactivate the user at
the top, and every agent under them stops at its next request. The check also refuses a chain with a loop, or a link
that is missing.
Set it up
Section titled “Set it up”Each call sends your session as $CVYUH_SESSION (Call the API).
-
Create the agent. The required fields are enough to start:
Terminal window curl -X POST "https://foobar.cvyuh.com/api/v0/am/objects/v1/agent?id=invoice-agent" \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "uid": "invoice-agent", "displayName": "Invoice agent","purpose": "Pays approved supplier invoices","riskClass": "high", "autonomyTier": 2, "status": "active" }' -
Name
mayaas its business owner:Terminal window curl -X POST https://foobar.cvyuh.com/api/v0/am/objects/v1/agent/invoice-agent/relationships/businessOwner \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "targetId": "maya" }' -
Give it a client that authenticates by assertion, here with a key it registers. Each key must state when it ends (
exp), and each of itsscopesmust be one the realm offers (scopesinoauth2Settings), so add your API’s scopes, such asinvoices:read, there first:Terminal window curl -X POST "https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Client?id=invoice-agent-client" \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "status": "active","tokenEndpointAuthMethod": "private_key_jwt","assertionTrust": "registeredKey","grantTypes": ["client_credentials"],"scopes": ["invoices:read"],"allowedResources": ["https://app.example.com/api"],"defaultAudience": "https://app.example.com/api","jwks": { "keys": [{ "kty": "EC", "crv": "P-256", "kid": "agent-1", "x": "…", "y": "…","exp": <unix time, at most 90 days ahead> } ] } }' -
Link the client to the agent:
Terminal window curl -X POST https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Client/invoice-agent-client/relationships/agent \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "targetId": "invoice-agent" }' -
The agent asks for a token at
https://foobar.cvyuh.com/oauth2/tokenwith an assertion signed by its key, as anyprivate_key_jwtclient does, with a DPoP proof.
Register an agent walks through every step, including the one-time bootstrap assertion.
Limits and defaults
Section titled “Limits and defaults”| Setting or limit | Default | Range |
|---|---|---|
purpose | Required | At most 512 characters |
autonomyTier | Required | 1 to 4 |
An agent key’s end (agentKeyMaxLifetimeSecs) | 90 days | 1 hour to 1 year |
A bootstrap assertion’s life (bootstrapAssertionLifetimeSecs) | 300 seconds, used once | At most 3,600 seconds |
Agents acting in turn for one user (maxActDepth) | 4 | 1 to 16 |
Acting as the user (tokenExchangeImpersonation) | Off | On or off |
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Fix |
|---|---|---|
The agent gets invalid_client it didn’t get before | A link in its chain stopped: the agent, an agent above it or the user at the top is no longer active, or one is past its expiresAt; or its key has ended | Read the agent and each parent up to the user; release or reactivate the link that stopped, or register a new key |
| Writing the client’s keys is refused | A key has no exp, or ends further off than agentKeyMaxLifetimeSecs | Give each key an exp within the realm’s maximum |
A status change is refused 400 | The agent is killed or retired, which it never leaves | Create a new agent |
Its token request is refused unauthorized_client | The client asked for a grant a user signs in with | Use client_credentials, token exchange or backchannel authentication |
Audit record
Section titled “Audit record”- Every status move is recorded about the agent, on the trail of whoever made it and of the agent’s owner:
AGENT_QUARANTINED,AGENT_RELEASED,AGENT_KILLEDorAGENT_RETIRED, with the status before and after, and whether an administrator or a received signal made it. - Every token request at the token endpoint is a
TOKEN_ISSUEDrecord, issued or refused. A refusal is keyed by the client that asked, with its error (such asinvalid_client), but not the link that stopped the chain. - Every change to the agent’s record is in its change history, before and after: Audit → Config in the dashboard.
Read one agent’s whole trail with Follow what an agent did.
Good to know
Section titled “Good to know”- Assertions only. An agent’s client authenticates by
private_key_jwtorattest_jwt_client_auth, never by a secret. - Keys must end. Every key an agent’s client registers states an
expthat hasn’t passed and is no further off thanagentKeyMaxLifetimeSecs, 90 days by default. A write that breaks this is refused, naming the key, and a key past its end authenticates nothing. - A bootstrap assertion works once, within
bootstrapAssertionLifetimeSecs, 300 seconds by default. - Agents are held to FAPI 2.0 by default. A client given its
agentlink and naming nosecurityProfileis writtenfapi2: its tokens are DPoP-bound and its assertions signedES256orPS256. One that authenticates by attestation is writtenoauth2.1instead. Nameoauth2.1ornoneto hold an agent’s client to less. See Security profiles. - An agent never signs a user in. Its client can’t use the authorization code, device or identity assertion grants, and can’t be a first-party app.
- Lineage is fixed. An agent’s
parentand the agents under it are set when it’s created and can’t be rewritten, so a chain of delegation stays as it was made. - The chain is checked at every token request, for status, expiry, loops and type, up to the user at the top.
- Attestation details are kept, not read.
attestationTypeandattestationare stored on the agent as you write them; to have an agent prove its software, use Client attestation on its client.
Reference
Section titled “Reference”Settings
Section titled “Settings”| Where | Setting | What it does |
|---|---|---|
| Client | agent | The agent this client authenticates for |
| Client | tokenEndpointAuthMethod | private_key_jwt or attest_jwt_client_auth |
| Client | assertionTrust | registeredKey, amBootstrap or spiffe. A client that sets it authenticates by private_key_jwt |
| Client | securityProfile | fapi2 by default for an agent’s client; oauth2.1 or none to hold it to less |
agentSettings | agentKeyMaxLifetimeSecs (7776000, 90 days; 3600 to 31536000) | The furthest end an agent’s key may state |
oauth2Settings | bootstrapAssertionLifetimeSecs (300, at most 3600) | How long a bootstrap assertion stays usable |
agentSettings | maxActDepth (4; 1 to 16) | How many agents may act in turn for one user in a token |
agentSettings | tokenExchangeImpersonation (off) | Whether an agent may get a token as the user itself, where delegation and policy allow |
agentSettings | agentGuardrails | Limits by risk class: Agent guardrails |
Errors
Section titled “Errors”invalid_client: the agent’s chain doesn’t stand (an agent in it isn’t active or has expired, or the user at the top is inactive), the assertion doesn’t hold, or the method isn’t one of the two above. The reason is never returned to the client. The refusal is on the audit trail (see Audit record); to find which link stopped, see Troubleshooting.unauthorized_client: an agent’s client asks for the authorization code, device or identity assertion grant, or to sign a user in as a first-party app.
Related
Section titled “Related”- Register an agent: the task, start to finish.
- Stop an agent: quarantine, kill or retire.
- Let an agent act for a user: delegation through token exchange.
- Follow what an agent did: the agent’s audit trail.
- Agent guardrails: token lifetimes and approvals by risk class.