Skip to content

fix(bedrock): answer 401 instead of 500 when AWS SSO or profile credentials are unusable - #53362

Merged
ryan-crabbe-berri merged 12 commits into
mainfrom
litellm_bedrock_sso_auth_error
Nov 23, 2026
Merged

ryan-crabbe-berri merged 12 commits into
mainfrom
litellm_bedrock_sso_auth_error

Conversation

@ryan-crabbe-berri

@ryan-crabbe-berri ryan-crabbe-berri commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Handwritten 1-3 sentence description

When I call Bedrock or Bedrock Mantle with an expired AWS SSO login or a missing profile, the request fails while the gateway is signing it with AWS credentials. That used to come back as a 500 that clients keep retrying, and now it comes back as a 401 that says the login is the problem.

Details

TLDR

  • When your AWS SSO login runs out, Bedrock calls used to fail with a 500.
  • A 500 looks like a server hiccup, so apps and the gateway retry it again and again.
  • Now the same failure comes back as a 401, which tells callers their login is the problem.
  • This covers Bedrock and Bedrock Mantle on chat, streaming, /v1/messages, /v1/responses and embeddings.

Intentional product change: an expired SSO login or a missing AWS profile now answers 401 (403 when aws login lacks permission). Like any other provider's 401, it is no longer retried and the router cools that deployment down for 5 seconds, unless the bad credential came from the caller's own AWS fields, which #53431 keeps off the shared deployment. SDK callers of litellm.anthropic.messages on Bedrock used to get the raw botocore error there and now get litellm.AuthenticationError, with the botocore error kept as its context.

User Flow

Before: a developer whose AWS SSO session expired gets a 500 that looks like a LiteLLM bug, so their client keeps retrying

  1. Their proxy deployment uses aws_profile_name pointing at an SSO profile whose token has expired
  2. They send POST http://localhost:4000/v1/chat/completions (or /v1/messages, /v1/responses, /v1/embeddings)
  3. They get HTTP 500 litellm.APIConnectionError: Error when retrieving token from sso: Token has expired and refresh failed

After: the same request answers 401, so the client stops retrying and the developer knows to run aws sso login

  1. Same deployment, same expired SSO profile
  2. They send the same POST http://localhost:4000/v1/chat/completions
  3. They get HTTP 401 authentication_error with the same botocore message about the expired token

Relevant issues

Fixes #52453

Pre-Submission checklist

  • I have added meaningful tests
  • The handful of test files covering my change pass locally
  • My PR passes all required CI/CD checks
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • Every automated review on my PR's latest commit has finished, and I have addressed or replied to each of its findings before requesting a maintainer review

Screenshots / Proof of Fix

Shared setup. Both legs ran the same way from a clean copy of each commit, with two workers and one dedicated Redis. A test HOME holds three broken AWS profiles (an sso_session profile whose cached token expired in 2020, a legacy SSO profile with an expired token, and a profile name that does not exist) next to a real working SSO profile. Each broken call waits 6 seconds so the router's 5 second cooldown from the previous 401 does not mask the next endpoint's answer.

Proxy command, config, and client script
redis-server --port 47391 --save '' --appendonly no --daemonize yes
env -u DATABASE_URL HOME=$QA_HOME AWS_CONFIG_FILE=$QA_HOME/.aws/config AWS_SHARED_CREDENTIALS_FILE=/dev/null \
  RUST_MIN_STACK=16777216 PYTHONPATH=$PWD \
  python litellm/proxy/proxy_cli.py --config qa_config.yaml --port 47390 --num_workers 2 --detailed_debug --reload --use_v2_migration_resolver

$QA_HOME/.aws/config adds these profiles (the expired token cache files sit in $QA_HOME/.aws/sso/cache, expiresAt: 2020-01-01T00:00:00Z)

[profile expired-sso]
sso_session = expired-session
sso_account_id = 111111111111
sso_role_name = Dev
region = us-west-2

[sso-session expired-session]
sso_start_url = https://example.awsapps.com/start
sso_region = us-west-2
sso_registration_scopes = sso:account:access

