Agentic AI Security
Non-Human Identity for Agents: Delegation, Token Exchange and Task-Scoped Credentials
An agent that borrows a user's token or a shared service account makes every action ambiguous. How OAuth 2.0 Token Exchange lets an agent act for a user under its own identity, with credentials scoped to one task.
When an agent calls an API, two questions decide whether the call is safe and whether it can be audited afterwards: on whose behalf is it acting, and which agent is acting? Many agent deployments answer only one. Either the agent reuses the user’s token, and the logs show the user doing things the user never did, or it runs under a shared service account, and the logs show a powerful identity whose actions cannot be traced to a person.
The OWASP Top 10 for Agentic Applications, published in December 2025, names the consequence in its entry on identity and privilege abuse: “Agent-to-agent trust or inherited credentials can be exploited to escalate access, hijack privileges, or execute unauthorized actions.” A protocol for this exists: OAuth 2.0 Token Exchange, published as RFC 8693 in January 2020, already describes how one party can act for another while keeping its own identity, and it fits agents closely.
RFC 8693 distinguishes delegation from impersonation
RFC 8693 distinguishes two ways one principal can act for another. Under impersonation, “A is B within the context of the rights authorized by the token.” Under delegation, “principal A still has its own identity separate from B,” and “A is an agent for B.”
| Agent reuses the user’s token | Agent uses a shared service account | Delegated token from token exchange | |
|---|---|---|---|
| Whom the target sees | The user only | The service account only | The user as subject, the agent as actor |
| What the audit log can prove | Not which actions the agent took | Not which person the action served | Both, for every call that carries the token |
| Scope of the credential | Everything the user can do | Everything the service account can do | What this task needs, at this target |
| Effect of a leak | The user’s full access | The service account’s full access | If configured so: one audience, one scope, a short lifetime |
Source: RFC 8693, OAuth 2.0 Token Exchange (January 2020), sections 1.1 and 4.1. Consequences for agents are the author's.
The mechanism that carries both identities is the act claim. The RFC defines it as a way “to express that delegation has occurred and identify the acting party to whom authority has been delegated.” When work passes from one agent to another, “A chain of delegation can be expressed by nesting one act claim within another.” The RFC adds a rule that matters for authorization design: decisions apply to the token’s top-level claims, including its subject, and to the current actor, and prior actors in the chain are “informational only.”
A token exchange per task, per target
In a token exchange, a client sends the authorization server a subject_token, representing the party “on behalf of whom the request is being made,” and optionally an actor_token, representing “the acting party.” It can name the target through resource or audience, and narrow the request with scope. The authorization server decides whether this actor may act for this subject, and a subject token can state that permission in advance through a may_act claim, which “makes a statement that one party is authorized to become the actor and act on behalf of another party.”
Source: Author's diagram, based on RFC 8693 sections 2.1, 4.1 and 4.4.
The OWASP guidance for the same entry describes the properties the resulting credential should have. Its first mitigation is to “Issue short-lived, narrowly scoped tokens per task and cap rights with permission boundaries - using per-agent identities and short-lived credentials.” Another asks to “Bind OAuth tokens to a signed intent that includes subject, audience, purpose, and session,” and a third to “Monitor when an agent gains new permissions indirectly through delegation chains.” Token exchange supports the first, and covers the subject and audience parts of the second; purpose, session and a signed intent need additional design. The nested act claim gives monitoring the chain it needs to watch.
Design rules for agent identity
Give every agent its own identity. An agent deployed in production should have a workload identity of its own, issued and revoked like any other non-human identity, so that it can be named as the actor in every token and removed without affecting anyone else.
Exchange per task and per target. The agent should hold the user’s token only long enough to exchange it, and should request a separate credential for each target it calls, with the narrowest scope that task needs. The RFC’s own security considerations point the same way, suggesting scope and “a limited token lifetime” to limit abuse.
Never forward the user’s token. A token issued for one service should not travel to another. The Model Context Protocol’s authorization specification states the same rule for MCP servers, which “MUST NOT pass through the token” received from the client; the general principle applies to any agent that calls downstream systems.
Authenticate the client that asks for an exchange. The authorization server decides which agents may act for which users only if it knows which agent is asking. The RFC itself warns that omitting client authentication allows a compromised token to be exchanged “by anyone possessing the compromised token.”
Watch the chains. Delegation between agents is where the OWASP guidance asks organizations to look for privilege gained indirectly. Tokens that carry nested actors make it possible to alert when a chain is longer than expected, or when a low-privilege agent appears as the actor on a high-privilege request.
Agents fit the identity model enterprises already run for services, provided they are treated as non-human principals acting for people, with credentials that name both.