The agent identity problem, Token Vault and credential management, the Amazon Bedrock AgentCore IAM condition keys, and preventing confused-deputy attacks.
Traditional IAM answers "which principal is making this call?" Agents break that model in three ways, and each one needs a purpose-built answer.
A single agent serves many users. Its permissions must narrow to the specific user of the current session — not the union of everyone it ever serves.
Slack, GitHub, market-data APIs. Each needs credentials the agent must hold securely and use only when authorized.
The agent needs a way to prove "I'm acting for user X" downstream, without becoming a universal super-principal.
Amazon Bedrock AgentCore Identity — which is powered by Amazon Cognito — provides a centralized agent identity directory plus a Token Vault. Every agent gets a unique identifier (an ARN), and it works with your existing identity provider, so there's no user migration or rebuilt auth flow. It supports the protocols agents actually need:
Signed requests to AWS services.
Delegated access to external tools.
For services without OAuth.
Managed storage & rotation.
The Token Vault stores and rotates OAuth tokens so agents can reach third-party tools without ever seeing raw long-lived secrets.
The Vault holds OAuth tokens and refreshes them, keeping credentials out of agent code and prompts.
Agent-to-service auth uses JWT authorizer patterns so each call carries a verifiable, scoped token.
Agents authenticate to MCP servers through the Vault, so tool access is brokered, not embedded.
Think of the Token Vault as a valet: the agent hands over a claim ticket (its identity), and the Vault produces the right credential for the right tool at the right moment — the agent never holds the keys directly.
When an agent needs a token on a user's behalf, there are two paths, and they are not equivalent in security terms.
GetWorkloadAccessTokenForJWTGetWorkloadAccessTokenForUserId / the X-Amzn-Bedrock-AgentCore-Runtime-User-Id headerbedrock-agentcore:GetWorkloadAccessTokenForUserId and bedrock-agentcore:InvokeAgentRuntimeForUser in IAM, so every identification must go through the cryptographically verified path.
Amazon Bedrock AgentCore ships eight service-specific IAM condition keys. They let you scope permissions to a specific key, network, namespace, strategy, session, actor, or user — the building blocks of least privilege for agents.
bedrock-agentcore:KmsKeyArn — require a specific CMK.
bedrock-agentcore:subnets — pin to approved subnets.
bedrock-agentcore:securityGroups — pin to SGs.
bedrock-agentcore:namespace — scope memory namespace.
bedrock-agentcore:strategyId — scope memory strategy.
bedrock-agentcore:sessionId — scope to a session.
bedrock-agentcore:actorId — scope per acting user.
bedrock-agentcore:userid — scope to a user id.
Example — scope an agent's actions to the acting user
actorId and sessionId keys are how you enforce the session-to-user binding that the Runtime does not do for you. Scope memory and tool access per actor and you close the gap.
A confused deputy is a service tricked into using its privileges on an attacker's behalf. Cross-service agent calls are a classic setup for it. AWS gives you two global condition keys to shut it down.
For cross-account agent deployments, pair these with resource-based policies so the resource itself states who may use it — defense that holds even if an identity policy is misconfigured.
Rule of thumb: any time an Amazon Bedrock AgentCore resource can be invoked by another service, add aws:SourceArn and aws:SourceAccount conditions. It's cheap, and it removes an entire attack class.
ForUserIdbedrock-agentcore:* condition keys