Giving a Bedrock agent internet access built the smallest useful agent on AgentCore and spent its words on the trust boundary a search tool opens. This page is the platform underneath: what each AgentCore component owns, how a user's identity travels from the front door to a third-party API, and what the two most common open-source proxies do when they sit in front of it.
The guides disagree with each other often enough that this page takes its facts from the AWS SDK's API model first — botocore 1.43.107, the contract the service actually enforces — and uses the guides, two proxies' source code and four hands-on blog posts for behaviour the model cannot show.
What AgentCore is now
The data-plane API has 67 operations and the control plane 171. Grouped by what they create, AgentCore is no longer the seven services it launched as:
component | owns | the one fact that matters |
|---|---|---|
Runtime | your agent's code, one microVM per session | sessions are the unit of isolation and of cost |
Gateway | an MCP endpoint in front of tools | MCP is its only protocol; every tool is reached as target___tool |
Identity | inbound authorizers, workload identities, a token vault for outbound OAuth and API keys | the agent never holds a refresh token or client secret |
Memory | short-term events and long-term extracted records | records are listable — the agent can show what it kept |
Browser | managed Chrome sessions over CDP | idle sessions are most of the bill |
Code Interpreter | sandboxed code execution sessions | same session model as Browser, 8-hour ceiling |
Observability | traces and metrics from the above | W3C traceparent and baggage are first-class invoke headers |
Policy | Cedar policy engines attached to a Gateway | a deterministic allow or deny on each tool call, outside the model |
Evaluations | LLM-as-judge and code evaluators, online and batch | — |
Registry | a catalogue of MCP servers, A2A agents and skills | — |
The API also carries payments, A/B tests, recommendations and "harness" resources that no guide here covers; they are not discussed below.
Runtime: one session, one microVM
The contract your container implements:
protocol | port | endpoint your code serves |
|---|---|---|
HTTP | 8080 | POST /invocations , GET /ping |
MCP | 8000 | POST /mcp (Streamable HTTP) |
A2A | 9000 | POST / (JSON-RPC), agent card at /.well-known/agent-card.json |
AG-UI | 8080 | POST /invocations , server-sent events |
A runtime serves one protocol. Callers never see those ports: every protocol is invoked the same way,
POST https://bedrock-agentcore.<region>.amazonaws.com/runtimes/<url-encoded ARN>/invocations?qualifier=DEFAULT . The artifact is a container image, or a code bundle on Python 3.10–3.14 or Node 22 with no image to build.The limits, from the API model:
limit | value |
|---|---|
X-Amzn-Bedrock-AgentCore-Runtime-Session-Id | 33 to 256 characters — a bare UUID is 36, a short random string fails |
payload | 100 MB |
idle session timeout | default 900 s, configurable 60 s to 14 days |
maximum session lifetime | default 8 hours, configurable 60 s to 14 days |
network | PUBLIC or VPC |
Requests with the same session id reach the same microVM; when the session ends — idle, lifetime, or
StopRuntimeSession — the microVM and its memory are destroyed, and the next request with that id gets a fresh one with no state. A /ping that answers HealthyBusy holds the idle timer off for long-running work. A capacity provider can now place runtimes on EC2 instances you define, for workloads that need a specific instance type.Three consequences people meet:
- The session id is the conversation. If a client generates a new id per request, every turn lands in a new microVM with nothing in memory. See the LiteLLM section below.
- Idle is billed. A session that is never stopped lives until its idle timeout. The Browser measurements below show what that costs.
-
runtimeUserIdis an impersonation lever. TheX-Amzn-Bedrock-AgentCore-Runtime-User-Idheader tells the runtime — and Identity's token vault — whose tokens to use. Under SigV4 it requires a separate permission,InvokeAgentRuntimeForUser; grant it only to the front-end that authenticated the user, never to a client that could name someone else.
Identity: three hops from a user to a third-party API
user ──JWT──▶ inbound authorizer ──▶ agent code ──workload token──▶ token vault ──▶ Slack / GitHub / Salesforce (Runtime or Gateway) (GetWorkloadAccessTokenForJWT) (GetResourceOauth2Token)Hop 1, inbound. A Runtime accepts either SigV4 or a JWT, not both — a JWT-authorized runtime cannot be called with the SDK's
InvokeAgentRuntime . The JWT authorizer takes an OIDC discoveryUrl and checks any of allowedAudience , allowedClients , allowedScopes and custom claims. Set allowedClients even when it feels redundant: without it, a new app client added to the same Cognito pool next year can call your agent. JWT claims such as sub are written to CloudTrail, so the subject should be an opaque id, not an email address.Hop 2, workload identity. The agent exchanges the user's JWT (or a user id, under SigV4) for a workload access token — the key to that user's entries in the token vault for that agent.
Hop 3, outbound.
GetResourceOauth2Token returns a token for a named credential provider, in one of three flows: USER_FEDERATION (authorization code, per user, with a consent URL the first time), M2M (client credentials, shared), or ON_BEHALF_OF_TOKEN_EXCHANGE . Providers are created per vendor — 25 named ones, from Google, GitHub, Slack and Salesforce to Okta, Auth0 and Cognito, plus CustomOauth2 — and API keys live in the same vault. In the Python SDK a @requires_access_token decorator wraps all of it, so the function receives an access token and nothing else.That is the property worth paying for: the agent's context never contains a refresh token or a client secret, so a prompt injection that exfiltrates the context gets a short-lived access token at most.
Gateway: MCP in front, anything behind
| options |
|---|---|
protocol | MCP only |
inbound authorizer | CUSTOM_JWT , AWS_IAM (SigV4, caller needs InvokeGateway ), AUTHENTICATE_ONLY (SigV4 checked, authorization left to a policy engine or interceptor), NONE |
target kinds | Lambda, OpenAPI schema, Smithy model, API Gateway stage, another MCP server, and AWS-built connectors (web search, managed knowledge bases) |
outbound credentials, per target | GATEWAY_IAM_ROLE , OAUTH , API_KEY , CALLER_IAM_CREDENTIALS (the caller's own SigV4), JWT_PASSTHROUGH |
in the call path | interceptor Lambdas; a policy engine |
debugging | exceptionLevel: DEBUG returns granular errors to the caller — useful in development, an information leak in production |
The policy engine is the important addition. A Cedar policy engine attached to a Gateway evaluates every tool call and allows or denies it before the target sees it. That is the control Multi-agent operations argues for — a guardrail that sits outside the model, where the model cannot argue with it — and it can see the tool and its arguments, which a Bedrock Guardrail on prose cannot ( wish 5 ).
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article