AWS Certified Developer – Associate
AgentCore Identity, Policy and session isolation for DVA-C03
The Amazon Bedrock AgentCore Developer Guide splits agent security into parts. Inbound auth decides who may call the agent or gateway. AgentCore Identity vends credentials for outbound calls. Policy checks every tool call at the gateway against Cedar rules. Runtime gives each session its own microVM, which is destroyed when the session ends.
Inbound auth vs outbound auth
Inbound auth is about the caller. AgentCore Runtime accepts IAM SigV4 by default and can be configured for JWT bearer tokens. A gateway takes a JWT, an IAM identity, or an offloaded type that leaves the decision to another component. With IAM, the caller needs bedrock-agentcore:InvokeGateway, scoped to the gateway's ARN.
Outbound auth is about what the agent reaches, such as a third-party API that expects an OAuth token for the user.
A SigV4 caller can name the end user with the X-Amzn-Bedrock-AgentCore-Runtime-User-Id header so the agent can fetch that user's OAuth tokens. This needs bedrock-agentcore:InvokeAgentRuntimeForUser as well as bedrock-agentcore:InvokeAgentRuntime. AgentCore does not verify the header value, so AWS advises JWT bearer tokens for production.
Identity credential providers
AgentCore Identity stores credentials in one place and hands them out in another step. The agent asks for a credential when it needs one and never holds long-term secrets or refresh tokens.
Credential types include OAuth2 access tokens, API keys, client certificates, SAML assertions and custom tokens. Every credential operation is logged.
Example: an agent that reads each user's files in a SaaS product gets an access token from an OAuth2 credential provider at run time. The client secret is not in its environment variables or container image.
Policy: Cedar rules checked at the gateway
You create a policy engine, store policies in it and associate it with a gateway. Policy then intercepts agent traffic through that gateway and evaluates each request before the tool is reached. The check runs outside the agent's code, so it holds whatever the model decides to do.
Policies are written in Cedar. You can also describe a rule in plain English. The authoring feature generates candidate policies, validates them against the tool schema, and uses automated reasoning to flag rules that are overly permissive, overly restrictive or impossible to satisfy before you enforce them.
Runtime session isolation
Each session gets a dedicated microVM with its own compute, memory and filesystem, so one session cannot read another's data. Your application supplies a runtimeSessionId, and the first invoke with a new ID creates the session. When the session ends, the microVM is terminated and its memory is sanitized.
Session data is ephemeral by default. Files on disk last only as long as the compute, which stops after 15 minutes of inactivity or a maximum lifetime of 8 hours by default. Session storage keeps a directory across stop and resume, and AgentCore Memory keeps structured data beyond the session.
Use a unique session ID per user. On platform version V2 on microVMs, session pinning rejects a request from a different user with the same ID. On V1, AgentCore does not enforce which user owns a session, and on every version your backend must keep the user-to-session mapping.
Securing agent interactions with tool-use authorization and session isolation is a skill in Task 2.3 of the exam guide, a task that AWS lists as new in DVA-C03.
Where the exam catches people
- Believing the inbound authorizer also lets the agent call a SaaS API for the user: actually inbound auth only checks the caller, and outbound access uses a credential provider in AgentCore Identity.
- Believing rules written into the agent's prompt are enforced: actually Policy evaluates each tool call at the gateway, outside the agent's code.
- Believing files written during a session are kept afterwards: actually the microVM's disk is ephemeral unless session storage is configured.
- Believing AgentCore Runtime always knows which user owns a session: actually on platform version V1 it does not, and the backend must maintain the mapping.
- Believing the
X-Amzn-Bedrock-AgentCore-Runtime-User-Idheader is authenticated: actually AgentCore treats it as an unverified identifier and relies on IAM to limit who can send it.