[BUG] Invalid security token error when running Claude Code with AWS Bedrock and credentials from SSO Profile

Resolved 💬 8 comments Opened Jul 23, 2025 by viktorChekhovoi Closed Jan 6, 2026

Environment

  • Platform (select one):
  • [ ] Anthropic API
  • [x] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.58
  • Operating System: macOS 15.5
  • Terminal: iTerm2

Bug Description

Anthropic documentation on configuring Claude Code with AWS Bedrock states that it supports setting up credentials via AWS SSO. However, when obtaining credentials in this way and running claude, any request made returns the error "API Error (403 The security token included in the request is invalid.)". At the same time, exporting the credentials into environment variables via aws configure export-credentials --profile PROFILE_NAME --format env and unsetting the AWS_PROFILE environment variable allows requests to go through.

Steps to Reproduce

  1. run export AWS_PROFILE=your-profile-name, followed by aws sso login
  2. run claude and submit any request

Expected Behavior

Claude Code uses the AWS Bedrock model to complete the request

Actual Behavior

Claude Code returned error "API Error (403 The security token included in the request is invalid.)"

View original on GitHub ↗

This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