Agentic AI AcademyAgentic AI Academy

AgentCore Identity Overview

Agent identities, inbound vs. outbound, the workload directory

Intermediate 12 minBuilder
What you'll be able to do
  • Explain why identity is the central problem for production agents that act on real systems on a user's behalf
  • Distinguish inbound auth (authorizing the caller invoking an agent/tool/Runtime/Gateway) from outbound auth (the agent reaching downstream resources)
  • Describe the agent workload identity concept and read its `workload-identity` ARN
  • Explain why Identity is framework- and model-agnostic and runs in Runtime, ECS/EKS/Lambda, or hybrid
  • Articulate the bouncer/valet teaching framing and why delegated authorization beats a shared secret
  • Locate where the token vault, credential providers, and SDK decorators fit before drilling into them in later lessons
At a glance

Production agents act on real systems on a user's behalf, so identity is the linchpin: who is allowed to invoke the agent, and how the agent reaches downstream APIs without secrets in code or in the LLM's context. AgentCore Identity gives every agent a first-class managed workload identity plus a secure token vault, and splits the problem cleanly into inbound auth (the bouncer at the door) and outbound auth (the valet fetching the user's keys from a locked vault). The result is delegated authorization, not impersonation with a shared secret.

  1. 1Why identity is the linchpin of production agents
  2. 2Two problems: inbound auth vs outbound auth
  3. 3The teaching framing: bouncer at the door, valet at the vault
  4. 4The agent workload identity and its ARN
  5. 5Framework- and model-agnostic, and where it runs
  6. 6How Identity relates to IAM, and what comes next

Why identity is the linchpin of production agents

A demo agent answers questions. A production agent acts on real systems on a user's behalf — it reads someone's Google Drive, opens a GitHub PR, posts to a Slack channel, hits an internal billing API. The instant an agent does real work, two security questions become unavoidable:

  1. Who is allowed to invoke this agent? A random caller should not be able to trigger an agent that can spend money or read private data.
  2. How does the agent reach downstream resources — without secrets in code or in the model's context? You cannot paste a long-lived API key into a prompt or bake it into the container image and call that production.

The naive answer is a shared secret: hand the agent one powerful credential and let it impersonate everyone. That is exactly the anti-pattern AgentCore Identity exists to kill. Identity makes agentic auth delegated, not impersonated-with-a-shared-secret: the agent gets a scoped, user-specific token for each downstream call, and credentials never touch your business logic or the LLM context.

Concretely, AgentCore Identity gives every agent/workload two things:

  • A first-class, centrally-managed identity — a unit of governance you can reason about, audit, and scope.
  • A secure credential store (the token vault) — where OAuth tokens, OAuth client credentials, and API keys live, encrypted, never in code.

With those two pieces in place, agents are invoked securely and call downstream APIs on a user's behalf with no secrets leaking into prompts, logs, or images.

Key insight

Delegated, not impersonated

The whole design goal in one phrase: Identity makes agentic auth delegated, not impersonated-with-a-shared-secret. Instead of one god-token the agent uses for everyone, each downstream call uses a token scoped to a specific user and a specific resource — issued, cached, and isolated by Identity.

Two problems: inbound auth vs outbound auth

AgentCore Identity solves exactly two problems. Keeping them separate in your head is the single most useful mental model for everything that follows.

Inbound Auth — authenticates and authorizes the caller invoking an agent, tool, Runtime, or Gateway. This is the gate at the front door: is this request from someone allowed to trigger this agent at all?

Outbound Auth — lets the agent reach downstream resources (Google Drive, GitHub, Slack, internal APIs, other MCP servers). The agent can act either on behalf of the user who invoked it (the 3-legged / user-delegated flow) or as itself (the 2-legged / machine-to-machine flow). You will go deep on 2LO vs 3LO in a later lesson; for now, the key idea is that outbound is about the agent's onward calls, fetching the right token for each one.

Inbound AuthOutbound Auth
Question it answersWho can invoke this agent/tool/Runtime/Gateway?How does the agent call a downstream resource?
DirectionCaller → agentAgent → downstream API
MechanismsIAM SigV4 (default) or JWT Bearer (OAuth 2.0 / OIDC)2LO (act as itself) or 3LO (act on behalf of the user)
Where the credential livesThe caller's signed request / bearer tokenThe token vault (per agent + user)
AnalogyThe bouncer at the doorThe valet fetching the user's keys from a locked vault

The two are independent: an agent can be invoked over JWT inbound while making 3LO outbound calls to Google, or invoked over SigV4 while making 2LO calls to an internal service. Identity governs both ends; this lesson frames them, and the rest of the module drills into each.

Note

Inbound runs across multiple AgentCore surfaces

Inbound auth is not only about Runtime. The same idea — authorize the caller — applies to a tool, a Runtime endpoint, and an AgentCore Gateway. Wherever a caller can invoke something, inbound auth decides whether they're allowed in.

The teaching framing: bouncer at the door, valet at the vault

Two pictures make this stick.

Inbound = the bouncer at the door. Someone shows up wanting to invoke your agent. The bouncer checks credentials before letting them in. In AgentCore those credentials are either an AWS SigV4 signature (the caller proves they're an allowed AWS principal) or a JWT bearer token (the caller proves they hold a valid OAuth/OIDC token from your identity provider). No valid credential, no entry.

Outbound = the valet who fetches the user's keys from a locked vault. Once inside, the agent needs to drive the user's car — call Google Drive, GitHub, an internal API. It does not carry the user's keys around in its pocket (no secret in code, no token in the prompt). Instead it asks the valet (Identity), who walks to the locked vault (the token vault), retrieves the right key for this specific user and this specific resource, and hands it over just long enough to make the call. The keys stay in the vault; the valet does the fetching.

That is why the system is delegated, not impersonated. The agent never holds a master key. Each outbound call is backed by a token that is:

  • scoped to a specific downstream resource and set of scopes, and
  • isolated per (agent identity + user) — so one user's tokens are never visible to another's session.

Keep the pair in mind as you read AWS's docs: every Identity feature is either hardening the bouncer (inbound) or improving the valet-and-vault (outbound).

Tip

Use the analogy to place any feature

When you meet a new Identity term, ask: is this about the bouncer (who gets in) or the valet/vault (how the agent fetches downstream credentials)? customJWTAuthorizer and SigV4 are bouncer concerns. The token vault, credential providers, 2LO/3LO, and the @requires_access_token decorator are valet/vault concerns.

The agent workload identity and its ARN

Every agent/workload gets a first-class managed identity, and a Workload Identity is auto-created with each runtime. You do not have to stand one up by hand for the common case — deploy a runtime and its workload identity comes with it.

Each agent identity functions like a Cognito User Pool: it is a unit of governance you can scope, audit, and reason about independently. It has a stable ARN of the shape:

text
arn:aws:bedrock-agentcore:<region>:<account>:workload-identity/directory/default/workload-identity/<agent-name>

Note the directory/default segment: workload identities live in a per-account workload directory, and default is the directory they land in. This directory is the registry of agent identities for your account — the thing that makes "this agent" a first-class entity rather than just a container.

Under the hood, three control APIs back the workload-identity machinery: CreateWorkloadIdentity, GetWorkloadAccessToken, and GetResourceOauth2Token. You rarely call these directly — the SDK decorators wrap them — but knowing the names helps you read IAM policies and CloudTrail. A later lesson walks the full Workload Access Token exchange end to end; here, just anchor on: one managed identity per agent, auto-created, addressable by ARN, living in the workload directory.

python
# The decorators that exercise the workload identity + vault live here.
# (Detailed usage is covered in the credential-providers lesson.)
from bedrock_agentcore.identity.auth import requires_access_token, requires_api_key

Watch out

Workload-token IAM changed at GA — verify the live page

How the execution role is granted the workload-access-token actions depends on when the agent was created. As of writing, agents created before Oct 13 2025 need an execution-role policy granting bedrock-agentcore:GetWorkloadAccessToken, GetWorkloadAccessTokenForJWT, and GetWorkloadAccessTokenForUserId; agents created on/after that date rely on the service-linked role AWSServiceRoleForBedrockAgentCoreRuntimeIdentity. This is fast-moving — confirm against the runtime-oauth docs before you wire up a role.

Framework- and model-agnostic, and where it runs

AgentCore Identity is framework- and model-agnostic. It is not coupled to a particular agent framework (Strands, LangGraph, CrewAI, and friends) or to a particular model provider — the identity, the token vault, and the inbound/outbound flows are the same regardless of what's running inside your agent.

It is also not tied to AgentCore Runtime. Identity works in Runtime, in ECS/EKS/Lambda, or in a hybrid deployment. You get the managed identity and the token vault whether your agent runs on the AgentCore-managed serverless Runtime or on your own compute. That matters in practice: teams migrating an existing containerized agent onto AWS can adopt Identity for secure credential handling without first rewriting everything to run on Runtime.

A concrete example of Identity doing outbound work, framework-agnostic, is how API keys are handled. You do not bake keys into the image. Instead a decorator injects the credential at call time from the vault:

python
from bedrock_agentcore.identity.auth import requires_api_key

@requires_api_key(provider_name="openai-provider", into="api_key")
async def call_openai(*, api_key: str):
    # `api_key` was fetched from the token vault at call time,
    # never stored in code, the image, or the LLM context.
    ...

The same pattern — credential fetched from the vault, injected as a kwarg, never exposed to the model — holds no matter which framework orchestrates the agent or which model it talks to.

Example

Outbound on non-Runtime compute

Picture a long-lived agent on EKS that calls an internal API as itself (2LO) and Google Drive on the user's behalf (3LO). Even though there's no AgentCore Runtime in the picture, the agent can still use a workload identity and the token vault to fetch scoped tokens — Identity is the credential layer, not a runtime requirement.

How Identity relates to IAM, and what comes next

A frequent point of confusion: IAM and AgentCore Identity are not the same layer.

  • IAM governs AWS-level access — the control- and data-plane APIs, creating credential providers, KMS, and the agent's execution role. SigV4 inbound auth is one of the things IAM governs. Key IAM actions you'll see include InvokeAgentRuntime, InvokeAgentRuntimeForUser, the GetWorkloadAccessToken* family, and GetResourceOauth2Token.
  • AgentCore Identity governs agent-level / workload identity — the workload directory, the token vault, and OAuth 2LO/3LO to non-AWS services (Google, GitHub, Slack, internal OIDC APIs).

A clean way to remember it: IAM is how AWS decides what your AWS principals and roles can do; Identity is how your agent proves who it is and fetches third-party credentials on a user's behalf. They interlock — the execution role (IAM) is what's allowed to mint workload access tokens (Identity) — but they answer different questions.

This lesson is the map. The rest of Module 5 walks each region of it:

  • Inbound auth — SigV4 vs JWT/OIDC (mutually exclusive per runtime version), customJWTAuthorizer, and invoking OAuth-protected agents.
  • Outbound auth & the token vault — the Workload Access Token flow, 2LO vs 3LO, per-provider refresh-token config, and KMS-backed vault isolation.
  • Credential providers & the SDK decorators — built-in OAuth vendors, API keys, @requires_access_token / @requires_api_key, and the callback-URL gotcha.
  • Governance — how Identity sits alongside IAM, Guardrails, and policy.

Hold onto the two problems and the two analogies; everything else hangs off them.

Key insight

One sentence to carry forward

AgentCore Identity gives each agent a managed workload identity plus a token vault, and uses them to authorize the caller (inbound = bouncer) and to fetch scoped, per-user downstream credentials (outbound = valet at the vault) — so agentic auth is delegated, not impersonated.

Try it: Map the inbound/outbound split for a real agent design

Goal: cement the two-problems mental model by mapping a concrete agent before you touch any auth code. No deployment required — this is a design-and-locate exercise grounded in the official docs.

Scenario. You are designing a support agent that (a) is invoked by your web app's authenticated backend, and (b) reads the requesting user's Google Drive and opens GitHub issues on their behalf.

  1. Draw the two directions. On paper or in a doc, draw the request path: web backend → agent (inbound) and agent → Google Drive / GitHub (outbound). Label which is the bouncer and which is the valet+vault.
  2. Classify each credential. For each of these, write down whether it is inbound or outbound, and one sentence why: the SigV4 signature on InvokeAgentRuntime; a JWT bearer token from your OIDC provider; a Google Drive access token; a GitHub token used to open issues for the user. Note which downstream calls act on behalf of the user (3LO) vs as the agent itself (2LO).
  3. Write the workload-identity ARN. Using your real account id and region, fill in arn:aws:bedrock-agentcore:<region>:<account>:workload-identity/directory/default/workload-identity/<agent-name>. In one sentence, explain why this identity is a 'unit of governance' and what it means that it's auto-created with the runtime.
  4. Separate IAM from Identity. List which parts of your design are governed by IAM (hint: the AWS-level actions — InvokeAgentRuntime, GetWorkloadAccessToken*, GetResourceOauth2Token, KMS, the execution role) and which by AgentCore Identity (the workload directory, the token vault, OAuth to Google/GitHub). Cross-check your answer against the runtime-oauth and runtime-permissions docs linked in Resources.
  5. Spot the volatile bit. Find, on the runtime-oauth docs page, the pre/post-Oct-13-2025 difference in how the execution role gets the workload-access-token actions (inline policy vs the service-linked role AWSServiceRoleForBedrockAgentCoreRuntimeIdentity). Note today's behavior and a reminder to re-verify before you build.
  6. Reflect. In three sentences: why is 'delegated, not impersonated' the right design here, and what would break if you instead handed the agent one shared Google + GitHub token for all users?

Key takeaways

  1. 1Identity is the linchpin of production agents because they act on real systems on a user's behalf; the naive shared-secret approach impersonates the user, while AgentCore Identity makes auth delegated.
  2. 2AgentCore Identity gives every agent/workload a first-class managed identity plus a secure credential store (the token vault), so agents are invoked securely and call downstream APIs without secrets in code or in the LLM context.
  3. 3It solves exactly two problems: Inbound Auth authorizes the CALLER invoking an agent/tool/Runtime/Gateway; Outbound Auth lets the agent reach downstream resources on behalf of the user (3LO) or as itself (2LO).
  4. 4Teaching framing: inbound = the bouncer at the door; outbound = the valet fetching the user's keys from a locked vault — keys (tokens) stay in the vault, scoped per resource and isolated per (agent identity + user).
  5. 5Each agent identity is a unit of governance (like a Cognito User Pool) with a workload-identity ARN of the form `arn:aws:bedrock-agentcore:<region>:<account>:workload-identity/directory/default/workload-identity/<agent-name>`, auto-created with each runtime and living in the workload directory.
  6. 6Identity is framework- and model-agnostic and runs in Runtime, ECS/EKS/Lambda, or hybrid — it is a credential layer, not a Runtime requirement.
  7. 7IAM (AWS-level access, SigV4, execution role) and AgentCore Identity (workload directory, token vault, OAuth 2LO/3LO to non-AWS services) are distinct but interlocking layers.

Quiz

Lock in what you learned

Check your understanding

0 / 4 answered

1.An agent invocation is governed by `bedrock-agentcore:InvokeAgentRuntime` (SigV4), and the agent then calls Google Drive to read a file for the user who invoked it. Which describes the inbound vs outbound split?

2.Your team has an existing containerized agent running on EKS (not on AgentCore Runtime) and wants to stop baking a third-party API key into the image. Can it use AgentCore Identity?

3.Why does AgentCore describe agentic auth as 'delegated, not impersonated-with-a-shared-secret'?

4.In the workload-identity ARN `arn:aws:bedrock-agentcore:<region>:<account>:workload-identity/directory/default/workload-identity/<agent-name>`, what does the structure tell you about agent identities?

Go deeper

Hand-picked sources to keep learning