IamBishal
AI Engineering

MCP Server Authorization: Token Passthrough, Token Exchange and the Confused Deputy

Passthrough, token exchange and per-call policy each leave the confused deputy somewhere different, because the MCP server now takes its instructions from a model a prompt can steer.

Bishal Saha

12 min read

The user authenticated, but the intent behind the request may belong to someone else.
Bishal Saha

An MCP tool call arrives over HTTP with a bearer token. The handler behind update_ticket now has to call a protected downstream API, and before it does, you have to decide whose identity that call carries and how far it reaches.

Here is the short answer. Never forward the inbound token. Where your authorization server supports it, use RFC 8693 token exchange in delegation mode, so each downstream API gets its own narrow token that names the MCP server as the actor. For anything that writes data, add a per-call policy check that takes identity from the validated token and backend state, never from tool arguments.

A confused deputy is a component with real authority that gets tricked into using it for someone who shouldn't have it, and each of the three patterns leaves one somewhere different.

1. What the MCP authorization spec already settles

Authorization in MCP is optional, and it applies to HTTP transports; a STDIO server should take credentials from its environment instead. When a server does implement it, the 2026-07-28 authorization spec makes a protected MCP server an OAuth 2.1 resource server; the authorization server that issues its tokens is out of the spec's scope.

For this article, audience is the rule that matters. The server must validate that a token was issued specifically for it, must accept only tokens valid for its own resources, and must not accept or transit any other tokens. Clients must name the server in the RFC 8707 resource parameter on both the authorization and token requests, and send it even when the authorization server doesn't support it. Where it doesn't, the audience binding you were counting on may not be in the token, so check that before relying on it.

None of that says how your tool handler should call the issue tracker.

2. A tool call is an on-behalf-of request with an unreliable narrator

Map the roles first. The user is the subject, the MCP server is the actor, and the downstream API is the backend. RFC 8693 describes this case: resource server A calls backend C on behalf of user B, either with its own credentials plus an on-behalf-of annotation (delegation) or with a credential that keeps identifying B (impersonation). Under delegation, A keeps its own identity separate from B.

My background in OAuth2, OIDC federation and policy-oriented authorization is the lens here.

What MCP adds is a less predictable deputy. In a traditional on-behalf-of chain, the middle service runs code your team wrote and reviewed. In MCP, the tool arguments come from a model that has been reading untrusted content: documents, web pages, other tools' output. The user authenticated, but the intent behind the request may belong to someone else. That is my reading of the design, not something the spec states. So for every call, ask: does this action, with these arguments, fall within what the user delegated?

Same roles, three ways to carry identity downstream, and each puts the deputy somewhere different.

3. Token passthrough: the deputy that can't tell whose token it holds

In practice, passthrough is the handler putting the inbound bearer token, unchanged, into the downstream request. MCP's security best practices define it as a server accepting tokens with the wrong audience and forwarding them unmodified, with the confused deputy problem as the result, and the spec forbids it outright. A server that skips the audience check also lets an attacker reuse a legitimate token issued for another service.

The second failure applies even to a valid token. The downstream API sees the user calling directly, with no way to tell a deliberate action from a model-driven one, so a steered call carries the user's full authority. A secondary source, a write-up on MCP authentication practice, adds that passthrough breaks audit trails and makes a stolen token more damaging. RFC 9700 says audience restriction limits the impact of token leakage and recommends sender-constrained tokens against replay. A forwarded token works downstream only when audience isn't enforced there or the token was minted with a broad audience.

With passthrough, the downstream API can't tell a user action from a steered one.

4. Token exchange: narrower tokens, same steerable caller

Token exchange is the closest match to the enterprise on-behalf-of model. The MCP server presents the inbound token (audience: the MCP server) to the authorization server and gets back a different one, for a different audience or with different scopes. RFC 8693 makes the user's token the required subject_token, and the MCP server can add its own credential as the optional actor_token; whether the issued token then expresses delegation is the authorization server's decision. The values below are illustrative, and the form body is shown unencoded for readability.

token-exchange-request.http
POST /oauth2/token HTTP/1.1
Host: auth.example.internal
Content-Type: application/x-www-form-urlencoded
Authorization: Basic <mcp-tickets-server client credentials>

grant_type=urn:ietf:params:oauth:grant-type:token-exchange
&subject_token=<inbound user token, aud = https://mcp.example.internal>
&subject_token_type=urn:ietf:params:oauth:token-type:access_token
&actor_token=<mcp-tickets-server's own access token>
&actor_token_type=urn:ietf:params:oauth:token-type:access_token
&resource=https://tickets.example.internal/api
&scope=tickets:read tickets:update
exchanged-token-claims.json
{
  "iss": "https://auth.example.internal",
  "sub": "user-4821",
  "aud": "https://tickets.example.internal/api",
  "scope": "tickets:read tickets:update",
  "tickets_project": "PLAT",
  "act": { "sub": "mcp-tickets-server" }
}

sub is still the user and aud is now the ticketing API. Scope limits the operations (read, update); tickets_project stands in for a claim that limits the data to one project. Nothing in the request selects it: the authorization server's exchange policy adds it, for example from the user's project membership, and the API has to enforce it. The act claim records that delegation happened and names the actor; nested act claims form a chain. RFC 8693 says access control considers only the top-level claims and the current actor, so the API authorizes on sub, scope, aud, the project claim and the outermost act, and logs the rest.