[profile legacy-sso]
sso_start_url = https://example.awsapps.com/start
sso_region = us-west-2
sso_account_id = 111111111111
sso_role_name = Dev
region = us-west-2
model_list:
  - model_name: bedrock-good
    litellm_params: {model: bedrock/us.anthropic.claude-haiku-5-5, aws_profile_name: <working SSO profile>, aws_region_name: us-west-2}
  - model_name: bedrock-expired-sso
    litellm_params: {model: bedrock/us.anthropic.claude-haiku-5-5, aws_profile_name: expired-sso, aws_region_name: us-west-2}
  - model_name: bedrock-legacy-sso
    litellm_params: {model: bedrock/us.anthropic.claude-haiku-5-5, aws_profile_name: legacy-sso, aws_region_name: us-west-2}
  - model_name: bedrock-missing-profile
    litellm_params: {model: bedrock/us.anthropic.claude-haiku-5-5, aws_profile_name: missing-profile, aws_region_name: us-west-2}
  - model_name: titan-good
    litellm_params: {model: bedrock/amazon.titan-embed-text-v2:0, aws_profile_name: <working SSO profile>, aws_region_name: us-west-2}
  - model_name: titan-expired-sso
    litellm_params: {model: bedrock/amazon.titan-embed-text-v2:0, aws_profile_name: expired-sso, aws_region_name: us-west-2}
router_settings: {redis_host: 127.0.0.1, redis_port: 47391}
general_settings:
  master_key: os.environ/LITELLM_MASTER_KEY
  coordination_redis: {host: 127.0.0.1, port: 47391}
litellm_settings: {num_retries: 0}

Each case is one curl per endpoint, for example

curl -s localhost:47390/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" \
  -d '{"model":"bedrock-expired-sso","max_tokens":10,"stream":true,"messages":[{"role":"user","content":"say hi"}]}'
curl -s localhost:47390/v1/messages ... -d '{"model":"bedrock-expired-sso","max_tokens":10,"messages":[{"role":"user","content":"say hi"}]}'
curl -s localhost:47390/v1/responses ... -d '{"model":"bedrock-expired-sso","max_output_tokens":16,"input":"say hi"}'
curl -s localhost:47390/v1/embeddings ... -d '{"model":"titan-expired-sso","input":"hello"}'

Before (c3c6f71)

Every endpoint answers 500 for every broken profile. The working profile answers 200 everywhere.

## bedrock-good
chat          200 | chat.completion
chat stream   200 | data: {... "object":"chat.completion.chunk" ...}
messages      200 | {"type": "message", ...}
msgs stream   200 | event: message_start ...
responses     200 | {"id": "resp_...", ...}
resp stream   200 | event: response.created ...
## bedrock-expired-sso
chat          500 internal_server_error | litellm.APIConnectionError: Error when retrieving token from sso: Token has expired and refresh failed
chat stream   500 internal_server_error | litellm.APIConnectionError: Error when retrieving token from sso: Token has expired and refresh failed
messages      500 api_error | Error when retrieving token from sso: Token has expired and refresh failed
msgs stream   500 api_error | Error when retrieving token from sso: Token has expired and refresh failed
responses     500 internal_server_error | litellm.APIConnectionError: Error when retrieving token from sso: Token has expired and refresh failed
resp stream   500 internal_server_error | litellm.APIConnectionError: Error when retrieving token from sso: Token has expired and refresh failed
## bedrock-legacy-sso
chat          500 internal_server_error | litellm.APIConnectionError: The SSO session associated with this profile has expired or is otherwise invalid...
chat stream   500 internal_server_error | (same)
messages      500 api_error | The SSO session associated with this profile has expired or is otherwise invalid...
msgs stream   500 api_error | (same)
responses     500 internal_server_error | (same)
resp stream   500 internal_server_error | (same)
## bedrock-missing-profile
chat          500 internal_server_error | litellm.APIConnectionError: The config profile (missing-profile) could not be found
chat stream   500 internal_server_error | (same)
messages      500 api_error | The config profile (missing-profile) could not be found
msgs stream   500 api_error | (same)
responses     500 internal_server_error | (same)
resp stream   500 internal_server_error | (same)
## titan-good embeddings  200 | {"data": [{"embedding": [...]}]}
## titan-expired-sso embeddings  500 internal_server_error | litellm.APIConnectionError: Error when retrieving token from sso: Token has expired and refresh failed

After (8c933d5)

