Certopolis

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-Id header is authenticated: actually AgentCore treats it as an unverified identifier and relies on IAM to limit who can send it.

Written from these sources

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. A developer is building an agent on Amazon Bedrock AgentCore that calls a third-party SaaS API with OAuth 2.0 access tokens on behalf of users. The agent's code must never hold the OAuth client secret or the users' refresh tokens. Which solution will meet these requirements?

    Right. In the game that’s Renown for your Security building.

    Not that one: C is right. In the game your Security building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    Its design separates where credentials are stored from how they are accessed, so an agent asks for an access token when it needs one and never holds the long-term client secret or the refresh tokens.

    Written from docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-outbound-credential-provider.html

  2. A developer is deploying an AI agent that runs code and writes working files during each customer conversation. Code that runs for one customer must never be able to read memory or files left by another customer's conversation, and nothing from a conversation may remain after that conversation ends. Which solution will meet these requirements?

    Right. In the game that’s Renown for your Security building.

    Not that one: D is right. In the game your Security building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    When the session ends, the microVM is terminated and its memory is sanitized, so files kept on the session's own filesystem do not outlive the conversation.

    Written from docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-sessions.html

  3. Security analysts want to write authorization rules for AI agent tool calls in plain English instead of in a policy language. The rules must be enforced by an Amazon Bedrock AgentCore Gateway, and any rule that is overly permissive, overly restrictive, or impossible to satisfy must be flagged before enforcement begins. Which solution will meet these requirements?

    Right. In the game that’s Renown for your Security building.

    Not that one: A is right. In the game your Security building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    The approved policies go into a policy engine associated with the gateway, which evaluates every tool call against them.

    Written from docs.aws.amazon.com/bedrock-agentcore/latest/devguide/policy.html

Ask for something