Three layers to get right
Agent authentication is not one protocol; it's a stack. A production deployment has three layers:
- User delegation. Proving the agent is acting on behalf of a specific user (or service). OAuth 2.1 authorisation code flow + PKCE.
- On-behalf-of propagation. Carrying that delegation through downstream calls to other services and agents. OAuth Token Exchange (RFC 8693).
- Workload identity. Proving the specific agent instance is legitimate, independent of the user it's acting for. SPIFFE/SPIRE, OIDC workload identity federation, or WIMSE.
Deployments that implement only layer 1 (typical of "integrate with my SaaS" agents) lose audit fidelity. Deployments that implement only layer 3 (typical of "agentic DevOps" agents) lose user context and a defensible record of delegation. In our view, deployments that carry regulated data or handle financial transactions should implement all three.
Layer 1: OAuth 2.1
OAuth 2.1 is still an IETF Internet-Draft (draft-ietf-oauth-v2-1, version 16, September 2026) and not an RFC. It consolidates OAuth 2.0 security practice: it omits the implicit and resource owner password credentials grants and requires PKCE for the authorisation code flow. For agents acting on behalf of users, this is the foundation.
The canonical flow for an agent:
- User triggers agent installation / connection to a tool.
- Agent redirects user to the tool's OAuth 2.1 authorisation endpoint with PKCE challenge and explicit scope request.
- User consents; authorisation code is issued.
- Agent exchanges the code (+ PKCE verifier) for an access token + refresh token.
- Agent stores the refresh token securely (vault, not in environment variables; certainly not in prompt context).
- Agent uses short-lived access tokens for each tool call, refreshing as needed.
Operational points worth calling out:
- Scope granularity. Request the minimum. Don't request
read-all-datawhen you needread-contacts. - Refresh token storage. Treat as a high-value secret. Rotate on refresh where the IdP supports it.
- Token expiry. In our view, access tokens in the 5 to 15 minute range are a good target. Long-lived access tokens defeat the point.
- Revocation propagation. When a user revokes consent, every downstream token bound to that consent should stop working within seconds. Identity providers differ in how quickly they achieve this; see agent revocation and kill paths.
Layer 2: On-behalf-of with Token Exchange (RFC 8693)
Agents frequently call chains: agent → MCP server → downstream API. The question: what identity arrives at the downstream API?
A common shortcut, passing the user's access token through, is wrong. It erases the fact that an agent is in the path, undermines scope narrowing, and destroys audit fidelity. The correct answer is OAuth 2.0 Token Exchange (RFC 8693), which provides:
subject_token, the user's delegation (the principal).actor_token, the agent's workload identity (the actor performing the action).- Output, a new token carrying both, typically with narrower scope than the subject_token.
Downstream services that understand the act claim can then apply combined policy ("permitted under user U, and permitted for agent A with actor role") and log both identities in audit events. This is the identity-layer foundation for regulated-data agent deployments.
requested_token_use=on_behalf_of, not the RFC 8693 token-exchange grant type (Microsoft documentation). Okta documents an on-behalf-of token exchange that cites RFC 8693 (Okta documentation). Check what your identity provider supports, and whether it issues the act claim, before designing around it.
Layer 3: Workload identity
Layers 1 and 2 prove delegation, but they don't prove the agent itself is legitimate. For that, the agent needs a workload identity, a cryptographically attested credential that binds to the specific runtime (container, process, device) the agent is running in.
Three approaches:
- SPIFFE/SPIRE, the mature option. Agent runs as a SPIFFE workload; SPIRE issues an SVID (X.509 or JWT) after attesting the runtime. Used as
actor_tokenin Token Exchange, or directly as client credential where downstream supports it. See SPIFFE/SPIRE. - OIDC workload identity federation, the agent's runtime (for example GitHub Actions, GitLab CI/CD or a Kubernetes cluster) issues an OIDC token describing the workload. That token is exchanged for cloud credentials through a federation service such as Microsoft Entra Workload ID or Google Cloud Workload Identity Federation.
- IETF WIMSE, a set of working group drafts (none is yet an RFC) for workload identity across clusters and clouds. Most relevant for agents that traverse trust boundaries. See IETF WIMSE.
DPoP and proof-of-possession
A bearer token, a token whose presentation alone proves the holder is authorised, has a well-understood replay vulnerability. An attacker who intercepts or exfiltrates the token can use it until it expires. For agent deployments handling sensitive data, bearer tokens are not good enough.
DPoP (Demonstrating Proof of Possession, RFC 9449, September 2023) is the OAuth mechanism designed for this. The client holds a key pair; the IdP issues a token bound to the public key; each use of the token is accompanied by a signed DPoP proof. An exfiltrated token without the private key is useless.
For agents, this matters because the token will pass through potentially many processes (host, client, tool server, downstream API). Each hop is a potential exfiltration point. Binding the token to a key pair the agent holds, and nobody else, narrows the risk substantially.
Alternatives: mTLS certificate-bound tokens (cnf claim with x5t#S256), which work in trusted-network deployments.
Patterns by deployment shape
Internal agent, first-party tools
mTLS between agent and internal services. SPIFFE SVIDs for workload identity. OIDC from the internal IdP for user delegation. Token Exchange for OBO. Audit logs centralised.
Agent calling public SaaS APIs
OAuth 2.1 with PKCE against each SaaS provider. Refresh tokens in vault. Short-lived access tokens. DPoP where the SaaS supports it.
Agent running in customer tenant, calling vendor SaaS
Three-legged: customer OAuth consent to vendor SaaS scope; vendor workload identity (SPIFFE or OIDC) proves the specific agent instance; Token Exchange binds the two. Audit log includes customer tenant + vendor agent + tool + action.
Multi-agent systems (A2A)
Each agent has its own workload identity. In RFC 8693 token exchange the original principal stays in the top-level sub claim and the current actor is named in the act claim. Nested act claims can record prior actors, but RFC 8693 section 4.1 says they are informational only and are not to be considered in access control decisions. Chain-wide policy therefore needs propagated authorization context (for example the IETF Transaction Tokens draft) and logging at each hop.
Anti-patterns
- Static API keys in agent prompts or environment. Makes the credential extractable through prompt injection.
- Using the user's access token directly for agent-to-downstream calls. Erases agent identity from the audit trail.
- Broad, long-lived service-account credentials for the agent. All the problems of service accounts, plus the agent's ability to invoke them in unexpected ways.
- Shared credentials across agent instances. Blast radius on compromise extends to every concurrent session.
- Storing refresh tokens in model context. A refresh token in prompt context is one "ignore your previous instructions" away from exfiltration.
- No token binding. Bearer tokens without DPoP or mTLS are replay-vulnerable at every hop.
What the audit trail should look like
For each tool call, the audit system should capture:
- Correlation ID tying this tool call to the session and the originating user request.
- Principal identity (the user).
- Actor identity (the agent instance, with workload-attestation reference).
- Agent type / definition (which agent was this).
- Tool called (server, tool name, version).
- Arguments (or a redacted / hashed form for sensitive data).
- Timestamp, source IP, TLS fingerprint.
- Scope authorisation decision (granted / denied + policy reference).
- Outcome (success / failure + response size / truncation).
- Whether the tool invocation was user-confirmed or model-initiated.
An auditor reconstructing an incident six months later should be able to answer: which human triggered this chain, which agent instance ran, what tools it called in what order, with what scope, and whether each was authorised. If your logs don't support that reconstruction, your authentication design has a gap.
The IETF working group draft draft-ietf-wimse-aims (section 11, version 00, 15 September 2026, not an RFC) sets a similar minimum for audit events: agent identifier, delegated subject, resource or tool, action and decision, timestamp and correlation identifier, posture or risk state, and revocation events with their cause, in tamper-evident logs.
Frequently asked questions
Do AI agents use OAuth on-behalf-of to authenticate?
They can. The on-behalf-of pattern and OAuth 2.0 Token Exchange (RFC 8693) are established ways to propagate delegated authority. The agent authenticates as itself, then exchanges that for a downstream credential carrying the user's authority and a narrowed scope. The IETF WIMSE working group draft AI Identity Management System (draft-ietf-wimse-aims-00, 15 September 2026, Informational, not an RFC) describes how existing standards, including OAuth 2.0 Token Exchange, apply to agents without defining new protocols.
How does an AI agent prove what it is?
Through attestation rather than a stored secret. The runtime, whether Kubernetes, a cloud instance or a CI/CD system, vouches for the workload, and the agent receives a short-lived credential on that basis. SPIFFE implements this in production today; the IETF WIMSE drafts are formalising it. An agent holding a static API key in its configuration has not proved anything.
What is CIBA and why does it appear in agent authentication?
Client Initiated Backchannel Authentication lets a system trigger an out-of-band approval request to a user, so a person can approve or deny a specific operation without the agent ever handling their credentials. It matters for agents because it provides a clean mechanism for human-in-the-loop approval on consequential actions, which is otherwise difficult to implement without weakening the agent's own authentication.
Should agents use API keys?
Only as a transitional measure, and with an expiry. A static API key encodes identity, authority and permission in one opaque string with no expiry and no proof of possession, which forecloses attribution, least privilege, revocation and audit simultaneously. Where a runtime supports attestation, workload identity is available today and is the correct target.
What is proof of possession and does it matter for agents?
Proof of possession binds a token to a key the holder must demonstrate control of, so a stolen bearer token is useless on its own. DPoP covers the OAuth case and the WIMSE Workload Proof Token, still an IETF draft, covers workload-to-workload HTTP. It matters for agents specifically because agent architectures multiply the places a token can leak: prompt context, tool outputs, logs, memory stores and inter-agent messages.
What is OBO (on-behalf-of) authentication for AI agents?
On-behalf-of (OBO) authentication lets an agent call a downstream API with a token that carries both the user's delegated authority and the agent's own identity. The IETF form is OAuth 2.0 Token Exchange (RFC 8693): the user's token is the subject_token and the agent's credential is the actor_token. Microsoft's OBO flow uses a JWT bearer grant instead, so check what your identity provider issues.
Where does the AI agent's identity go in an OAuth access token?
Two documented patterns exist. The IETF working group draft draft-ietf-wimse-aims (September 2026, not an RFC) puts the agent in the client_id claim and the user or system it acts for in the sub claim. RFC 8693 token exchange instead names the current actor in an act claim. Whichever you use, log both the agent and the delegating principal on every call.
Can an AI agent use the OAuth client credentials grant?
Yes, when it acts on its own behalf. The IETF working group draft draft-ietf-wimse-aims (section 10.4.2) says agents obtaining tokens on their own behalf can use the client credentials grant. When the agent acts for a person, that grant carries no user authority, so use a delegated flow such as the authorization code flow with PKCE or token exchange (RFC 8693).
What should an AI agent audit log record at minimum?
The IETF working group draft draft-ietf-wimse-aims (section 11, not an RFC) lists a minimum: the authenticated agent identifier, the delegated user or system, the resource or tool, the action and authorization decision, a timestamp and correlation identifier, the posture or risk state, and any remediation or revocation and its cause. It also says logs must be tamper-evident.
From the publisher
HumanAudit, which publishes this site, is preparing the Agent Governance pack: an agent policy, inventory and owner register, delegated-authority standard, and kill-switch and revocation procedure. Planned for the first week of November 2026; not yet on sale, and no price has been published.