From c1963f7f02da57a59201ff08303501269008b6bd Mon Sep 17 00:00:00 2001 From: = Date: Thu, 18 Sep 2025 12:05:38 -0700 Subject: [PATCH 1/4] removed wrapper which overwrote the guardrailResponse value incorrectly --- litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py | 1 - 1 file changed, 1 deletion(-) diff --git a/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py b/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py index dfb01a7cd0..19c2623428 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py +++ b/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py @@ -516,7 +516,6 @@ class BedrockGuardrail(CustomGuardrail, BaseAWSLLM): # This means all actions were ANONYMIZED or NONE, so don't raise exception return False - @log_guardrail_information async def async_pre_call_hook( self, user_api_key_dict: UserAPIKeyAuth, From 77e4008e7b8952a73917daf2f92ba656b50e065d Mon Sep 17 00:00:00 2001 From: = Date: Thu, 18 Sep 2025 17:13:55 -0700 Subject: [PATCH 2/4] lint fix --- litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py b/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py index 19c2623428..5813a6079d 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py +++ b/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py @@ -24,7 +24,6 @@ from litellm._logging import verbose_proxy_logger from litellm.caching import DualCache from litellm.integrations.custom_guardrail import ( CustomGuardrail, - log_guardrail_information, ) from litellm.llms.bedrock.base_aws_llm import BaseAWSLLM from litellm.llms.custom_httpx.http_handler import ( @@ -111,6 +110,7 @@ class BedrockGuardrail(CustomGuardrail, BaseAWSLLM): ) self.guardrailIdentifier = guardrailIdentifier self.guardrailVersion = guardrailVersion + self.guardrail_provider = "bedrock" # store kwargs as optional_params self.optional_params = kwargs @@ -372,6 +372,7 @@ class BedrockGuardrail(CustomGuardrail, BaseAWSLLM): # Add guardrail information to request trace ######################################################### self.add_standard_logging_guardrail_information_to_request_data( + guardrail_provider=self.guardrail_provider, guardrail_json_response=response.json(), request_data=request_data or {}, guardrail_status=self._get_bedrock_guardrail_response_status( From 12fed102ba95e93bdb85b6b393aaa54cf507ef4e Mon Sep 17 00:00:00 2001 From: = Date: Thu, 18 Sep 2025 17:25:31 -0700 Subject: [PATCH 3/4] Update bedrock_guardrails.py --- litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py | 1 - 1 file changed, 1 deletion(-) diff --git a/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py b/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py index 5813a6079d..05d50ad7c9 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py +++ b/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py @@ -372,7 +372,6 @@ class BedrockGuardrail(CustomGuardrail, BaseAWSLLM): # Add guardrail information to request trace ######################################################### self.add_standard_logging_guardrail_information_to_request_data( - guardrail_provider=self.guardrail_provider, guardrail_json_response=response.json(), request_data=request_data or {}, guardrail_status=self._get_bedrock_guardrail_response_status( From 4f468e9563b9a5929594a13f0d3ec6b8763d2c69 Mon Sep 17 00:00:00 2001 From: = Date: Thu, 18 Sep 2025 17:27:40 -0700 Subject: [PATCH 4/4] Update bedrock_guardrails.py --- litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py | 1 - 1 file changed, 1 deletion(-) diff --git a/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py b/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py index 05d50ad7c9..40ed5b9c77 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py +++ b/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py @@ -110,7 +110,6 @@ class BedrockGuardrail(CustomGuardrail, BaseAWSLLM): ) self.guardrailIdentifier = guardrailIdentifier self.guardrailVersion = guardrailVersion - self.guardrail_provider = "bedrock" # store kwargs as optional_params self.optional_params = kwargs