Skip to content

chore(bedrock): update default model to Claude Sonnet 4.6#2131

Open
minorun365 wants to merge 1 commit intostrands-agents:mainfrom
minorun365:chore/default-model-sonnet-4-6
Open

chore(bedrock): update default model to Claude Sonnet 4.6#2131
minorun365 wants to merge 1 commit intostrands-agents:mainfrom
minorun365:chore/default-model-sonnet-4-6

Conversation

@minorun365
Copy link
Copy Markdown
Contributor

Motivation

Claude Sonnet 4 (claude-sonnet-4-20250514) was deprecated on April 14, 2026 and will be retired on June 15, 2026 per Anthropic's model deprecations page. Since DEFAULT_BEDROCK_MODEL_ID is the model used when no explicit model_id is passed, this is a critical update — agents using the default will stop working after the retirement date.

This change also switches from region-specific inference profiles (us./eu./apac.) to the global. cross-region inference profile, aligning with the TypeScript SDK which already uses global.anthropic.claude-sonnet-4-6. This simplification aligns with two of our Development Tenets:

  • Simple at any scale — The region-to-prefix mapping logic (_get_default_model_with_warning) was necessary when apac. profiles existed, but Claude Sonnet 4.6 no longer offers an apac. profile (APAC regions have been split into jp. and au., with other APAC regions only supporting global.). The global. profile works across all Bedrock regions, making the mapping logic unnecessary.
  • Embrace common standards — The TypeScript SDK already adopted global. as the default. Using the same approach ensures consistency across SDKs and reduces cognitive overhead for developers working with both.

Resolves: #2130

Public API Changes

DEFAULT_BEDROCK_MODEL_ID changes from us.anthropic.claude-sonnet-4-20250514-v1:0 to global.anthropic.claude-sonnet-4-6:

# Before
from strands import Agent
agent = Agent()  # uses us.anthropic.claude-sonnet-4-20250514-v1:0

# After
from strands import Agent
agent = Agent()  # uses global.anthropic.claude-sonnet-4-6

The internal _DEFAULT_BEDROCK_MODEL_ID template and _get_default_model_with_warning() static method have been removed as they are no longer needed with the global. profile.

Breaking Changes

Users must enable Claude Sonnet 4.6 model access in their AWS Bedrock console. The global.anthropic.claude-sonnet-4-6 cross-region inference profile must be accessible from the user's configured region.

Migration

Users relying on the previous default need no code changes — only Bedrock model access enablement. Users who want to continue using Sonnet 4 (until retirement) can explicitly pass the model ID:

from strands import Agent
from strands.models import BedrockModel

agent = Agent(model=BedrockModel(model_id="us.anthropic.claude-sonnet-4-20250514-v1:0"))

Related Issues

#2130

Type of Change

Breaking change

Testing

  • All unit tests pass (hatch test — 235 passed)
  • Formatter and linter pass (hatch fmt --formatter, hatch fmt --linter)
  • Verified real Bedrock API calls succeed with global.anthropic.claude-sonnet-4-6 from us-east-1 and ap-northeast-1

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@minorun365 minorun365 force-pushed the chore/default-model-sonnet-4-6 branch from 0922c0e to a38be2c Compare April 17, 2026 10:34
@github-actions github-actions Bot added size/m and removed size/m labels Apr 17, 2026
poshinchen
poshinchen previously approved these changes Apr 17, 2026
@minorun365
Copy link
Copy Markdown
Contributor Author

@poshinchen
Hi could you tell me when this PR will be merged? Because it affects contents of the book and the deadline is the next week. Thanks 🙏

mehtarac
mehtarac previously approved these changes Apr 23, 2026
@poshinchen
Copy link
Copy Markdown
Contributor

Hi @minorun365 could you update the PR to resolve the conflict? then I can approve and merge!

BREAKING CHANGE: The default Bedrock model has been updated from
`us.anthropic.claude-sonnet-4-20250514-v1:0` (Claude Sonnet 4) to
`global.anthropic.claude-sonnet-4-6` (Claude Sonnet 4.6).

Claude Sonnet 4 was deprecated on April 14, 2026 and will be retired
on June 15, 2026 per Anthropic's model deprecations page.

This change also switches from region-specific inference profiles
(us./eu./apac.) to the global cross-region inference profile
(global.), aligning with the TypeScript SDK implementation. The
global profile is available in all Bedrock regions and eliminates the
need for region-to-prefix mapping logic.

Users who have not enabled Claude Sonnet 4.6 in their Bedrock model
access settings will need to do so, or explicitly pass a model_id.