Every broken profile answers 401 on every endpoint, with botocore's own message. The working profile's SSO session had expired by this run, so it also answers 401 here (the first call, then 429 while that deployment cools down, since bedrock-good calls skip the 6 second gap).

## bedrock-expired-sso
chat          401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - Error when retrieving token from sso: Token has expired and refresh failed
chat stream   401 authentication_error | (same)
messages      401 authentication_error | (same)
msgs stream   401 authentication_error | (same)
responses     401 authentication_error | (same)
resp stream   401 authentication_error | (same)
## bedrock-legacy-sso
chat          401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - The SSO session associated with this profile has expired or is otherwise invalid...
chat stream   401 authentication_error | (same)
messages      401 authentication_error | (same)
msgs stream   401 authentication_error | (same)
responses     401 authentication_error | (same)
resp stream   401 authentication_error | (same)
## bedrock-missing-profile
chat          401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - The config profile (missing-profile) could not be found
chat stream   401 authentication_error | (same)
messages      401 authentication_error | (same)
msgs stream   401 authentication_error | (same)
responses     401 authentication_error | (same)
resp stream   401 authentication_error | (same)
## titan-expired-sso embeddings  401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - Error when retrieving token from sso: Token has expired and refresh failed
## titan-good embeddings  401 authentication_error | (real SSO session expired) Error when retrieving token from sso: Token has expired and refresh failed

