Same OAuth, Real Proof: Rethinking What Earns an AI Agent a Token

MCP servers already speak OAuth; the question is what earns an agent its token. The SecureW2 AI Security solution exchanges an attested JWT-SVID for a scoped, self-expiring OAuth token under RFC 8693.

MCP authorization already runs on OAuth, so the real question is what should earn an agent its token
Key Takeaways
  • OAuth token exchange lets a client trade one security token for a different token from an authorization server.
  • Backing the exchange with attested workload identity removes the stored client secret an attacker could copy.
  • SecureW2 runs the exchange itself, so it decides what each agent token reaches and when issuance stops.

MCP authorization already runs on OAuth, and OAuth works. The open question is what should earn an agent its OAuth token. Today, the answer is often a static secret.

A Cloud Security Alliance survey with Strata Identity found that 44% of organizations use or plan to use static API keys to authenticate AI agents. A copied key grants the same access as the real agent, even if the key is held by an attacker or someone outside the organization.

OAuth token exchange lets AI agents authenticate with tokens instead of long-lived API keys. This article explains how it works, why it’s important for AI security, and how to get started.

What Is OAuth Token Exchange?

OAuth token exchange is an IETF standard, RFC 8693, that lets a client present one security token to an authorization server and receive a different token in return. It matters for agents because MCP authorization over HTTP follows OAuth 2.1, so any agent reaching a protected MCP server needs an OAuth token.

The usual pattern for AI agent access hands the agent a stored client secret, such as human credentials or an API key. Anyone holding a copy can use it, and nothing ties the credentials to the workload that requested it.

Token exchange changes the input. The agent presents proof of what it is, and the authorization server decides whether that proof earns a token. The credential is now evidence about the workload itself, and any token that does leak stops working when its short lifetime runs out.

See your security gap before attackers do.

See continuous trust in action on a platform that includes RADIUS, PKI and AI security.

Customize Your Video Demo

Delegation vs. Impersonation: What They Are and Why They Matter

RFC 8693 outlines different ways token exchange can represent who is acting and whose authority they are using. Two important concepts are delegation and impersonation.

With impersonation, the workload acts as though it is the user. The token represents the user’s identity, which makes it challenging for a server to distinguish the user’s actions from the actions performed by the service.

With delegation, the workload uses its own identity while acting on the user’s behalf. When implemented properly, the token can represent both the user behind the workload and the workload itself.

The distinction matters because if an agent inherits a user’s identity, security teams don’t have visibility into who performed an action. Was it the human user, or the agent acting on the user’s behalf?

Delegation preserves that distinction by giving agents their own identity and their own token representing them by naming the agent as the actor in a token that still identifies the user (the RFC 8693 act claim). This allows organizations to apply agent-specific authorization policies and, if needed, revoke an agent’s access without impacting the user’s access.

How SecureW2 Backs Every OAuth Token With Proof

With SecureW2, every agent has a unique identity and its own OAuth tokens based on that identity.

Before an agent gets an identity, SPIRE attests the node and the workload. Agents prove themselves through their Kubernetes service accounts, so there is no shared secret to steal, copy, or commit to a repository.

SecureW2 runs the OAuth server. The agent presents its JWT-SVID or X.509-SVID, SecureW2 verifies it and applies policy, then returns an OAuth access token under RFC 8693 that reaches one resource and expires on its own on a lifetime you set, in as little as 5 minutes.

The MCP server validates that token like any other OAuth token, so the OAuth flow stays the same. Policy decides whether to issue a token at all and, if so, what the token may reach and how long it lasts.

OAuth Token Exchange Flow

Here’s how the OAuth token exchange flow looks:

Diagram illustrating the OAuth token exchange flow

  1. Identity establishment: The agent proves its identity using a trusted workload identity mechanism, like a SPIFFE ID backed by a SPIFFE Verifiable Identity Document (SVID).
  2. Token request: The agent presents an existing security token (called a subject token) to an OAuth authorization server and requests a token for the target MCP server.
  3. Request evaluation: The authorization server evaluates the request by validating the submitted token and applying its authorization processes. It can take the agent's identity, the requested resource, and the permissions being requested into consideration before making the token issuance decision.
  4. New token issuance: If the server determines the request is authorized, it will issue a new OAuth token. The token can have a short lifespan and scoped permissions, reducing the potential blast radius if it is compromised.
  5. MCP server access: The agent presents the new access token to make authorized access requests to the MCP server. The server validates the token and its claims to enforce the associated permissions.

This creates a trust chain between the workload identity, the authorization server, and the resource being accessed. The server issues the OAuth token based on a verified workload identity and authorization decision instead of relying on its possession of a reusable secret.

The security plan that scales with you.

Our solutions can scale from mid-market to global enterprises. Compare options and see how our solutions protect you from costly breaches and ensure peace of mind.

Check Our Prices

From OAuth Token Exchange to Full Agent Control

Because SecureW2 owns the exchange, it can stop issuing new tokens to a single agent while every other agent keeps running.

SecureW2 checks what EDR and SIEM platforms such as Datadog and SentinelOne currently report about a workload before it issues the workload’s token. A high-severity signal marks that workload blocked, preventing token exchange. If the workload passes security verification, the exchange can be completed. Every token exchange is logged against a named agent.

JoinNow Dynamic PKI issues short-lived tokens only after the agent’s identity is verified, and uses real-time risk signals to decide if token exchange or refresh should happen. To see how the SecureW2 AI Security solution puts attested identity behind every token, schedule a demo.


Frequently Asked Questions

Does OAuth token exchange change how MCP servers validate tokens?

No. The MCP server still receives an OAuth access token and validates it the way it validates any other token. Token exchange changes what happens at the authorization server before issuance, where the agent must present proof of its identity rather than a stored client secret.

How does an agent get a JWT-SVID?

SPIRE issues it after attesting the node and the workload. The agent then presents that JWT-SVID to SecureW2, which verifies it and applies policy before returning a scoped OAuth access token under RFC 8693.