From 998aa1bff4806c733d87a9d28db024d5f5d5dfcd Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Wed, 21 Jan 2026 17:51:57 -0800 Subject: [PATCH] fix ALLOWED_VERTEX_AI_PASSTHROUGH_HEADERS --- litellm/constants.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/litellm/constants.py b/litellm/constants.py index e142c7d6304..13a26c6d0ea 100644 --- a/litellm/constants.py +++ b/litellm/constants.py @@ -1122,6 +1122,15 @@ BEDROCK_AGENT_RUNTIME_PASS_THROUGH_ROUTES = [ "generateQuery/", "optimize-prompt/", ] + + +# Headers that are safe to forward from incoming requests to Vertex AI +# Using an allowlist approach for security - only forward headers we explicitly trust +ALLOWED_VERTEX_AI_PASSTHROUGH_HEADERS = { + "anthropic-beta", # Required for Anthropic features like extended context windows + "content-type", # Required for request body parsing +} + BASE_MCP_ROUTE = "/mcp" BATCH_STATUS_POLL_INTERVAL_SECONDS = int(