Closes strands-agents#2130
@minorun365 minorun365 dismissed stale reviews from mehtarac and poshinchen via 0869d67 April 23, 2026 14:30
@minorun365 minorun365 force-pushed the chore/default-model-sonnet-4-6 branch from a38be2c to 0869d67 Compare April 23, 2026 14:30
@minorun365
Copy link
Copy Markdown
Contributor Author

@poshinchen Rebased onto latest main and resolved conflicts. PTAL 🙏

Conflict resolution summary:

  • feat: add context_window_limit to model configs #2176 (BaseModelConfig) — Accepted main side. BedrockConfig now inherits from BaseModelConfig and the import is updated accordingly.

  • chore(log): added warning for default model awareness and is subject to change #2164 (default-model warning) — Preserved the warning behavior. The _get_default_model_with_warning() helper was no longer needed (the global. profile removes the region-to-prefix mapping), so the warning is now emitted directly from BedrockModel.__init__ whenever model_id resolves to DEFAULT_BEDROCK_MODEL_ID:

    if self.config.get("model_id") == DEFAULT_BEDROCK_MODEL_ID:
        warnings.warn(
            f"You're using default model '{DEFAULT_BEDROCK_MODEL_ID}', which is subject to change. "
            "Specify a model explicitly to pin the model target.",
            stacklevel=2,
        )

    Two tests (test_init_with_default_model_warns_subject_to_change / test_init_with_custom_model_id_no_default_warning) were added to cover the new warning location.

All bedrock unit tests pass locally (hatch test tests/strands/models/test_bedrock.py → 122 passed). Looking forward to your re-review! 🚀

@poshinchen
Copy link
Copy Markdown
Contributor

Oh wait I thought that it was another PR...

So, due to security reason, we would like to set the default region to us. prefix. And the reason why the validation exists is due to the fact that user can overwrite the default model via environment variables.

I think the minimum change would be to just update the model_id.

@minorun365
Copy link
Copy Markdown
Contributor Author

@poshinchen thanks for the clarification — I now understand the security-driven preference for keeping us. as the validated default. I want to share the regional-availability facts that shape the options here, because I don't think the minimum "just bump the model ID" path works for Sonnet 4.6.

Why simply updating to us.anthropic.claude-sonnet-4-6 is problematic

Per the AWS docs 1, Sonnet 4.6 ships with a different set of geo inference profiles than Sonnet 4 did:

prefix Sonnet 4 (current default) Sonnet 4.6
us.* ✅ (us-east/west + ca)
eu.*
apac.* ❌ removed
au.* ✅ (only ap-southeast-2/4/6)
global.* ✅ (all commercial regions)

The current _get_default_model_with_warning relies on the apac.* prefix existing. With 4.6, APAC regions outside Australia/NZ (Tokyo, Seoul, Singapore, Mumbai, etc.) have no geo profile at all — only global.*. So keeping us. as the hard-coded default means any user in those regions gets a cross-geography routing error before IAM is even evaluated.

Options I see

  1. us.anthropic.claude-sonnet-4-6 + keep the validation logic
    Simplest code diff but silently breaks for Tokyo/Seoul/Singapore/Mumbai/etc. users — they'd need to explicitly set a model_id just to get the SDK to work. Not ideal for a "sensible default."
  2. Downgrade default to Sonnet 4.5 (us.anthropic.claude-sonnet-4-5-20250929-v1:0)
    Sonnet 4.5 still has apac.*, so the existing region-to-prefix mapping keeps working unchanged. This buys time but pushes the problem one model generation out — Sonnet 4.7 is likely to follow 4.6's pattern (no apac.*), so we'd revisit this the next time the default gets bumped.
  3. global.anthropic.claude-sonnet-4-6 (this PR)
    Works from every Bedrock commercial region out of the box, aligns with what the TypeScript SDK already defaults to, and removes the mapping logic because global.* needs none. The security concern is real but it applies to the default value; users who must stay within a specific geography can explicitly set model_id="us.anthropic.claude-sonnet-4-6" (or pin via env var as today). We could keep a warning that encourages explicit pinning in compliance-sensitive environments.

If the security posture requires staying with us. for the default, option 2 (Sonnet 4.5) looks like the only path that keeps the SDK usable everywhere without breaking APAC users. Option 3 is my preference because it matches the TS SDK and future-proofs against further APAC profile churn, but I understand if the security argument outweighs that.

Happy to update the PR to whichever direction you prefer. What's your read?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] DEFAULT Bedrock Model Still Claude Sonnet 4

3 participants