Claude Managed Agents for Amazon Bedrock REST API reference
The Claude Managed Agents for Amazon Bedrock API is Anthropic's Managed Agents API, with every path under /anthropic/v1/ and AWS Signature Version 4 (SigV4) signing. You define an agent, create a session for it, and send the session messages. The service runs the agent loop, calls the model, and sends each built-in tool call to a tool runner that runs on an Amazon Bedrock AgentCore Runtime in your account or on a machine that you start it on.
This reference describes what a developer needs to call the API: the endpoint and signing, the headers, the operations, the main request and response fields, and the errors. For fields that this page does not list, use Anthropic's Managed Agents API reference together with the differences described here.
Endpoint and signing
The base URL is https://bedrock.. Every path in this reference is relative to it, so region.amazonaws.com/anthropic/v1POST /agents is POST https://bedrock.us-west-2.amazonaws.com/anthropic/v1/agents. A path outside /anthropic/v1/ is not served.
AWS Region |
Region code |
Base URL |
|---|---|---|
US East (N. Virginia) |
|
|
US East (Ohio) |
|
|
US West (Oregon) |
|
|
Canada (Central) |
|
|
South America (São Paulo) |
|
|
Europe (Frankfurt) |
|
|
Europe (Ireland) |
|
|
Europe (London) |
|
|
Europe (Stockholm) |
|
|
Asia Pacific (Mumbai) |
|
|
Asia Pacific (Seoul) |
|
|
Asia Pacific (Singapore) |
|
|
Asia Pacific (Sydney) |
|
|
Asia Pacific (Tokyo) |
|
|
Sign every request with SigV4, with the signing service name bedrock and the endpoint's Region. With temporary credentials, send the session token in X-Amz-Security-Token. Anthropic's SDKs sign for you.
Only IAM role sessions can call the API. A request signed by an IAM user or by the account root user is refused with 403, because the service records every agent, session, and event as created by a role.
Each operation is authorized as its own IAM action, named bedrock:, such as VerbAnthropicNounbedrock:CreateAnthropicSession. An operation on a resource is authorized on that resource's ARN. The list operations are authorized on the project ARN, and the creates on . The encryption configuration operations are authorized on the encryption configuration's own ARN. The tag operations use the shared Amazon Bedrock tagging actions.project-arn/anthropic-type/*
The request body is JSON, at most 2 MiB (2,097,152 bytes). Each response carries x-amzn-requestid. Keep it when you report a problem.
Headers
Send these headers in addition to the SigV4 signing headers and, on a request with a body, Content-Type: application/json.
Header |
Required |
Description |
|---|---|---|
|
Yes |
|
|
Yes |
|
|
No |
The Amazon Bedrock project, as a project ID such as |
|
No |
On session create, a role to run the session as, the same as the body's |
How this API differs from Anthropic's Managed Agents API
The API follows Anthropic's Managed Agents API: the same resources, paths (under /anthropic/v1/), request and response bodies, and error body. Anthropic's SDKs sign their requests with SigV4. Set the client's base URL to the base URL without its trailing /v1. The SDKs retry some failures on their own, so read Errors and retries before you use one. The main differences are the following.
Area |
On Amazon Bedrock |
|---|---|
Authentication |
SigV4 with IAM role credentials. |
Environments |
There is no environments API. A session's |
Roles |
An agent has one IAM role, the session role, named as |
Models |
|
MCP servers |
Only |
Skills |
|
Session resources |
|
Built-in tools |
A |
Files, skills, vaults, and deployments APIs |
Not available. Their routes answer |
Outcomes |
Not available. A |
Streaming |
The stream sends whole events. Partial text is sent only on a stream opened with |
Unknown fields |
Refused with |
Added fields |
Agents, sessions, and memory stores carry |
Retry hints |
An error worth retrying can carry |
Creates |
Not idempotent. A repeated create makes a second agent, session, or memory store. |
Operations
All paths are relative to the base URL. Updates use POST, not PATCH, and change only the fields that they send. Agents can't be deleted, only archived.
Operation |
Method and path |
Successful response |
|---|---|---|
Create an agent |
|
Agent resource, at version 1 |
List agents |
|
Paginated agent summary list |
Get an agent |
|
Agent resource |
Update an agent |
|
Agent resource, at its new version |
Archive an agent |
|
Agent resource, with |
List an agent's versions |
|
Paginated agent summary list |
Create a session |
|
Session resource |
List sessions |
|
Paginated session summary list |
Get a session |
|
Session resource |
Update a session |
|
Session resource |
Archive a session |
|
Session resource, with |
Delete a session |
|
|
Send events |
|
List of the stored events |
List events |
|
Paginated event list |
Stream events |
|
|
List threads |
|
Paginated thread list |
Get a thread |
|
Thread resource |
Archive a thread |
|
Thread resource, with |
List a thread's events |
|
Paginated event list |
Stream a thread's events |
|
|
Create a memory store |
|
Memory store resource |
List memory stores |
|
Paginated memory store summary list |
Get a memory store |
|
Memory store resource |
Update a memory store |
|
Memory store resource |
Archive a memory store |
|
Memory store resource, with |
Delete a memory store |
|
|
Create a memory |
|
Memory resource |
List memories |
|
Paginated list of memories and folder markers |
Get a memory |
|
Memory resource |
Update a memory |
|
Memory resource |
Delete a memory |
|
|
List memory versions |
|
Paginated memory version list |
Get a memory version |
|
Memory version resource |
Redact a memory version |
|
Memory version resource, with |
Get a project's encryption configuration |
|
Encryption configuration |
Set a project's encryption configuration |
|
Encryption configuration |
Activate a self-hosted tool runner |
|
Activation |
Tag an agent, memory store, or session |
|
|
Untag an agent, memory store, or session |
|
|
List an agent's, memory store's, or session's tags |
|
|
Use the IDs returned by the service and treat them, and pagination tokens, as opaque values. IDs carry a type prefix: agent_, sesn_ (session), sthr_ (thread), sevt_ (event), memstore_, mem_, and memver_. A path ID that is not of its type's form is a 400, such as session_id is not a valid session id.
A list returns data and, when more results exist, next_page. Pass that value as the page query parameter of the next request to the same list, with the same filters. A next_page value expires after 24 hours. After that, the list answers 400 invalid or expired page token; restart pagination, so start again from the first page. Timestamps are RFC 3339 in UTC, such as 2026-11-20T17:05:40.318Z. metadata is up to 16 string pairs, stored with the resource and never evaluated by IAM.
Create an agent
An agent is a versioned definition: the model, the system prompt, the tools, skills, and MCP servers, the agents it can call, and the IAM role that its sessions run as. Creating an agent makes version 1. An update that changes the configuration makes a new version.
Request
POST /anthropic/v1/agents HTTP/1.1 Host: bedrock.us-west-2.amazonaws.com anthropic-version: 2023-06-01 anthropic-beta: managed-agents-2026-04-01 Content-Type: application/json
The following body creates an agent that can use the built-in tools:
{ "name": "first-agent", "model": "us.anthropic.claude-sonnet-5-5", "system": "You are a careful assistant. Use bash to answer questions about the machine you run on.", "execution_identity": { "type": "aws_role", "role_arn": "arn:aws:iam::111122223333:role/ClaudeManagedAgentsSessionRole" }, "tools": [{ "type": "agent_toolset_20260401", "default_config": { "permission_policy": { "type": "always_allow" } } }] }
Field |
Required |
Description |
|---|---|---|
|
Yes |
The display name, 1 to 256 characters. It need not be unique. |
|
Yes |
An Amazon Bedrock inference profile ID that the endpoint offers, such as |
|
Yes, unless |
|
|
No |
The system prompt, up to 100,000 characters. |
|
No |
A description, up to 2,048 characters. |
|
No |
Up to 256 entries. |
|
No |
Up to 20 entries of |
|
No |
Up to 20 folders of skills: |
|
No |
|
|
No |
Up to 16 string pairs. |
|
No |
The agent's AWS tags. See Tags. |
If you don't set a permission policy, the toolset uses auto. To control this yourself, set one. allowed_role_arns and inference_geo are refused.
Creating or updating an agent is also authorized on the model's inference profile, each AgentCore Gateway in mcp_servers, each S3 folder of an s3_mount skill, and each agent in the multiagent list. See the caller's permissions in Security and IAM roles.
Response
The response is the stored agent at version 1. It includes the fields of the request, with every default filled in, and the following fields.
Field |
Description |
|---|---|
|
The agent ID, such as |
|
|
|
The version, starting at 1. |
|
The agent's ARN, such as |
|
The agent's role, under both names. |
|
The role that created the agent, as |
|
When version 1 was created, when this version was written, and when the agent was archived, or |
Creating an agent is not idempotent. Each request makes a new agent. If you lose a create's response, list your agents before you send it again.
Create a session
A session is one stateful conversation with one agent. It holds its own copy of the agent's configuration, taken when it is created, names where its built-in tools run, and runs as one IAM role that can't change. Nothing starts yet: on an AgentCore Runtime, the service starts the session's container when you send the first event.
Request
POST /anthropic/v1/sessions HTTP/1.1 Host: bedrock.us-west-2.amazonaws.com anthropic-version: 2023-06-01 anthropic-beta: managed-agents-2026-04-01 Content-Type: application/json
The following body creates a session for that agent on an AgentCore Runtime:
{ "agent": "agent_011CZkZAtmR3yMPDzynEDxu7", "environment_id": "arn:aws:bedrock-agentcore:us-west-2:111122223333:runtime/cma_tool_runner-a1b2c3d4e5", "title": "Investigate the failing build", "metadata": { "ticket": "1234" } }
Field |
Required |
Description |
|---|---|---|
|
Yes |
An agent ID, which uses the agent's latest version. To pin a version, send |
|
Yes |
Where the built-in tools run: an AgentCore Runtime ARN in your account and the endpoint's Region ( |
|
No |
A role to run the session as in place of the agent's role: any role in your account that you may pass. The older |
|
No |
The absolute path where the tools start. The default is |
|
No |
A display title, up to 500 characters. |
|
No |
Up to 16 string pairs. |
|
No |
Memory stores to attach, folders in your tool runner to tell the agent about, and Amazon S3 folders and files to mount or copy in. See Session resources. |
|
No |
Up to 50 |
|
No |
The session's AWS tags. A session does not take its agent's tags. |
vault_ids, budget, agent_id, and outcome events are refused. The caller needs bedrock:CreateAnthropicSession on the new session, the agent and each agent it calls directly, each attached memory store, with the bedrock:AnthropicMemoryStoreAccess condition key set to ReadOnly or ReadWrite for the access that the session asks for, and the parent AgentCore Runtime ARN (also when environment_id names one of its endpoints) or the project's self-hosted ARN.
Overrides
An agent_with_overrides object takes id and optional version, model, system, skills, tools, and mcp_servers. A field that you leave out keeps the agent's value. A field that you send replaces it for this session's copy only. The stored agent does not change. This example changes one session's role, system prompt, and model, and attaches two memory stores. The agent must have the memory toolset enabled.
{ "agent": { "type": "agent_with_overrides", "id": "agent_011CZkZAtmR3yMPDzynEDxu7", "model": "us.anthropic.claude-sonnet-5-5", "system": "Read the reference store and record your work in the journal store." }, "execution_identity": { "type": "aws_role", "role_arn": "arn:aws:iam::111122223333:role/CmaSessionOverrideRole" }, "environment_id": "arn:aws:bedrock-agentcore:us-west-2:111122223333:runtime/cma_tool_runner-a1b2c3d4e5", "resources": [ { "type": "memory_store", "memory_store_id": "memstore_01AbCdEfGhJkLmNoPqRsTuVw", "access": "read_only" }, { "type": "memory_store", "memory_store_id": "memstore_01XyZaBcDeFgHiJkLmNoPqRs", "access": "read_write" } ] }
A model override is also authorized on its inference profile, arn:aws:bedrock:. Each AgentCore Gateway of an region:account:inference-profile/model-idmcp_servers override and each S3 folder of an s3_mount skill override is authorized on its ARN. Administrators can restrict which fields may be overridden with the Bool condition keys bedrock:AnthropicAgentsOverrideModel, bedrock:AnthropicAgentsOverrideSystem, bedrock:AnthropicAgentsOverrideSkills, bedrock:AnthropicAgentsOverrideTools, and bedrock:AnthropicAgentsOverrideMcpServers.
A session update, POST /sessions/{id}, takes title, metadata, and an agent patch with tools, mcp_servers, or both. It can't change the role, the skills, or the agent, and tools and MCP servers can't change while the session is running. A session update is authorized on the session, its agent, and each AgentCore Gateway that the patch names.
Session resources
Each resources entry has a type. Entries are named only at create and can't change later.
Type |
Description |
|---|---|
|
Attaches a memory store from the same project, by |
|
Tells the agent about a folder or file at |
|
An S3 folder, |
|
One S3 object, |
A session can name at most 20 sandbox_path, s3_mount, and s3_object entries in all. S3 entries need an environment_id that names an AgentCore Runtime, and the service refuses them on a self-hosted session. The service authorizes each S3 folder and object on its ARN. The service reports a failure to put an S3 entry in place as a session.error event, not as an error of the create.
Response
The response is the new session resource. It includes:
Field |
Description |
|---|---|
|
The session ID, such as |
|
|
|
The session's ARN, |
|
|
|
The session's own copy of its agent, with any override applied. Later changes to the stored agent do not reach it. |
|
Where the built-in tools run, as given on create. |
|
The role that the session runs as, under both names. |
|
Where the tools start. |
|
The entries named on create, each with its own |
|
Token counts, working time, and an estimated cost at list price, which is not what your account is billed. |
|
Who created the session, and when it was created, last changed, and archived. |
Creating a session is not idempotent. Each request makes a new session. If you lose a create's response, list your sessions before you send it again. To archive a session, which keeps its events, send POST /sessions/{id}/archive. To delete a session and its events, and stop its container on AgentCore Runtime, send DELETE /sessions/{id}. A running session can't be archived or deleted, so interrupt it first. Deleting a session does not delete what its tools wrote outside the service, such as files in your S3 buckets.
Send events
Send events with POST /sessions/{id}/events. The request body holds an events array of 1 to 1,000 events, applied in order. The response, {"data": [...]}, lists the stored form of each event with its new id. It comes back as soon as the events are stored, not when the turn ends. On an AgentCore Runtime, the first send starts the session's container before the events are stored, so it can take several seconds.
POST /anthropic/v1/sessions/sesn_011CZkZB4mR3yMPDzynEDxu8/events HTTP/1.1 Host: bedrock.us-west-2.amazonaws.com anthropic-version: 2023-06-01 anthropic-beta: managed-agents-2026-04-01 Content-Type: application/json
{ "events": [{ "type": "user.message", "content": [{ "type": "text", "text": "Summarize the files in the workspace." }] }] }
Event type |
Fields |
Description |
|---|---|---|
|
|
Starts a turn. |
|
|
Stops the current turn. Without |
|
|
Allows or denies a tool call that waits for permission. |
|
|
Returns the result of a custom tool that the agent called. |
A tool whose permission policy is always_ask pauses the session before it runs. The session goes idle with the stop reason requires_action, and stop_reason.event_ids names the tool call events. Answer each one:
{ "events": [{ "type": "user.tool_confirmation", "tool_use_id": "sevt_011CZkZD2sR3yMPDzynEDxuA", "result": "allow" }] }
When the agent calls a custom tool, the session emits agent.custom_tool_use and goes idle with requires_action. Run the tool in your application and send its result:
{ "events": [{ "type": "user.custom_tool_result", "custom_tool_use_id": "sevt_011CZkZE5tR3yMPDzynEDxuB", "content": [{ "type": "text", "text": "Paris" }] }] }
While the session waits on a tool call, it accepts only the answer to that call, or user.interrupt. One request can't mix user.message, tool results, and user.tool_confirmation. You can't send user.tool_result: a built-in tool's result comes from the tool runner. Do not retry a 500 from this operation automatically, because the events may be stored. List the session's events before you send them again.
List and stream events
GET /sessions/{id}/events returns the session's events, oldest first.
GET /anthropic/v1/sessions/sesn_011CZkZB4mR3yMPDzynEDxu8/events?limit=100&types[]=agent.message HTTP/1.1 Host: bedrock.us-west-2.amazonaws.com anthropic-version: 2023-06-01 anthropic-beta: managed-agents-2026-04-01
Query parameter |
Description |
|---|---|
|
Events per page, from 1 to 1,000. Default: 1,000. |
|
|
|
The |
|
Only events of this type. Repeat the parameter, with the brackets, for each type. |
|
Only events in a time range, as RFC 3339 times. |
GET /sessions/{id}/events/stream keeps the connection open and sends each event as it happens, as server-sent events. Send Accept: text/event-stream, and open the stream before you send a message so that you see the whole turn.
: connected event: message data: {"id":"sevt_011CZkZF8uR3yMPDzynEDxuC","processed_at":"2026-11-20T17:06:02.21Z","type":"session.status_running"} :keepalive
Each event: message block has one JSON event in its data line. Lines that begin with : are comments. Ignore them, as SSE clients do. A quiet stream gets a comment every 15 seconds, so that idle timeouts on the way do not close it. The service closes a stream that has carried no event for 10 minutes, even while a turn runs. In a project on a customer managed key, the service also closes every stream after 15 minutes, at an event boundary, so that the caller's access to the key is checked again. Reconnect to go on. Comments and partial text do not count as events.
The stream sends each event whole. To also see an agent's text as the model writes it, open the stream with event_deltas[]=agent.message. The stream then sends event_start and event_delta frames before the finished event, which still carries the whole text. These frames are best effort: some can be dropped, and they are never stored or listed. event_deltas[]=agent.thinking sends only the event_start frame, never the thinking text.
If the stream drops or is closed, the session goes on. List the events to see what happened while you were away, and reconnect. An error before the stream opens is answered as a JSON error body.
Event types and stop reasons
Every event has id, type, and, once processed, processed_at. Events you sent also carry sent_by. Expect event types that you don't use, and skip them.
Event type or stop reason |
Description |
|---|---|
|
Text from the agent, in |
|
Marks that the agent reasoned before its next step, for models that reason. The reasoning text isn't shown. |
|
A built-in or memory tool call, with |
|
A built-in tool call's result from your tool runner. The service writes one with |
|
A tool call's result that the service writes itself: every memory tool call's result, and a built-in tool call's result when the call is denied or interrupted. Match a result to its call by |
|
A call to a tool on an MCP server, and its result. |
|
A call to one of your custom tools. Answer it with |
|
A turn started. |
|
A turn stopped. The reason is in |
|
The session ended. A stream receives it as its last event when the session is archived, and receives |
|
Something failed. |
|
A model request finished, with its token usage in |
Stop reason |
The agent finished and waits for the next message. |
Stop reason |
The agent called tools that need an answer from you. |
Stop reason |
The service retried a failure, such as a model request, or the session's container could not put its S3 folders and files in place, and it gave up. The session still works, and the next event that you send tries again. After |
When the model refuses to answer, the turn still ends with end_turn. The refusal is in the same event's stop_details, as {"type": "refusal", "category": "...", "explanation": "..."}, which is null on every other turn. An idle session is not proof that the task worked. Check stop_details, then read the tool results and the agent's last message.
Threads
Every session has a primary thread. When a coordinator agent calls a subagent, the call runs in a subagent thread of the same session, with its own tools and the same tool runner. A thread has an id (sthr_...), parent_thread_id (null for the primary thread), agent, status (idle, running, or terminated), and usage.
The thread operations mirror the session's: list threads, get a thread, list a thread's events, and stream a thread's events, which behaves as the session's stream does. A thread's event list takes only limit and page. order, types[], and created_at filters are refused with 400. Archive a subagent thread that you no longer need with POST /sessions/{id}/threads/{thread_id}/archive, because a coordinator starts no new subagent thread while a session holds as many live ones as its limit allows. The primary thread can't be archived, and a running thread must be interrupted first with a user.interrupt that sets session_thread_id.
Memory stores and memories
A memory store holds text documents, called memories, that the service keeps across sessions. An agent with the memory toolset reads and changes the memories of the stores that its session attaches, and your application reads and changes them through the memory operations.
POST /anthropic/v1/memory_stores HTTP/1.1 Host: bedrock.us-west-2.amazonaws.com anthropic-version: 2023-06-01 anthropic-beta: managed-agents-2026-04-01 Content-Type: application/json
{ "name": "payments-oncall", "description": "What the payments on-call engineers hand over" }
A create takes name (required, 1 to 255 characters), description (up to 1,024 characters), metadata, and tags. The memory tools show the name and description to the model. The response is the memory store, with id (memstore_...), resource_arn, backend {"type": "managed"}, and created_by. An archived store can still be read. Its memories can't be created or updated, but they can be deleted. Deleting a store deletes its memories.
A memory is a text document at a path in a store, such as /services/billing.md. Create one with POST /memory_stores/{id}/memories:
{ "path": "/escalation.md", "content": "# Payments escalation\n\nPage the payments manager.\n" }
Field |
Required |
Description |
|---|---|---|
|
Yes |
Starts with |
|
Yes on create |
The whole text, up to 102,400 bytes of UTF-8. |
|
No, on update only |
|
A memory has id (mem_...), path, content (null in the basic view), content_size_bytes, content_sha256, and memory_version_id. The view query parameter selects basic or full. List memories with path_prefix, a folder ending with /, and depth 1 to list one folder's memories and subfolders. An update changes content, path, or both. A delete takes an optional expected_content_sha256 query parameter. On a conflict, the service answers 409 with memory_path_conflict_error or memory_precondition_failed_error. Read the memory again before you retry.
Every write that changes a memory appends a memory version (memver_...), with the whole text, the operation (created, modified, or deleted), and who made it, as a caller or a session actor. List versions with filters such as memory_id, session_id, and operation. Redacting a version, with POST /memory_stores/{id}/memory_versions/{memory_version_id}/redact, empties its text and path and keeps its record. The current version of a memory can't be redacted.
A memory and a memory version have no ARN of their own. Operations on them are authorized on their memory store.
Encryption configuration
The service encrypts the content that it stores at rest with an AWS owned key by default. A project's encryption configuration can name a customer managed AWS KMS key in AWS Key Management Service (AWS KMS) instead, with a key role in your account that the service assumes to use it. Each project has one encryption configuration. Encryption is server side: the service encrypts content before it stores it and decrypts it when an authorized caller reads it.
What the key protects
The service uses envelope encryption: your key encrypts the project's data keys, and the data keys encrypt the content. The service caches decrypted data keys in memory for up to 5 minutes. Your key protects this content in the project:
Resource |
What the key encrypts |
|---|---|
Agents |
Each version's configuration, including the system prompt, tools, MCP servers, and skills. |
Sessions |
The conversation and its events, including messages, tool inputs, and tool results, and the session's |
Memory stores |
The memories and their versions. |
Large values, such as long events, are encrypted the same way.
These are not under your key. They include, but are not limited to:
-
Resource metadata that the service needs to find, route, and authorize requests: IDs, ARNs, the account and project, versions, status, timestamps, and the IAM roles that agents and sessions run as or that created a session. The service encrypts these at rest under a key that it owns. Don't put sensitive data in them.
-
Resource tags.
-
Files that tools write. The service does not store them. They stay where the tool runner wrote them, such as your runtime's storage or your Amazon S3 folders, under that storage's own encryption.
-
Telemetry. Where you turn on trace delivery, text that you choose, such as an agent's name or a session's title, can appear on trace spans delivered to Amazon CloudWatch and AWS X-Ray.
Get and set the encryption configuration
Both operations are signed with SigV4, and the anthropic-workspace-id header names the project.
Operation |
IAM action |
Resource |
|---|---|---|
|
|
|
|
|
The same configuration ARN |
AWS CloudTrail names the resource type AWS::Bedrock::AnthropicEncryptionConfiguration. Set a customer managed key:
PUT /anthropic/v1/bedrock/encryption_configuration HTTP/1.1 Host: bedrock.us-west-2.amazonaws.com anthropic-version: 2023-06-01 anthropic-beta: managed-agents-2026-04-01 anthropic-workspace-id: proj_EXAMPLE Content-Type: application/json
{ "kmsKeyArn": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", "roleArn": "arn:aws:iam::111122223333:role/CmaKeyRole" }
Field |
Required |
Description |
|---|---|---|
|
Yes |
The ARN, not an alias, of a symmetric encryption KMS key in the project's Region. The key can be in another account if its key policy allows the callers and the key role. For a key in another account, the key role and every caller also need IAM policies in the project's account that allow the AWS KMS actions on the key. |
|
Yes, with a key |
The key role, an IAM role in the project's account. See Key role. Not allowed when |
|
No |
Accepted only as the get operation returns them. Another value is refused. |
|
No |
Ignored, so you can send back a get response unchanged. |
Any other field is refused with 400. Putting the configuration that the project already has changes nothing.
Both operations return the configuration. The put returns it as it is after the change. This response is for a project that is changing from the AWS owned key to a customer managed key:
{ "encryptionConfigurationArn": "arn:aws:bedrock:us-west-2:111122223333:project/proj_EXAMPLE/anthropic-encryption-configuration/default", "projectArn": "arn:aws:bedrock:us-west-2:111122223333:project/proj_EXAMPLE", "kmsKeyArn": null, "roleArn": null, "keySwitch": { "kmsKeyArn": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", "roleArn": "arn:aws:iam::111122223333:role/CmaKeyRole", "status": "IN_PROGRESS" } }
Field |
Description |
|---|---|
|
The configuration's ARN, which both IAM actions are evaluated on. |
|
The project's ARN. |
|
The key that protects the project's content now, or |
|
The key role used with |
|
Present only while the project's key is changing to another key. It has |
|
|
|
Present only when |
Checks before the configuration is saved
A put is refused before anything is saved if one of these checks fails. The service makes them in this order:
-
IAM allows
bedrock:PutAnthropicEncryptionConfigurationon the configuration's ARN. -
The project is not archived.
-
The body is valid.
-
When the project is on a customer managed key now, you can use that key, as every content request checks.
-
For a put that names a key, the key ARN is a key ARN of at most 2,048 characters in the project's Region, and the role is in the project's account, with a name of 1 to 64 characters and a path of at most 512.
-
For a put that names a key, IAM allows you
iam:PassRoleonroleArn, withbedrock.amazonaws.comasiam:PassedToServiceand the configuration's ARN asiam:AssociatedResourceArn. -
For a put that names a key, you can use it:
kms:DescribeKeyas you, to check that it is an enabled symmetric encryption key, then dry runs ofkms:Decryptandkms:GenerateDataKeywith the project's ARN in the encryption context. -
The project's state allows the change, and the key role can use the key. The service assumes the role and makes, as the role,
kms:DescribeKeyand dry runs ofkms:GenerateDataKeyWithoutPlaintext,kms:ReEncrypt, andkms:Decrypt, each with the project's ARN in the encryption context. For a key change, it also makes dry runs ofkms:Encrypt.
A put with kmsKeyArn set to null asks AWS KMS nothing about a new key. The dry runs return no key material.
Key role
The key role is an IAM role in the project's account that the service assumes to create and decrypt the project's data keys, including for work that continues after a request returns, such as a running turn. It has these requirements:
-
Trust policy. Trust the
bedrock.amazonaws.comservice principal, withaws:SourceAccountset to your account andaws:SourceArnset to the project's ARN. To use one key role for several projects, list each project's ARN inaws:SourceArn. -
Tag. Tag the role
ManagedAgentsKeyRole=enabled. -
Separate from session roles. Don't tag the key role
ManagedAgentsExecutionRole, and don't use it as a session role. Sessions that run as a key role fail. -
Permissions. The role needs no permissions policy when the key policy allows it
kms:DescribeKey,kms:Decrypt,kms:Encrypt,kms:GenerateDataKeyWithoutPlaintext,kms:ReEncryptFrom, andkms:ReEncryptTo.
{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": { "Service": "bedrock.amazonaws.com" }, "Action": "sts:AssumeRole", "Condition": { "StringEquals": { "aws:SourceAccount": "111122223333" }, "ArnEquals": { "aws:SourceArn": "arn:aws:bedrock:us-west-2:111122223333:project/proj_EXAMPLE" } } }] }
In AWS CloudTrail, the key role's sessions are named ClaudeManagedAgents-key-, and AWS STS records an project-idAssumeRole each time the service assumes the role.
Key policy and caller permissions
Use a symmetric encryption key (key spec SYMMETRIC_DEFAULT, key usage ENCRYPT_DECRYPT) in the project's Region. Add these statements to its key policy, next to your administrator statement. Name every role that calls the service in the project as a caller.
[ { "Sid": "AllowCallersToDescribeTheKeyThroughBedrock", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111122223333:role/AppRole" }, "Action": "kms:DescribeKey", "Resource": "*", "Condition": { "StringEquals": { "kms:ViaService": "bedrock.us-west-2.amazonaws.com", "kms:CallerAccount": "111122223333" } } }, { "Sid": "AllowCallersToUseTheKeyForTheProjectThroughBedrock", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111122223333:role/AppRole" }, "Action": ["kms:Decrypt", "kms:GenerateDataKey"], "Resource": "*", "Condition": { "StringEquals": { "kms:ViaService": "bedrock.us-west-2.amazonaws.com", "kms:CallerAccount": "111122223333", "kms:EncryptionContext:aws:bedrock:arn": "arn:aws:bedrock:us-west-2:111122223333:project/proj_EXAMPLE" } } }, { "Sid": "AllowTheKeyRoleToDescribeTheKey", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111122223333:role/CmaKeyRole" }, "Action": "kms:DescribeKey", "Resource": "*" }, { "Sid": "AllowTheKeyRoleToManageTheProjectsDataKeys", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111122223333:role/CmaKeyRole" }, "Action": [ "kms:Decrypt", "kms:Encrypt", "kms:GenerateDataKeyWithoutPlaintext", "kms:ReEncryptFrom", "kms:ReEncryptTo" ], "Resource": "*", "Condition": { "StringEquals": { "kms:EncryptionContext:aws:bedrock:arn": "arn:aws:bedrock:us-west-2:111122223333:project/proj_EXAMPLE" } } } ]
Every AWS KMS call that the service makes for a project, and every check of a caller's access, includes the project's ARN in the encryption context as aws:bedrock:arn, except kms:DescribeKey, which takes no encryption context. The kms:EncryptionContext:aws:bedrock:arn condition limits a statement to the projects that you name. To allow every project in the account, use StringLike with arn:aws:bedrock:us-west-2:111122223333:project/*. The service makes the caller statements' calls on the caller's behalf, so they use kms:ViaService. The key role makes its calls with its own credentials, so its statements don't.
The principal that sets the configuration needs bedrock:PutAnthropicEncryptionConfiguration, iam:PassRole on the key role with the encryption configuration's ARN as iam:AssociatedResourceArn, and the caller statements of the key policy. Every caller who uses the project's agents, sessions, or memory stores needs the caller statements too. Before each request that reads or writes the project's content, the service makes a kms:Decrypt dry run as the caller, and refuses the request with 403 if the key policy does not allow the caller. Removing one caller's access refuses that caller's next such request and leaves other callers unaffected. An event stream that is already open stays connected until the service closes it for a check, at most 15 minutes later. Deletes, AWS tags, and the encryption configuration operations are authorized by IAM and aren't checked against the key.
If you disable the key or schedule it for deletion, requests in the project are refused with 400 at once. If you change the key policy so that the key role can't use the key, requests are refused within 5 minutes, and if you remove the key role's trust policy or tag, within about 15 minutes. Running turns stop when their cached data key expires. Deletes, tag operations, and the encryption configuration operations keep working. Your content isn't moved to the AWS owned key. When you enable the key again or restore the access, the project's content is readable again. When AWS KMS rotates your key automatically, you don't need to change the encryption configuration.
Changing the key
You can change a project's key at any time. Before the project's first agent, session, or memory store, a put sets the key. After that, a put that names another key changes the project's key: the service re-encrypts the project's data keys under the new key in the background and returns at once, with keySwitch. A key change does not re-encrypt content, and the content stays readable throughout.
-
Keep both keys enabled and usable until a get returns no
keySwitch. The old key is also needed to restore a backup taken before the change. -
In a change between two of your keys, let the new key role use both keys.
-
A change onto a customer managed key needs the key policy to allow the key role
kms:Encrypt, which setting a key on a new project doesn't need. -
If
keySwitch.statusisFAILED, fix the cause thatfailureReasonnames, then put the same configuration again to resume the change. -
A put that names any other key while a change runs or has failed is refused with
409.
To go back to the AWS owned key, put {"kmsKeyArn": null}. This is also a key change, and the service needs your old key until it finishes.
Encryption configuration errors
Each refusal has the error body described in Errors and retries. In the messages, key-arn is the key's ARN and action is the AWS KMS action that was refused.
HTTP status |
Error type |
Message and cause |
|---|---|---|
|
|
The body is not valid: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IAM refused |
|
|
|
|
|
|
|
|
|
Self-hosted tool runner attachment
A session whose environment_id is the project's self-hosted ID runs its tools on a machine that you start the tool runner on. The tool runner connects out to the service and listens on no port. After you create the session, attach a tool runner to it:
POST /anthropic/v1/sessions/sesn_011CZkZB4mR3yMPDzynEDxu8/bedrock/attachment HTTP/1.1 Host: bedrock.us-west-2.amazonaws.com anthropic-version: 2023-06-01 anthropic-beta: managed-agents-2026-04-01 Content-Type: application/json
{ "workspace_directory": "/workspace" }
The body can be empty. workspace_directory is the absolute path where the file tools work and bash starts. The response is an activation, which you pass to the tool runner on its standard input. It includes session_id, environment_id, endpoint, region, service (bedrock), workspace, attachment_generation, and attachment_token. The attachment_token is shown only in this response, so keep it where the model's commands can't read it.
Each call attaches a new tool runner and makes any earlier activation stale: the earlier tool runner gets no more tool calls. Call it again to replace a tool runner, for example one whose credentials expired. Start one tool runner per activation. The caller needs bedrock:CreateAnthropicSessionAttachment on the session. The tool runner signs its connection with a role that needs only bedrock:CreateAnthropicSessionConnection on the session. A session on an AgentCore Runtime takes no attachment, because the service activates that tool runner itself.
Tags
Agents, memory stores, and sessions take AWS tags. IAM evaluates a resource's tags as aws:ResourceTag/ on the actions on it. Set tags on a create with a top-level keytags object, or later with the tag operations.
POST /anthropic/v1/sessions/sesn_011CZkZB4mR3yMPDzynEDxu8/tags HTTP/1.1 Host: bedrock.us-west-2.amazonaws.com anthropic-version: 2023-06-01 anthropic-beta: managed-agents-2026-04-01 Content-Type: application/json
{ "tags": { "team": "blue" } }
To remove tags, send POST / with type/{id}/untag{"tag_keys": ["team"]}. To read them, send GET /, which returns type/{id}/tags{"tags": {...}}. A key is 1 to 128 characters and a value at most 256. A request sets at most 200 tags, and a resource has at most 50. A key that begins with aws: is reserved. Two keys that differ only in letter case are refused.
The tag operations use the shared actions bedrock:TagResource, bedrock:UntagResource, and bedrock:ListTagsForResource, which bedrock:*Anthropic* does not grant. A create that sets tags also needs bedrock:TagResource on the new resource. Tags are not metadata: a get or a list never returns them. A session does not take its agent's tags. A change to a resource's tags can take up to 15 minutes to affect IAM decisions.
Use Anthropic's SDKs
Anthropic's SDKs support this API on Amazon Bedrock. To see the languages and get the SDKs, see SDKs, CLI, and librariesbedrock, and send the required headers for you. If you set a base URL, end it with /anthropic, because the SDK adds /v1/... to it. Leave AWS_BEARER_TOKEN_BEDROCK unset, so that the SDK signs with your IAM role credentials. The SDKs retry some failures by themselves, so read Retries before you use one for creates and event sends.
Errors and retries
Errors use Anthropic's error body, except a 413:
{ "type": "error", "error": { "type": "invalid_request_error", "message": "..." }, "request_id": "req_011CZkZ9X2dpNyB7HsEFoRfW" }
HTTP status |
What to check |
|---|---|
|
The message names the field. |
|
The signature: credentials, Region, service name |
|
The caller's IAM permissions, including |
|
The ID, the project in |
|
On a memory, |
|
The body is over 2 MiB. This response is plain text, not the error body. |
|
Too many requests, or the service is overloaded. Retry with backoff. |
|
Service or dependency failure. See the retry guidance that follows. |
A 403 or 404 on a resource says nothing about whether it exists in another account or project. Capture the error details and the x-amzn-requestid value when troubleshooting.
Follow these rules when you retry:
-
Retry reads with exponential backoff and jitter.
-
An error with
x-should-retry: truechanged nothing. Retry it afterretry-after-ms, or with backoff if it has none.x-should-retry: falsemeans do not retry it as it is. -
A
503, a529, and a500with the messageoverloaded, shedding loadchanged nothing. Retry them. -
Do not retry a
500fromPOST /sessions/{id}/eventsautomatically. The events may be stored. List the session's events before you send them again. -
Do not retry a create whose response you lost. Creates are not idempotent, so list agents or sessions first.
-
Anthropic's SDKs retry
5xx,408,409, and429responses, and dropped connections, on their own. Turn their retries off for creates and sends, or check before you resend.