Choose the current greenfield boundary deliberately
For a new managed AWS agent design, treat Amazon Bedrock AgentCore as the current greenfield direction. Amazon Bedrock Agents Classic entered maintenance and stopped accepting new customers on 2026-07-30. This does not make an existing workload unsafe by itself; it changes the default evaluation for new work and migrations.
AgentCore base capabilities, Policy, and Evaluations have separate release histories, and availability remains feature and Region specific. Managed session storage and latency-optimized inference should be assessed at their individual availability status, not assumed from the platform name. Check current service, Region, quota, model, and preview terms during design and again before deployment.
Separate execution, identity, tools, state, and assurance
A governed agent architecture keeps the model-driven application distinct from the control points that authenticate callers, expose tools, retain approved state, observe execution, evaluate quality, and enforce policy. This separation lets a team audit a tool boundary without confusing it with the runtime or conversation state.
AgentCore and MCP control-plane view
Loading diagram...
Each service answers a different question
| Boundary | Question |
|---|---|
| Runtime | Where does the agent application execute and receive a session? |
| Identity | Who is calling, and what identity context can be exchanged? |
| Gateway and Policy | Which exposed actions are permitted for this request? |
| Memory | What state may be retained and recalled? |
| Observability and Evaluations | What happened, and did it meet the defined contract? |
Bind a runtime session to an application identity
AgentCore Runtime provides a managed execution boundary and session isolation, but it cannot decide which application user or tenant a request represents. Configure each Runtime resource with a least-privilege execution role. Separately, the application must authenticate the caller, bind the runtime session to a server-side user and tenant record, and authorize every data or tool action at the owning backend.
Illustrative server-side session binding
Application-owned session binding record, not an AgentCore response schema.
Click on an annotation to highlight it in the JSON
Release tests should exercise the entire chain rather than treating a policy simulator as sufficient evidence. Send a valid allowed call, an unlisted tool, a mismatched tenant resource, an expired credential, malformed arguments, a direct backend request, a retryable read timeout, and an unknown write outcome. For each, assert what the caller receives, whether the target was invoked, the backend authorization outcome, the trace correlation, and the retained audit fields. This reveals gaps such as an authenticated gateway request that is not authorized for the target, or a target that accepts a direct request outside the intended gateway path. Keep responses concise enough not to disclose policy structure or resource existence.
Do not use the model prompt or a client-supplied tenant field as authority. Validate session ownership server side, scope retrieval and tool queries at the data boundary, and include negative tests for cross-tenant identifiers and replayed sessions.
Treat MCP as a governed protocol boundary
MCP separates an AI host and client from a server that offers tools, resources, and prompts. The protocol shape does not grant authority. For every server, document connection lifecycle, authentication method, tool and resource allowlist, input schema, output classification, rate and cost boundary, timeout, error contract, and audit event.
MCP lifecycle checks
| Phase | Required control |
|---|---|
| Connect | Authenticate the client and establish an attributable session |
| Discover | Expose only approved tools, resources, and prompts |
| Invoke | Validate schema, propagate identity, and authorize at the backend |
| Respond | Classify output, preserve provenance, and limit sensitive data |
| Close or expire | Revoke session material and retain the required audit receipt |
Keep the policy enforcement path complete
AgentCore Gateway provides a governed integration boundary and AgentCore Policy evaluates requests routed through that Gateway. Policy is not an account-wide interceptor. A direct network route to the same backend can bypass that specific enforcement path, so remove it or give the backend independent identity and authorization controls.
allow only named tools and operations
require principal, tenant, purpose, and request context
validate arguments before backend invocation
require approval for high-impact operations
log the decision, policy version, and correlation id
deny direct paths that bypass the intended enforcement boundaryUse Cedar policies only after modelling the resources, principals, and actions precisely. A policy that is syntactically valid but lacks tenant, purpose, or resource attributes cannot repair a weak application identity model.
Debug policy, identity, runtime, and tool failures as separate classes
Trace the request across application, runtime, gateway, policy, and backend tool boundaries using one correlation identifier. Detailed traces require application or framework instrumentation. They show what happened, but evaluation must still decide whether the path was grounded, authorized, useful, and within the workload’s reliability and cost constraints.
Failure isolation sequence
| Observed symptom | First evidence to inspect |
|---|---|
| No runtime response | Application invocation, runtime session binding, timeout, and deployment configuration |
| Tool unavailable | Gateway target, tool discovery, schema validation, and backend health |
| Access denied | Principal, tenant, propagated token, policy decision, and backend authorization |
| Fluent but unsafe answer | Trace, evidence provenance, policy path, evaluation case, and answer contract |
| Unexpected cost or latency | Step count, tool calls, model calls, retries, payload size, and cache behaviour |
Treat an MCP tool call as an authorization request, not model text
An MCP client may describe a tool call with JSON-RPC, but the server must derive its security decision from authenticated identity and validated request attributes, not from a model-produced explanation. At the gateway boundary, authenticate the caller, map the authenticated subject to an application principal, validate the named tool and arguments, and extract the action, resource, tenant, purpose, and request context needed by policy. Inbound authentication establishes who presented a credential. It is not authorization, and it does not remove the target service’s responsibility to authorize direct access to its own data or side effects.
Illustrative JSON-RPC tools/call authorization input
The JSON-RPC envelope is client input. The principal and authorization context are derived and validated at the enforcement boundary; they are shown beside the request here, not supplied as a trusted client claim.
Click on an annotation to highlight it in the JSON
Illustrative JSON-RPC tools/call success response
Representative success response. The JSON-RPC result is paired to the request ID; source references and correlation ID are application-owned result fields for safe review, not a claim about every MCP server response schema.
Click on an annotation to highlight it in the JSON
Illustrative JSON-RPC tools/call rejection response
Representative bounded error response for invalid arguments or a policy denial. Keep public error text concise and do not reveal policy rules, resource existence, or backend implementation detail.
Click on an annotation to highlight it in the JSON
Governed MCP tool invocation sequence
Loading diagram...
Model allow, deny, and forbid decisions explicitly
Policy design begins with a resource model, not a permissive default. In Cedar terms, policy evaluation considers principals, actions, resources, and context. An allow rule grants only a stated relation; a deny rule prevents a stated relation; and a forbid rule provides an explicit safety boundary that overrides a matching allow. Design defaults so an absent allow fails closed, then use explicit forbids for conditions that must never pass, such as a cross-tenant resource or an unapproved write. Keep policy evaluation evidence separate from backend enforcement evidence: a gateway decision cannot protect a direct path that still reaches the target.
Responsibility matrix for a governed MCP call
| Boundary | Responsibility | Validation evidence |
|---|---|---|
| Gateway inbound auth | Validate token and establish trusted caller identity | Rejected missing, expired, or invalid credentials. |
| Policy decision | Evaluate principal, action, resource, and context; apply allow/deny/forbid semantics | Decision receipt includes policy version and matched rationale. |
| Tool adapter | Validate schema, constrain parameters, propagate approved identity | Malformed or unlisted tool calls never reach the target. |
| Direct target service | Authorize the target operation independently and preserve least privilege | Direct-call tests cannot bypass tenant or action controls. |
Bound denial, timeout, and fallback behavior before release
A denial is a valid security outcome, not a transient error to route around. Return a safe, user-appropriate explanation without leaking policy internals, record a correlation ID and decision category, and stop the tool chain unless an independently authorized alternate path exists. For a timeout, distinguish “not sent”, “sent but unknown”, and “target unavailable”. Retry only idempotent reads within a declared budget. For a write with unknown outcome, reconcile using the target’s idempotency or status mechanism before considering compensation. The bounded fallback is a static retrieval response, an approved human handoff, or abstention—not a wider tool search.
Timeout and denial runbook record
An application runbook contract that prevents fallback from widening authority.
Click on an annotation to highlight it in the JSON
Amazon Bedrock AgentCore authorization flow
Primary documentation for how AgentCore Policy evaluates authorization at its gateway enforcement boundary. Confirm current feature and Region availability for the target workload.
Read the AgentCore authorization flowBind OAuth-derived identity to MCP schema validation
Inbound OAuth authorization validates a caller credential at the gateway boundary, but the application still needs a precise mapping from trusted token claims to its principal and tenant model. Define which issuer, audience, scopes, and subject attributes are accepted, reject missing or ambiguous mappings, and avoid copying raw access tokens into prompts, traces, or tool arguments. Independently validate each MCP tool schema with a closed parameter set, size limits, allowed resource patterns, and type checks before policy evaluation and target invocation. The tool name and arguments are untrusted client input even if the caller is authenticated. Confirm AgentCore Gateway feature and Region support for the target workload before adopting any configuration.
OAuth and MCP validation contract
Illustrative application contract; exact provider claims and gateway configuration are workload-specific.
Click on an annotation to highlight it in the JSON
Validate with expired, wrong-audience, missing-tenant, over-scoped, malformed, oversized, and unknown-tool requests. The expected evidence is a controlled rejection before target invocation, a correlation record that does not contain the token, and an independent target-service denial if someone bypasses the gateway.
Govern policy and tool changes with revocation evidence
A tool’s effective authority changes when its schema, target, backend permission, token mapping, policy, or data classification changes. Treat that combination as a governed release. Require a named owner, diff review, compatibility decision, approval for high-impact scope changes, test evidence, and a revocation plan. Revocation should be demonstrable: disable a tool or principal, invalidate or reject affected credentials as the identity provider supports, remove backend access, and confirm both gateway and direct target paths refuse the action. Keep audit records of who changed the control and which policy and target versions handled each request.
Governance and revocation evidence
| Change | Required control | Proof |
|---|---|---|
| New MCP tool or target | Schema, policy, target authorization, and threat review | Allowed, denied, malformed, and direct-path tests. |
| Broader principal or resource scope | Explicit approval and rollback plan | Policy diff and cross-tenant denial regression. |
| Emergency revocation | Disable gateway route and target permission as applicable | Post-change denied call with correlation receipt. |
Keep a time-bounded emergency procedure for situations where normal change review is too slow, but require a post-incident reconciliation. That receipt should identify the temporarily disabled principal, tool, route, policy or backend permission, the evidence that revocation worked, the scope of possible prior exposure, and the approval needed to restore access. Restoration is another authorization change: retest the minimum permitted action rather than re-enabling a broad role because the incident has ended.
Glossary: terms first introduced here
These are the technical terms introduced in this step. Later modules build on them rather than redefining them from scratch.
New vocabulary for this step
| Term | Plain-language meaning | Why it matters here |
|---|---|---|
| MCP (Model Context Protocol) | A protocol for connecting AI applications to external tools and context providers through defined interfaces. | It standardizes connection shape, not trust: every server and target still needs its own authorization design. |
| MCP server | A service that exposes defined tools, resources, or prompts to an MCP-compatible client. | Its published capability and schema are part of the attack surface and release contract. |
| Gateway | A control point that can authenticate, authorize, route, observe, and limit requests before they reach a tool target. | It should complement, never replace, authorization at the underlying target. |
Knowledge Check
Test your understanding with this quiz. You need to answer all questions correctly to mark this section as complete.