Skip to content
Workforce IdentityMarkdown

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.

  • Who can do it: a realm administrator: a member of a group that holds RealmOwner in this realm or a realm above it (Delegated administration). RealmViewer can 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 (scopes in oauth2Settings).
FieldWhat it holds
uidIts ID, unique in the realm. Required
displayNameIts name. Required
purposeWhat it’s for, at most 512 characters. Required
riskClassminimal, limited, high or unacceptable. Required
autonomyTier1 to 4: how far it acts without a human. Required
statusactive, quarantined, killed or retired. Required
statusChangedAtWhen its status last moved. The realm stamps it; a write that sets it is refused
expiresAtWhen it stops, if ever
businessOwnerThe one user accountable for it, who approves what it asks
technicalOwnerThe users or teams who run it; an agent may have several
parentThe agent or user it was created under. Set once, never changed
frameworkNames you keep for your own records

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"
}
ClaimWhat it says
subThe agent’s ID in the realm, which never changes
principal_typeagent for an agent, user for a user
modeautonomous when the agent acts on its own account; delegated when it acts for a user through token exchange
risk_class, autonomy_tierCopied from the agent
business_ownerThe 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 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 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.

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.

Each call sends your session as $CVYUH_SESSION (Call the API).

  1. 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" }'
  2. Name maya as 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" }'
  3. 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 its scopes must be one the realm offers (scopes in oauth2Settings), so add your API’s scopes, such as invoices: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> } ] } }'
  4. 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" }'
  5. The agent asks for a token at https://foobar.cvyuh.com/oauth2/token with an assertion signed by its key, as any private_key_jwt client does, with a DPoP proof.

Register an agent walks through every step, including the one-time bootstrap assertion.

Setting or limitDefaultRange
purposeRequiredAt most 512 characters
autonomyTierRequired1 to 4
An agent key’s end (agentKeyMaxLifetimeSecs)90 days1 hour to 1 year
A bootstrap assertion’s life (bootstrapAssertionLifetimeSecs)300 seconds, used onceAt most 3,600 seconds
Agents acting in turn for one user (maxActDepth)41 to 16
Acting as the user (tokenExchangeImpersonation)OffOn or off
SymptomCauseFix
The agent gets invalid_client it didn’t get beforeA 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 endedRead 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 refusedA key has no exp, or ends further off than agentKeyMaxLifetimeSecsGive each key an exp within the realm’s maximum
A status change is refused 400The agent is killed or retired, which it never leavesCreate a new agent
Its token request is refused unauthorized_clientThe client asked for a grant a user signs in withUse client_credentials, token exchange or backchannel authentication
  • 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_KILLED or AGENT_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_ISSUED record, issued or refused. A refusal is keyed by the client that asked, with its error (such as invalid_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.

  • Assertions only. An agent’s client authenticates by private_key_jwt or attest_jwt_client_auth, never by a secret.
  • Keys must end. Every key an agent’s client registers states an exp that hasn’t passed and is no further off than agentKeyMaxLifetimeSecs, 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 agent link and naming no securityProfile is written fapi2: its tokens are DPoP-bound and its assertions signed ES256 or PS256. One that authenticates by attestation is written oauth2.1 instead. Name oauth2.1 or none to 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 parent and 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. attestationType and attestation are stored on the agent as you write them; to have an agent prove its software, use Client attestation on its client.
WhereSettingWhat it does
ClientagentThe agent this client authenticates for
ClienttokenEndpointAuthMethodprivate_key_jwt or attest_jwt_client_auth
ClientassertionTrustregisteredKey, amBootstrap or spiffe. A client that sets it authenticates by private_key_jwt
ClientsecurityProfilefapi2 by default for an agent’s client; oauth2.1 or none to hold it to less
agentSettingsagentKeyMaxLifetimeSecs (7776000, 90 days; 3600 to 31536000)The furthest end an agent’s key may state
oauth2SettingsbootstrapAssertionLifetimeSecs (300, at most 3600)How long a bootstrap assertion stays usable
agentSettingsmaxActDepth (4; 1 to 16)How many agents may act in turn for one user in a token
agentSettingstokenExchangeImpersonation (off)Whether an agent may get a token as the user itself, where delegation and policy allow
agentSettingsagentGuardrailsLimits by risk class: Agent guardrails
  • 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.