The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Fix: Ensure guardrail metadata is preserved in request_data (#17593)
Alexsander Hamir99ab9fd145c6
diff --git a/litellm/proxy/common_utils/callback_utils.py b/litellm/proxy/common_utils/callback_utils.pyindex 9e88bccb73e..86125b3b519 100644--- a/litellm/proxy/common_utils/callback_utils.py+++ b/litellm/proxy/common_utils/callback_utils.py@@ -385,6 +385,8 @@ def add_guardrail_to_applied_guardrails_header(_metadata["applied_guardrails"].append(guardrail_name)else:_metadata["applied_guardrails"] = [guardrail_name]+ # Ensure metadata is set back to request_data (important when metadata didn't exist)+ request_data["metadata"] = _metadatadef add_guardrail_response_to_standard_logging_object(