Live
Pod‑Level GPU Cost Tracking in Kubernetes with CloudBoltShadow AI: Operational Risks and Practical Guardrails for EngineersAI code generation delivers a 45k‑line data pipeline in 7 hours – practical takeaways for engineersAzure AI Gateway Hits GA as a Dedicated Service for Model Access GovernanceAWS Nitro Sandboxes Enable Isolated AI Agent Execution on Shared EC2 NodesPyTorch Adds GreenLight AI Reviewer for Auto‑Approving Low‑Risk Pull RequestsCognition’s SWE‑2.1 Ultrafast delivers 10× coding model speedup on CerebrasAI‑driven troubleshooting and unified self‑service in VMware Cloud Foundation and VKSPod‑Level GPU Cost Tracking in Kubernetes with CloudBoltShadow AI: Operational Risks and Practical Guardrails for EngineersAI code generation delivers a 45k‑line data pipeline in 7 hours – practical takeaways for engineersAzure AI Gateway Hits GA as a Dedicated Service for Model Access GovernanceAWS Nitro Sandboxes Enable Isolated AI Agent Execution on Shared EC2 NodesPyTorch Adds GreenLight AI Reviewer for Auto‑Approving Low‑Risk Pull RequestsCognition’s SWE‑2.1 Ultrafast delivers 10× coding model speedup on CerebrasAI‑driven troubleshooting and unified self‑service in VMware Cloud Foundation and VKS
AWS

Amazon Cognito Token Exchange: Securing AI Agent Hops

AI SummaryPowered by AI

AWS has introduced a new OAuth token exchange feature in Amazon Cognito that allows downstream services to request specific tokens for acting on behalf of users. This capability is critical as generative AI agents increasingly perform multi-hop operations, requiring secure identity propagation without exposing user credentials or losing service context.

Amazon Cognito has added support for OAuth token exchange via RFC 8693, a mechanism designed to solve the "second hop" problem in distributed systems. In standard workflows, an application receives a short-lived access token from an authorization server after user consent. When that app calls downstream services—such as when booking a table and then emailing friends—the original token cannot simply be forwarded because it identifies only the initial client (the review app), not the intermediate service making the call.

The Second Hop Problem in AI Architectures

When an application calls its own downstream services using its access token, those APIs see requests originating from that specific app. If you then need to forward a request for another user or action (like sending emails), the intermediate service faces two risks: forwarding your original token hides it behind the first client's identity, while generating a new credential loses the link to who authorized the action.

This pattern is becoming standard with AI agents. An agent might pick tools at runtime—such as an MCP server—to perform actions like sending invitations or reserving tables. These tools call APIs on your behalf but need their own identity for authorization while retaining user context. Without token exchange, these hops either leak credentials or break the chain of trust.

Impersonation vs Delegation

The new feature distinguishes between two patterns based on whether downstream services must identify themselves:

  • Delegation (Recommended for AI Agents): The calling service identifies itself to the authorization server. Cognito returns a token that carries both your user identity and the specific client ID of the reservation or agent service.
  • Impersonation: Used when downstream APIs do not need to know which internal system is acting, only who authorized it (the user).

In delegation scenarios, Cognito issues a new token that allows you to see exactly which AI agent or service acted on your behalf. This maintains the principle of least privilege by ensuring each hop receives strictly necessary scopes.

Related CloudNinjas coverage: AWS.

What This Means For Practitioners

You must evaluate how current multi-hop architectures handle identity propagation when integrating with generative AI agents. If you rely on forwarding tokens or using client credentials for downstream calls, your systems may be leaking user context or failing to audit which agent performed an action.

When designing platforms that support MCP servers or similar dynamic tooling, ensure the authorization server supports token exchange requests from intermediate services. This allows AI agents to maintain a clear chain of custody: you consented once at login, and every downstream API call is authorized by Cognito with full visibility into both user intent and service identity.

Originally published atAWS Security Blog