Who Is the Agent Acting For? Authorization for MCP and Agent-to-Agent Access
OAuth was designed around a simple scenario: a person, an application, and a consent screen. The person is present, reads what the application wants, and clicks allow. The application then calls an API with a token that says, roughly, “this user said this app may do this”.
Agents break almost every part of that scenario. Often nobody is present when the agent acts. The agent decides at runtime which tools to call, based on input that may have been written by an attacker. And a single request can pass through several actors: a user asks an assistant, which calls an orchestrating agent, which calls a specialist agent, which calls an MCP server, which calls a SaaS API.
The question an authorization system has to answer has changed. It used to be “is this user allowed to do this?” Now it is closer to: who is acting, on whose behalf, with what authority, through which hops, and can anyone prove it afterwards?
This post looks at how the industry is answering that, which standards are doing the work, and where the gaps still are.
Why the old patterns fail
Most early agent deployments fell back on one of two patterns, and both age badly.
The shared service account. The agent gets a long-lived API key with broad permissions. It works, but every action is attributed to “the agent”, the key carries standing privilege far beyond any single task, and a prompt injection inherits all of it.
The user’s own token, passed along. The agent receives the user’s access token and forwards it to whatever it calls. Attribution looks right, but the downstream API cannot tell that an agent is acting rather than the person, cannot apply different rules to it, and receives a token that was never meant for it. This is the confused deputy problem in its plainest form.
Both patterns also scale poorly on the human side. If every agent needs a consent screen for every tool, users click through prompts they no longer read, and the organisation has no central view of which agents can reach which systems.
The considerations that matter
Before looking at protocols, it helps to name what a good answer has to provide:
- The agent has its own identity. Not a borrowed user session and not an anonymous key, so that policy and audit can distinguish the agent from the person.
- Delegation, not impersonation. A token should be able to say “agent X acting for user Y”, with both parties visible.
- Narrow, short-lived, audience-bound tokens. Each token is issued for one resource, with the minimum scope, for minutes rather than months.
- Policy lives outside the model. The model can propose; something deterministic decides.
- Consent and governance sit with the organisation, not only the individual. An enterprise needs to see and control which agents connect to which systems.
- Humans can approve specific high-risk actions, asynchronously, without being present when the agent starts.
- The chain is auditable. Every hop is recorded, so “who did this?” has an answer.
- Revocation is central and fast. Disabling an agent, or a user’s grant to it, takes effect everywhere.
None of these are new ideas in identity. What is new is having to provide all of them at once, at machine speed, for software that writes its own plan.
OAuth 2.1: the floor
OAuth 2.1 consolidates a decade of OAuth 2.0 security practice into one document. It is still an Internet-Draft (draft 17 at the time of writing, with the working group aiming to send it to the IESG in December 2026), but it is already the baseline that agent protocols build on. The changes that matter most for agents:
- PKCE is required for the authorization code grant, and the
plainmethod is gone. - The implicit and password grants are removed.
- Redirect URIs must match exactly.
- Access tokens must not be sent in query strings.
- Refresh tokens for public clients must be sender-constrained or single-use.
Many agents are public clients: CLIs, desktop apps and IDE extensions that cannot keep a secret. OAuth 2.1 is essentially the set of rules that makes public clients safe, which is why MCP adopted it.
MCP: the resource server model
MCP has been a project of the Linux Foundation’s Agentic AI Foundation since Anthropic donated it in December 2025, and its authorization spec has matured quickly. In the current revision (2026-07-28), authorization is optional, but when it is used, the model is clear: a protected MCP server is an OAuth 2.1 resource server. Concretely:
- Discovery. MCP servers publish OAuth Protected Resource Metadata (RFC 9728), which tells clients which authorization server to use. Authorization servers publish RFC 8414 or OpenID Connect discovery metadata.
- Client registration. In priority order: pre-registered credentials, then Client ID Metadata Documents, then Dynamic Client Registration as a fallback (now marked deprecated), then asking the user.
- PKCE with S256 is required.
- Audience binding. Clients must send a
resourceparameter (RFC 8707) naming the MCP server, and servers must check that tokens were issued for them. - Step-up. A server can answer
403withinsufficient_scopeand the scopes it needs, and a client acting for a user should ask for more scope incrementally. - Local servers. For stdio transports, the spec says not to use this flow at all, and to take credentials from the environment instead.
The most important rule is about what a server must not do. Token passthrough is forbidden: an MCP server “MUST NOT accept any tokens that were not explicitly issued for the MCP server”, and when it calls an upstream API it must use a separate token issued by that API’s authorization server. The spec calls passthrough an anti-pattern because it bypasses the downstream service’s own controls and breaks the audit trail.
That rule creates the central design question of this whole space. If the MCP server cannot forward the user’s token, how does it act for the user at the next hop? The answer is token exchange.
Two official extensions round out the picture. OAuth Client Credentials covers machine-to-machine access with pre-registered credentials and no user present. Enterprise-Managed Authorization brings the enterprise identity provider into the flow, which I come back to below.
RFC 8693: the delegation primitive
RFC 8693, OAuth 2.0 Token Exchange, is from 2020, but agents have made it central. It lets a client hand one token to an authorization server and get a different one back: for a different audience, with a different scope, or with a different shape.
Its most important contribution for agents is a vocabulary. The RFC distinguishes two things that are easy to blur:
- Impersonation: “A is B within the context of the rights authorized by the token.” Downstream, the agent is indistinguishable from the user.
- Delegation: “principal A still has its own identity separate from B.” Downstream, both are visible.
The request carries a subject_token (the party on whose behalf the request is made) and, optionally, an actor_token (the party actually acting). The resulting token can record the actor in an act claim, and a chain of delegation is expressed by nesting one act inside another. A decoded token for an agent acting for a user, two hops into a chain, might look like this:
{
"iss": "https://idp.example.com",
"sub": "alice@example.com",
"aud": "https://jira.example.com",
"scope": "issues:read issues:comment",
"act": {
"sub": "agent:triage",
"act": { "sub": "agent:orchestrator" }
}
}
Alice is the subject. The triage agent is the current actor, and the orchestrator acted before it. The RFC is careful about how much the chain means: for access control decisions, a resource server must consider only the top-level claims and the current actor, and treat the nested history as information. A related may_act claim lets a token state in advance which party is allowed to act for its subject.
What RFC 8693 does not define is policy. It says how to ask for a delegated token; whether to grant one, and with what scope, is left entirely to the authorization server. It also stops at the edge of one authorization server’s domain. Getting a token for a resource in another company’s system needs something more.
XAA: putting the enterprise IdP back in the loop
Cross App Access, or XAA, is the informal name for the IETF draft Identity Assertion JWT Authorization Grant, usually shortened to ID-JAG. Okta announced it in June 2025, and the draft is now a working-group document in the IETF OAuth working group (draft 06 at the time of writing), authored by people from Okta and Ping Identity among others.
The problem it targets is the one that the per-app consent screen creates in an enterprise. When one app connects to another through ordinary OAuth, that connection is invisible to the identity provider both apps use for login. Multiply that by every agent and every tool, and IT cannot see or govern who can reach what.
XAA routes the decision through the enterprise identity provider instead:
sequenceDiagram
participant U as User
participant C as Agent (requesting app)
participant IdP as Enterprise IdP
participant AS as Resource authorization server
participant R as Resource (MCP server or API)
U->>C: Sign in with SSO (OIDC)
C->>IdP: Token exchange (RFC 8693) <br/> ID token in, ID-JAG requested
IdP->>IdP: Policy: may this app act for <br/> this user at this resource?
IdP-->>C: ID-JAG
C->>AS: JWT bearer grant (RFC 7523) with the ID-JAG
AS-->>C: Access token for this resource only
C->>R: Request with access token
Diagram 1 — Cross App Access: the IdP decides, the resource still issues its own tokens
A few properties make this design attractive:
- The organisation decides, once. The identity provider applies policy to the question “may this app act for this user at that resource?”, so there is no consent screen per connection.
- Revocation is central. Removing the grant at the identity provider stops future exchanges everywhere.
- The resource stays in control of its own tokens. In the draft’s words, it “preserves the Resource Authorization Server as the issuer of access tokens for its protected resources.” The identity provider vouches; it does not mint tokens for other people’s APIs.
- It composes existing standards. Token exchange (RFC 8693), JWT bearer grants (RFC 7523) and resource indicators (RFC 8707) do the work; the new piece is a token type,
urn:ietf:params:oauth:token-type:id-jag.
MCP has adopted it directly. The Enterprise-Managed Authorization extension is an application of ID-JAG to MCP: the client exchanges its SSO identity for an ID-JAG aimed at the MCP server’s authorization server, then exchanges that for an access token without ever redirecting the user.
Adoption is real but early. Lists maintained by the community and vendors show identity providers (Okta, Ping, Descope and Oracle among them, with Keycloak in progress), clients (including Claude, VS Code in preview and OpenAI’s Codex CLI) and resource applications (including Atlassian, Slack, Zoom and Datadog) announcing support. These lists are self-reported, and implementations track different revisions of a draft that is still changing.
Two shapes of agent access
With those pieces in hand, most agent access falls into one of two shapes.
On behalf of a user
A person asks an agent to do something in a system they can already use. The agent should get no more than that person’s access, ideally much less, and the resource should see both identities. The toolkit:
- Interactive OAuth 2.1 (authorization code with PKCE) when the user is present and the tool is outside the enterprise.
- XAA when the user, agent and resource share an enterprise identity provider, which removes the consent prompt and gives IT the policy decision.
- Token exchange with an actor token when a service in the middle, such as an MCP server or a gateway, needs a token for the next hop that records both the user and the agent.
- Asynchronous approval for high-risk steps. OpenID’s CIBA lets a service ask a user to approve something on a separate device, with no browser redirect, and Rich Authorization Requests (RFC 9396) let that request carry specific transaction details, so the user approves “refund order 1234 for €80” rather than “access to billing”.
There are also proposals to make delegation to agents explicit in the core OAuth flow. One individual Internet-Draft, “OAuth 2.0 Extension: On-Behalf-Of User Authorization for AI Agents”, adds a requested_actor parameter to the authorization request and an actor token to the code exchange. It has expired without being adopted, but it shows the direction people want: the agent named in the consent itself, not inferred afterwards.
Agent to agent
Here one agent calls another, sometimes as a principal in its own right, sometimes carrying a user’s delegated authority through a chain.
The A2A protocol, now a project of the Linux Foundation’s Agentic AI Foundation, takes a deliberately conservative position. An agent publishes an Agent Card that declares its security schemes in OpenAPI style: API key, HTTP auth, OAuth 2.0, OpenID Connect or mutual TLS. The specification states that “identity information is handled at the protocol layer, not within A2A semantics”, and credentials travel in standard headers on every request. In other words, A2A does not invent an authorization model; it hands the problem to OAuth.
That is the right call, but it leaves the hard parts to the deployment:
- Agent as principal is straightforward: the calling agent uses client credentials or a workload identity, and the receiving agent authorizes it like any other service.
- Delegated chains are hard. Each hop should exchange its incoming token for a new one scoped to the next agent, adding itself to the
actchain, never forwarding the original. - Inside one organisation, the IETF’s Transaction Tokens draft proposes short-lived tokens that carry user identity, workload identity and authorization context through a call chain, so internal services do not pass external access tokens around. The WIMSE working group is standardising workload identity across services, including token exchange at security boundaries.
- Across organisations, there is no equivalent of XAA’s shared identity provider. This is the least solved part of the space.
| Shape | Principal | Mechanism | Who decides | What the resource sees |
|---|---|---|---|---|
| On behalf of a user, interactive | User, via agent | OAuth 2.1 code flow with PKCE | The user, at consent | User and client |
| On behalf of a user, enterprise | User, via agent | XAA / ID-JAG | The enterprise IdP’s policy | User and client |
| Middle hop for a user | User, with agent as actor | RFC 8693 with actor token | The hop’s authorization server | User, plus the act chain |
| Agent as principal | The agent | Client credentials, workload identity | The resource’s policy | The agent only |
| Agent chain inside one domain | User and workloads | Transaction Tokens (draft) | The domain’s token service | Propagated context |
Gateways: where policy actually gets enforced
Standards define tokens. Something still has to check them on every call, decide which tools an identity may use, exchange tokens for the next hop, and log the result. The industry’s answer, as it was for microservices, is a gateway, and three implementations show how differently people are approaching it.
agentgateway
agentgateway is an open-source proxy for MCP and A2A, originally from Solo.io and now a Linux Foundation project. It shows what a gateway that understands agent protocols can do:
- MCP authentication. It can act as the MCP resource server, validating tokens and serving protected resource metadata, or proxy the authorization server flow. It lists Keycloak, Auth0, Okta, Entra and others as providers.
- Per-tool authorization. Rules are CEL expressions over the MCP request and the caller’s token. Tools the caller may not use are filtered out of the tool list, so the agent never sees them.
- Token exchange to backends. It can perform RFC 8693 exchange on the caller’s behalf, including an actor token for delegation, so the upstream server receives a token issued for it rather than the caller’s.
mcp:
policies:
mcpAuthorization:
rules:
- 'mcp.tool.name == "search_issues"'
- 'mcp.tool.name == "close_issue" && "oncall" in jwt.roles'
One limitation is telling. Tool arguments are not visible to these MCP authorization rules, so per-tool policy is based on the tool’s name, its target and the caller’s claims, not on what the call would actually do. Argument-level checks need a separate, more general policy. That gap is not specific to one product: deciding on the content of an agent’s action is much harder than deciding on its name.
Okta
Okta is approaching the problem from the identity side. Alongside XAA, its “Okta for AI Agents” positioning gives each agent an identity of its own, manages Cross App Access connections centrally in SSO, and adds an Agent Gateway to “enforce policy at every tool call”, with relationship-based fine-grained authorization behind it. (Okta’s Agent Gateway and the open-source agentgateway are different products, despite the near-identical names.)
The interesting pattern is convergence. Identity providers are moving into the data path, and gateways are moving into identity. The boundary between “who are you?” and “may this call proceed?” is blurring, because for agents the two questions arrive together on every tool call.
Agent Router
Agent Router, formerly Envoy AI Gateway and now also an Agentic AI Foundation project, comes at it from the traffic side: an Envoy-based control plane for model, MCP and agent traffic. Its MCP support includes OAuth on routes. Its open issue for first-class A2A support, #2070, is a useful window into how hard this is in practice.
The proposal is an A2ARoute resource that mirrors the existing MCPRoute, with OAuth and JWT authentication, CEL-based authorization for agent-to-agent calls, and upstream authentication including OAuth token exchange. A contributor shared a working implementation in October 2026, and their questions to the maintainers are the most instructive part:
- Policy cannot see the protocol. Envoy’s A2A decoder parsed the request, but the RBAC engine’s CEL could not read what it parsed. The workaround copies the parsed A2A method into an internal header, removes any client-supplied value first so it cannot be spoofed, strips it before forwarding, and fails closed if parsing fails.
- Statefulness leaks into routing. A2A tasks and contexts span multiple requests, so the implementation routes on the task and context IDs to keep a conversation on the same backend.
- Upstream credentials need a model. Backend security policies did not yet cover the kind of backend an A2A route points at.
None of these are exotic. They are what happens when a general-purpose proxy meets a protocol whose meaning lives in the message body. The lesson generalises: an authorization policy is only as good as the enforcement point’s understanding of the protocol. If the gateway sees paths and headers, you can only write policy about paths and headers. Agent policy needs to speak in tools, skills, tasks and methods.
Where the industry is converging
Stepping back, I see six threads pulling in the same direction:
- Reuse OAuth rather than replace it. MCP, A2A and XAA all compose existing RFCs: 8693, 7523, 8707, 9728, 9396 and 9449 (DPoP, for binding tokens to a key). Nobody serious is proposing a new authorization protocol for agents.
- Put the enterprise identity provider back in charge. XAA moves the decision from a user clicking a consent screen to policy the organisation can see and revoke.
- Treat agents as principals, and prefer delegation to impersonation. The agent gets its own identity, and tokens record that it is acting for someone.
- Enforce at gateways that understand agent protocols. The policy enforcement point moves to where tool calls and agent messages can be parsed and judged.
- Make human approval asynchronous and specific. CIBA and Rich Authorization Requests let a person approve one concrete action from their phone, rather than a broad grant up front.
- Separate workload identity from user identity. WIMSE and Transaction Tokens target the internal plumbing, so services prove what they are, not just whom they serve.
What is still unsolved
The honest picture includes the open problems:
- Attenuation across a chain. Nothing in the standards guarantees that each hop’s authority is a subset of the previous hop’s. Token exchange makes narrowing possible; it does not make it mandatory.
- Cross-organisation agent trust. XAA works because both sides trust one identity provider. Agents calling agents across company boundaries have no equivalent yet.
- Intent versus permission. A token says what an agent may do, not whether this particular action matches what the user actually wanted. Prompt injection lives in exactly that gap, and it is why approval and policy must sit outside the model.
- Argument-level authorization. Most enforcement today decides on the tool’s name. Deciding on what the call would actually do, the amount, the recipient, the scope of the change, is much harder, and Rich Authorization Requests are only a partial answer.
- Long-running agents and revocation. An agent that runs for hours caches tokens. Short lifetimes and sender-constrained tokens help, but revocation latency is a real design parameter.
- Moving drafts. OAuth 2.1, ID-JAG and Transaction Tokens are all still Internet-Drafts, and vendors implement different revisions. Interoperability will lag the press releases.
What I would do today
The standards are moving, but the direction is clear enough to act on:
- Make every remote MCP server an OAuth resource server, with audience-bound tokens and no passthrough. If a server needs to call something else, it gets its own token for that call.
- Give agents their own identities, and use delegation rather than impersonation wherever the downstream system can represent it.
- Put a gateway in front of agent traffic that understands MCP and A2A, deny by default, and filter tools by identity.
- Adopt XAA where your identity provider and applications support it. Elsewhere, use pre-registered clients and token exchange rather than shared keys.
- Require asynchronous, specific human approval for actions that are hard to undo.
- Log the full actor chain on every call, so that “who did this, and for whom?” always has an answer.
The paradigm shift is not that agents need a new kind of security. It is that they need all of the old kind at once: identity, delegation, least privilege, consent, policy and audit, applied to software that decides for itself what to do next. The good news is that the industry is mostly assembling it from parts that already exist. The work left is making those parts fit together.