Amazon Cognito supports OAuth token exchange (RFC 8693): MCP servers and agents swap in a narrower token for each downstream call that keeps the user's identity and names the service acting for them
When an agent picks tools at run time and those tools call APIs for the user, Cognito now has a standard answer for which token the second hop should carry.
// Key points
- The caller sends the user's token to Cognito as the subject token: impersonation returns a token that represents the user, while delegation adds the caller's own actor token and Cognito writes an act claim naming the service that is acting
- The issued token carries only scopes that both the subject token and the app client allow, can be bound to one resource server, never outlives the subject token, and comes without a refresh token
- The pre token generation Lambda trigger also runs during token exchange (trigger source TokenGeneration_TokenExchange), but scopes it adds are ignored, so it can only remove them
- Use the /oauth2/token endpoint on your user pool domain or call GetDerivedToken through an AWS SDK; the examples cover your own MCP server and Bedrock AgentCore Gateway
Builder's takeThis is the user-side half of the STS GetScopedCredentials item from 11-21: one narrows cloud permissions, the other narrows user consent. My AI Interview backend runs an MCP Server, and that second hop used to mean either forwarding the user's token or switching to the service's own identity, neither clean. With delegation, downstream logs show both the user and the service. Downstream APIs must check that act.client_id is a service you trust, or delegation is just decoration.
// Background · from #AI agents
Full timeline →- Nov 25 AWS WAF launches automated AI endpoint discovery and protection: it finds LLM, MCP and A2A endpoints across an AWS Organization and blocks prompt injection with a managed rule group backed by Bedrock Guardrails
- Nov 25 Microsoft Foundry's Ignite roundup: Insights and multi-turn evaluation are GA, Agent Optimizer previews skill and cost optimization, and Decision-1 judges at about $0.12 per 1,000 calls
- Nov 24 Google publishes AgentDojo results for Semantic governance policies: attack success falls from 48.7% to 0.9%, while clean utility drops 2.6 points