← Blog

Agent tool hops need Cognito token exchange, not forwarded tokens

Amazon Cognito now supports OAuth 2.0 Token Exchange (RFC 8693) so services and AI agents can obtain audience-scoped issued tokens for second hops — with impersonation or delegation (act claim) — illustrated for MCP servers and Amazon Bedrock AgentCore Identity without forwarding the user’s original access token.

AI SecurityAgentic AIEnterprise

When an agent’s MCP tool calls a second API “as the user,” forwarding the user’s access token hides the tool, and a client-credentials token drops the user. Audit and authorization both fail.

AWS published on November 24, 2026 how Amazon Cognito supports OAuth 2.0 Token Exchange (RFC 8693) for services and AI agents that call APIs on behalf of signed-in users. The calling service presents the user’s subject token (access or ID token from the user pool) plus its own credentials; Cognito returns a new issued token for the downstream resource, with the same scopes or fewer. Impersonation issues a user-representing token without an actor claim (fits BFFs that only relay). Delegation also sends an actor token so Cognito adds an `act` claim naming the calling service — required when both user and agent must appear in authorization and logs. The post walks MCP-server and Amazon Bedrock AgentCore Identity patterns: each hop exchanges for the next audience instead of reusing or inventing identity. Agents that pick tools at runtime make second hops the default path, not an edge case.

What identity and agent platform owners should require before tools call user APIs:

  • Prefer delegation (subject + actor) for agent/MCP hops so resource servers can authorize and audit both parties
  • Exchange for the downstream audience with least scopes — never forward the original user access token across hops
  • Wire AgentCore Identity / MCP servers as Cognito app clients that can perform exchange under policy

Second-hop agent calls without token exchange are either impersonation theater or lost user context. Cognito’s RFC 8693 support is how those hops stay scoped and attributable.