Skip to main content

Prerequisites

  • An AWS account with Amazon Bedrock enabled in your region.
  • Model access granted in the Bedrock Console — some models require explicit approval.
  • AWS credentials configured (see Authentication below).

Configuration

models:
  bedrock-claude:
    provider: amazon-bedrock
    model: global.anthropic.claude-sonnet-4-5-20250929-v1:0
    max_tokens: 64000
    provider_opts:
      region: us-east-1

agents:
  root:
    model: bedrock-claude
    description: Assistant using Claude via Bedrock
    instruction: You are a helpful assistant.

Authentication

The simplest option. Generate a Bedrock API key in the AWS console and set:
export AWS_BEARER_TOKEN_BEDROCK="your-key"
models:
  bedrock:
    provider: amazon-bedrock
    model: global.anthropic.claude-sonnet-4-5-20250929-v1:0
    token_key: AWS_BEARER_TOKEN_BEDROCK
    provider_opts:
      region: us-east-1

Provider options

OptionTypeDefaultDescription
regionstringus-east-1AWS region
profilestringAWS profile name
role_arnstringIAM role ARN for assume role
role_session_namestringdocker-agent-bedrock-sessionSession name for assumed role
external_idstringExternal ID for role assumption
endpoint_urlstringCustom endpoint (VPC or testing)
interleaved_thinkingbooltrueReasoning during tool calls (Claude models)
disable_prompt_cachingboolfalseDisable automatic prompt caching

Inference profiles

Prepend a regional prefix to model IDs for optimized routing and compliance:
PrefixRoutes to
global.All commercial AWS regions (recommended)
us.US regions only
eu.EU regions only (GDPR compliance)
models:
  bedrock:
    provider: amazon-bedrock
    model: global.anthropic.claude-sonnet-4-5-20250929-v1:0  # cross-region routing
Use the global. prefix for automatic cross-region routing and higher availability. Use eu. for GDPR-compliant deployments.

Thinking budget

Claude models on Bedrock support extended thinking with a token budget:
models:
  bedrock-claude:
    provider: amazon-bedrock
    model: global.anthropic.claude-opus-4-5-20251101-v1:0
    max_tokens: 64000
    thinking_budget: 32000
    provider_opts:
      region: eu-west-1
      interleaved_thinking: true

Prompt caching

Prompt caching is automatically enabled for supported Claude models on Bedrock. System prompts, tool definitions, and recent messages are cached with a 5-minute TTL to reduce latency and cost.
provider_opts:
  disable_prompt_caching: true  # disable if needed

Example: PR reviewer

agents:
  root:
    model: bedrock-claude
    description: PR review coordinator
    instruction: |
      You are a PR review coordinator. Review the code changes and
      provide a structured, actionable report.
    toolsets:
      - type: filesystem
      - type: shell

models:
  bedrock-claude:
    provider: amazon-bedrock
    model: global.anthropic.claude-opus-4-5-20251101-v1:0
    max_tokens: 64000
    thinking_budget: 32000
    provider_opts:
      region: eu-west-1
      profile: bedrock1
      interleaved_thinking: true

Build docs developers (and LLMs) love