litellm/tests/test_litellm/llms/bedrock/chat
Mateo Wang 138a69bd61
fix(bedrock): map guardrailConfig to InvokeModel guardrail headers (#31985)
* fix(bedrock): map guardrailConfig to InvokeModel guardrail headers

The InvokeModel API takes the guardrail identifier, version and trace as
X-Amzn-Bedrock-* request headers, unlike Converse which takes them in the
request body. The invoke transformer never set these headers, so
guardrailConfig was silently dropped (or leaked into the request body)
and Bedrock guardrails never ran on invoke-route models. Pop
guardrailConfig in AmazonInvokeConfig.validate_environment, validate it,
and set the headers before SigV4 signing; explicitly passed headers keep
winning over guardrailConfig so existing workarounds are unaffected

* fix(bedrock): reject guardrailConfig missing guardrailIdentifier

A guardrailConfig without guardrailIdentifier (e.g. an empty dict) would
validate, produce no guardrail headers, and let the request proceed with
guardrails silently not applied; that silent skip is the exact failure
mode this fix exists to remove, so fail fast with a 400 instead
2026-07-02 18:58:30 -07:00
..
agentcore chore: litellm oss 170626 (#30637) 2026-06-17 21:11:12 -07:00
invoke_transformations fix(bedrock): map guardrailConfig to InvokeModel guardrail headers (#31985) 2026-07-02 18:58:30 -07:00
test_converse_transformation.py fix(bedrock): honor ttl for tool_config cache injection points (#31929) 2026-07-02 16:30:06 -07:00
test_converse_transformation_nova_2.py feat(bedrock): broaden Nova 2 model detection to support nova-2-pro reasoning 2026-02-16 20:35:00 -08:00
test_invoke_handler.py chore(oss): litellm oss staging 120626 (#30292) 2026-06-12 09:49:25 -07:00
test_mistral_config.py Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
test_service_tier.py feat(bedrock): add OpenAI-compatible service_tier parameter translation (#18091) 2026-01-12 17:28:49 +05:30
test_streaming_choice_index.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_writer_palmyra.py [Feat] New model - add bedrock writer models (#17685) 2025-12-08 17:49:06 -08:00