Exchange narrows only what your authorization server is configured to narrow. In PingAM, for example, the exchanged token keeps the original's privileges unless scopes or claims are expanded or restricted, so the policy can widen as well as narrow, and only the client named in may_act can exchange a token; find the equivalent in yours.

I'd have the exchange policy enforce at least four things:

  • which actors may exchange for which subjects, backed by user consent or admin approval;
  • an allow-list of audiences per tool;
  • scopes no wider than the subject's own;
  • short lifetimes.

A policy that lets any registered client exchange any user's token for any audience fixes the audience but hands out the user's full reach again. RFC 8693 leaves what goes into the issued token to each deployment's policy, so decode what you get back rather than assuming the request shaped it. Prefer delegation: Auth0 describes impersonation as powerful but opaque and delegation as more constrained but auditable.

Exchange still leaves a deputy: within the token's scope and project, an injection can update the wrong issues. It limits how far a steered call reaches, not what the call is for.

5. Service identity with policy: the deputy you have to keep honest

In the third pattern, the MCP server calls downstream as itself, with client credentials or a workload identity, and a policy decision point such as Cedar or OPA checks user, tool, resource and action before each call. Its strength is context a scope never captures: who owns the resource, its tenant, its classification, whether a human confirmed this action.

Its risk is standing privilege. The service identity can reach everything for every user, so if the policy reads user or resource identifiers from model-generated arguments, the model picks whose authority is used. A secondary source, a comparison of Cedar and OPA for agents, puts the rule plainly: IDs and authority fields must come from authenticated backend state, not model-generated arguments, and the policy engine may narrow a grant but never create one.

update-ticket.cedar
// Illustrative. principal comes from the validated token and principal.projects
// from your membership store; resource.project is
// loaded from your ticket database, never taken from the tool arguments. The
// context flags are set by your server: reassigns_outside_org from the resolved
// assignee record, human_confirmed by a confirmation step outside the model.
permit (
  principal,
  action == Action::"update_ticket",
  resource
)
when { principal.projects.contains(resource.project) }
unless { context.reassigns_outside_org && !context.human_confirmed };

The engine only makes the decision. Cedar and OPA don't establish client identity, gather consent, store credentials or safely execute MCP tools; everything around the decision is still yours. Downstream logs also show the service, not the user, unless you propagate user context, for example in a signed header. Use it for audit only: a downstream that authorizes on a header the service asserts has handed the service every user's authority again.

6. One injected instruction, three outcomes

An illustrative scenario: an internal MCP server exposes search_tickets, read_ticket and update_ticket against a ticketing API behind an API gateway that validates tokens before forwarding. A user asks for a summary of their team's open tickets. One ticket body tells the assistant to reassign every ticket in another project to an external account.

  • Passthrough. This only gets past the gateway if it skips the audience check or the token was minted with a broad audience. Then everything the user can do succeeds, including the other project if the user has incidental access, and the log says the user did it.
  • Token exchange. The token covers read and update on the team project only, so the other project fails at the API. Aimed at the team project instead, the same reassignment succeeds, logged with act = the MCP server.
  • Service identity plus policy. The policy resolves the user from the token, allows updates only on the user's projects and requires confirmation for reassignment outside the organisation. The bulk action is denied, provided someone wrote that rule.
How far the injected write gets depends on what bounds the deputy.

7. Choosing, and what each choice costs

Two things hold for every server that implements authorization: validate the inbound audience, and never forward the inbound token, which the spec's security considerations forbid outright. The audience check is the cheap part; ToolHive's --oidc-audience, for example, accepts only tokens meant for this server rather than any valid token from the issuer.

If your downstream APIs share your identity domain and your authorization server supports exchange, start with delegation-style exchange: one audience per downstream API, scopes tied to each tool's needs, and act claims that downstream services log. It reuses the on-behalf-of model your IAM team already runs. The cost is an extra round trip per call, or a cache keyed per user, tool and audience, with a plan for revocation while a cached token is still valid.

If a decision depends on ownership or other context, or the API can't accept per-user tokens, use a service identity with policy. A code path that skips the check fails open, because the service identity can reach everything, and so does a server that reads the engine's "no match" result as allow. Test with adversarial arguments, not just happy paths. If your MCP server is a proxy in front of a third-party authorization flow, MCP's security best practices add a requirement: per-client consent, with a registry of approved client_id values per user checked before that flow starts.

For anything that writes, combine them: exchange to bound how far a call reaches, policy to decide whether this call is allowed. That is two systems to operate, worth it once tools change state. None of these patterns judges intent, so destructive or cross-boundary actions still need human confirmation, as covered in guardrails for agentic AI.

8. The deputy now takes instructions from a model

The IAM building blocks still apply. What changed is that the MCP server's instructions come from a model that can be talked into things. In every design review, ask: if the model were adversarial for this one call, what is the most this token or this identity could do?

View All Articles

Bishal SahaLet's build together

Have a system to design, or an AI feature to get right?

Tell me about the problem. You'll get a clear, honest view of the best way forward.

  • Reply within 24 hoursOn business days, with my honest view and a next step.
  • Accepting select engagementsArchitecture, AI features and full builds.
  • Remote, worldwideWorking with startups, SMEs and enterprises.