The happy path was checked at e5dbf4a, before the real SSO session ran out, and every endpoint still answered 200 with the fix in place. The commits after it only touch the error path (Mantle's credential errors, a merge of main, and tests). The Mantle outage changes at d939f12 and 92cbd08 only affect the credential source outage path, which the guard tests below cover.

## bedrock-good
chat          200 | chat.completion
chat stream   200 | data: {... "object":"chat.completion.chunk" ...}
messages      200 | {"type": "message", ...}
msgs stream   200 | event: message_start ...
responses     200 | {"id": "resp_...", ...}
resp stream   200 | event: response.created ...
## titan-good embeddings  200 | {"data": [{"embedding": [...]}]}

The tip ff9ad03 adds two things on top of 92cbd08. It merges main (including #53431), and it keeps a credential outage on the bedrock/mantle/... /v1/messages route retryable, which the new guard test covers. Neither changes the cases shown above. The touched unit tests pass at the tip apart from tests that also fail on main.

/v1/messages on every Bedrock route, before (dd86656, the merge base) and after (ff9ad03)

Same rig, with bedrock/invoke/..., bedrock/mantle/... and bedrock_mantle/... deployments for each broken profile. The outage rows use deployments with no profile, an empty AWS_CONFIG_FILE, and AWS_CONTAINER_CREDENTIALS_FULL_URI pointed at a local server that answers 503, so the only credential source is down.

Config for this run
model_list:
  - model_name: invoke-expired-sso
    litellm_params: {model: bedrock/invoke/us.anthropic.claude-haiku-5-5, aws_profile_name: expired-sso, aws_region_name: us-west-2}
  # same for legacy-sso and missing-profile
  - model_name: mantle-route-expired-sso
    litellm_params: {model: bedrock/mantle/anthropic.claude-sonnet-5-5, aws_profile_name: expired-sso, aws_region_name: us-east-1}
  # same for legacy-sso and missing-profile
  - model_name: mantle-expired-sso
    litellm_params: {model: bedrock_mantle/anthropic.claude-sonnet-5-5, aws_profile_name: expired-sso, aws_region_name: us-east-1}
  # same for legacy-sso and missing-profile
  - model_name: invoke-default-chain
    litellm_params: {model: bedrock/invoke/us.anthropic.claude-haiku-5-5, aws_region_name: us-west-2}
  - model_name: mantle-route-default-chain
    litellm_params: {model: bedrock/mantle/anthropic.claude-sonnet-5-5, aws_region_name: us-east-1}
  - model_name: mantle-default-chain
    litellm_params: {model: bedrock_mantle/anthropic.claude-sonnet-5-5, aws_region_name: us-east-1}
curl -s localhost:$PORT/v1/messages -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" \
  -d '{"model":"<model>","max_tokens":10,"stream":<false|true>,"messages":[{"role":"user","content":"hi"}]}'

Before (dd86656)

invoke-expired-sso             stream=false 500 api_error | Error when retrieving token from sso: Token has expired and refresh failed
invoke-expired-sso             stream=true  500 api_error | Error when retrieving token from sso: Token has expired and refresh failed
invoke-legacy-sso              stream=false 500 api_error | The SSO session associated with this profile has expired or is otherwise invalid. To refresh this SSO session
invoke-legacy-sso              stream=true  500 api_error | The SSO session associated with this profile has expired or is otherwise invalid. To refresh this SSO session
invoke-missing-profile         stream=false 500 api_error | The config profile (missing-profile) could not be found
invoke-missing-profile         stream=true  500 api_error | The config profile (missing-profile) could not be found
mantle-route-expired-sso       stream=false 500 api_error | Unable to locate credentials
mantle-route-expired-sso       stream=true  500 api_error | Unable to locate credentials
mantle-route-legacy-sso        stream=false 500 api_error | Unable to locate credentials
mantle-route-legacy-sso        stream=true  500 api_error | Unable to locate credentials
mantle-route-missing-profile   stream=false 500 api_error | The config profile (missing-profile) could not be found
mantle-route-missing-profile   stream=true  500 api_error | The config profile (missing-profile) could not be found
mantle-expired-sso             stream=false 500 api_error | Bedrock Mantle auth failed: no Bearer token and no usable AWS credentials. Set BEDROCK_MANTLE_API_KEY (or AWS_
mantle-expired-sso             stream=true  500 api_error | Bedrock Mantle auth failed: no Bearer token and no usable AWS credentials. Set BEDROCK_MANTLE_API_KEY (or AWS_
mantle-legacy-sso              stream=false 500 api_error | Bedrock Mantle auth failed: no Bearer token and no usable AWS credentials. Set BEDROCK_MANTLE_API_KEY (or AWS_
mantle-legacy-sso              stream=true  500 api_error | Bedrock Mantle auth failed: no Bearer token and no usable AWS credentials. Set BEDROCK_MANTLE_API_KEY (or AWS_
mantle-missing-profile         stream=false 500 api_error | Bedrock Mantle auth failed: no Bearer token and no usable AWS credentials. Set BEDROCK_MANTLE_API_KEY (or AWS_
mantle-missing-profile         stream=true  500 api_error | Bedrock Mantle auth failed: no Bearer token and no usable AWS credentials. Set BEDROCK_MANTLE_API_KEY (or AWS_

After (ff9ad03)

invoke-expired-sso             stream=false 401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - Error when retrieving token from sso: T
invoke-expired-sso             stream=true  401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - Error when retrieving token from sso: T
invoke-legacy-sso              stream=false 401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - The SSO session associated with this pr
invoke-legacy-sso              stream=true  401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - The SSO session associated with this pr
invoke-missing-profile         stream=false 401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - The config profile (missing-profile) co
invoke-missing-profile         stream=true  401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - The config profile (missing-profile) co
mantle-route-expired-sso       stream=false 401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - Error when retrieving token from sso: T
mantle-route-expired-sso       stream=true  401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - Error when retrieving token from sso: T
mantle-route-legacy-sso        stream=false 401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - The SSO session associated with this pr
mantle-route-legacy-sso        stream=true  401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - The SSO session associated with this pr
mantle-route-missing-profile   stream=false 401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - The config profile (missing-profile) co
mantle-route-missing-profile   stream=true  401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - The config profile (missing-profile) co
mantle-expired-sso             stream=false 401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - Error when retrieving token from sso: T
mantle-expired-sso             stream=true  401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - Error when retrieving token from sso: T
mantle-legacy-sso              stream=false 401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - The SSO session associated with this pr
mantle-legacy-sso              stream=true  401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - The SSO session associated with this pr
mantle-missing-profile         stream=false 401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - Bedrock Mantle auth failed: no Bearer t
mantle-missing-profile         stream=true  401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - Bedrock Mantle auth failed: no Bearer t

Credential source outage, before (dd86656)

invoke-default-chain           stream=false 500 api_error | Error when retrieving credentials from container-role: Error retrieving metadata: Received non 200 response 50
invoke-default-chain           stream=true  500 api_error | Error when retrieving credentials from container-role: Error retrieving metadata: Received non 200 response 50
mantle-route-default-chain     stream=false 500 api_error | Unable to locate credentials
mantle-route-default-chain     stream=true  500 api_error | Unable to locate credentials
mantle-default-chain           stream=false 500 api_error | Bedrock Mantle auth failed: no Bearer token and no usable AWS credentials. Set BEDROCK_MANTLE_API_KEY (or AWS_
mantle-default-chain           stream=true  500 api_error | Bedrock Mantle auth failed: no Bearer token and no usable AWS credentials. Set BEDROCK_MANTLE_API_KEY (or AWS_

Credential source outage, after (ff9ad03), every row still a retryable 500

invoke-default-chain           stream=false 500 api_error | Error when retrieving credentials from container-role: Error retrieving metadata: Received non 200 response 50
invoke-default-chain           stream=true  500 api_error | Error when retrieving credentials from container-role: Error retrieving metadata: Received non 200 response 50
mantle-route-default-chain     stream=false 500 api_error | Error when retrieving credentials from container-role: Error retrieving metadata: Received non 200 response 50
mantle-route-default-chain     stream=true  500 api_error | Error when retrieving credentials from container-role: Error retrieving metadata: Received non 200 response 50
mantle-default-chain           stream=false 500 api_error | Bedrock Mantle auth failed: no Bearer token and no usable AWS credentials. Set BEDROCK_MANTLE_API_KEY (or AWS_
mantle-default-chain           stream=true  500 api_error | Bedrock Mantle auth failed: no Bearer token and no usable AWS credentials. Set BEDROCK_MANTLE_API_KEY (or AWS_

Bedrock Mantle

Same rig with these deployments, bedrock_mantle/openai.gpt-6-sol for chat and Responses and bedrock_mantle/anthropic.claude-sonnet-5-5 for /v1/messages, each pointed at missing-profile and at expired-sso, aws_region_name: us-east-1.

Before (c3c6f71)

chat      mantle-gpt-missing-profile 500 internal_server_error | litellm.APIConnectionError: Bedrock Mantle auth failed: no Bearer token and no usable AWS credentials...
chat strm mantle-gpt-missing-profile 500 internal_server_error | (same)
responses mantle-gpt-missing-profile 500 internal_server_error | (same)
resp strm mantle-gpt-missing-profile 500 internal_server_error | (same)
messages  mantle-claude-missing-profile 500 api_error | Bedrock Mantle auth failed: no Bearer token and no usable AWS credentials...
msgs strm mantle-claude-missing-profile 500 api_error | (same)
chat      mantle-gpt-expired-sso 500 internal_server_error | litellm.APIConnectionError: Error when retrieving token from sso: Token has expired and refresh failed
chat strm mantle-gpt-expired-sso 500 internal_server_error | (same)
responses mantle-gpt-expired-sso 500 internal_server_error | (same)
resp strm mantle-gpt-expired-sso 500 internal_server_error | (same)
messages  mantle-claude-expired-sso 500 api_error | Bedrock Mantle auth failed: no Bearer token and no usable AWS credentials...
msgs strm mantle-claude-expired-sso 500 api_error | (same)

After (92cbd08)

chat      mantle-gpt-missing-profile 401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - Bedrock Mantle auth failed: no Bearer token and n...
chat strm mantle-gpt-missing-profile 401 authentication_error | (same)
responses mantle-gpt-missing-profile 401 authentication_error | (same)
resp strm mantle-gpt-missing-profile 401 authentication_error | (same)
messages  mantle-claude-missing-profile 401 authentication_error | (same)
msgs strm mantle-claude-missing-profile 401 authentication_error | (same)
chat      mantle-gpt-expired-sso 401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - Error when retrieving token from sso: Token has e...
chat strm mantle-gpt-expired-sso 401 authentication_error | (same)
responses mantle-gpt-expired-sso 401 authentication_error | (same)
resp strm mantle-gpt-expired-sso 401 authentication_error | (same)
messages  mantle-claude-expired-sso 401 authentication_error | litellm.AuthenticationError: BedrockException Invalid Authentication - Error when retrieving token from sso: Token has e...
msgs strm mantle-claude-expired-sso 401 authentication_error | (same)

A working Mantle call was not run, because the only SSO session on this machine had expired by then.

Tests

Test At base (c3c6f71) At the tip (92cbd08)
Each botocore credential error (expired SSO token, SSO session invalid, SSO token missing, aws login refresh required, partial keys, missing profile) answers 401 on bedrock and bedrock_mantle red (12 of 14 cases) green
aws login without permission answers 403 red green
A credential source outage stays a retryable 500 green (guard) green
SDK chat, chat stream, embeddings, messages and responses with a logged-out SSO profile answer 401 red green
/v1/messages on the Rust path with a logged-out SSO profile answers 401 red green
SDK Mantle chat and responses with no usable AWS credentials answer 401 red green
Mantle's own credential error answers 401 new error type green
A Mantle credential source outage stays a retryable 500 (chat, and /v1/messages on the Rust path) green (guard) green
A credential source outage on the bedrock/mantle/... /v1/messages route stays retryable green (guard) green
/v1/messages on Mantle with an SSO profile that has no usable token answers 401 red green
/v1/messages on Mantle with no usable credentials answers 401 red green

Type

🐛 Bug Fix

Caveats (if any)

Medium

  • count_tokens and batches never map provider errors at all, follow-up
  • On Mantle /v1/messages, a credential failure Rust cannot name reruns Python signing inline
    • during a credential service outage that blocks the worker while botocore retries
    • Bedrock invoke already does the same replay, follow-up is for Rust to name each failure

Low

  • CredentialRetrievalError stays a 500 on purpose
    • botocore raises it when the metadata or container endpoint is down, which is worth retrying
    • this holds on Mantle too
    • a credential_process helper whose session expired raises it too, so those users still see a 500
  • A profile that needs MFA or has broken SSO keys still answers 500, rare and left alone
  • SageMaker shares the AWS signing and has the same gap, follow-up
  • One /v1/messages outage guard test runs an in-process HTTP server on 127.0.0.1, as other tests in that file do
  • The happy path after the fix was captured before the real SSO session expired, then that same profile showed the fixed 401

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

@ryan-crabbe-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@veria-ai

veria-ai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

PR overview

All previously flagged issues have been addressed. No open security concerns remain on this pull request.

Fixed/addressed: 1 · PR risk: 0/10

Reviews

@greptile-apps

greptile-apps Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge, with no new actionable findings.

Summary

Bedrock and Mantle now return authentication errors for unusable AWS credentials while keeping credential-source outages retryable.

  • Bedrock login failures now return authentication errors instead of server errors.
  • Rust-backed messages calls now map Bedrock credential failures to public auth errors.

Reviews (9) · Last reviewed commit: "fix(bedrock): keep a Mantle-route messag..." · Reviewed by Greptile

@ryan-crabbe-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

…uth_error

# Conflicts:
#	tests/unit/rust_bridge/host/routes/test_messages.py
@ryan-crabbe-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@ryan-crabbe-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@ryan-crabbe-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@ryan-crabbe-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@ryan-crabbe-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

…uth_error

# Conflicts:
#	tests/unit/llms/bedrock_mantle/test_bedrock_mantle_transformation.py
@ryan-crabbe-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@ryan-crabbe-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@ryan-crabbe-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@ryan-crabbe-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@ryan-crabbe-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit ff9ad03. Configure here.

@ryan-crabbe-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@ryan-crabbe-berri
ryan-crabbe-berri enabled auto-merge (squash) November 23, 2026 20:37
@ryan-crabbe-berri
ryan-crabbe-berri merged commit 9a09c65 into main Nov 23, 2026
60 of 61 checks passed
@ryan-crabbe-berri
ryan-crabbe-berri deleted the litellm_bedrock_sso_auth_error branch November 23, 2026 21:01
narmstrong-berri added a commit that referenced this pull request Nov 24, 2026
…our (#54223)

Main's rust-wheel job fails 10 tests in tests/test_litellm_rust/messages,
each pinned to behaviour a later PR changed on purpose. The stub check
failed first until #53922, so the pytest step never reported them.

Credential failures on Bedrock invoke and Mantle now answer a 401
AuthenticationError with the botocore error as its context (#53362). A
200 Bedrock stream whose body is JSON answers BedrockError 502 (#53482).
A cut Bedrock stream drops the message_start output placeholder and
re-counts the streamed text (#53394). Logging copies the resolved
provider into litellm_params before callbacks run (#52709)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: TokenRetrievalError in litellm/llms/bedrock/base_aws_llm.py

2 participants