diff --git a/kubernetes/apps/ai/litellm/app/configmap.yaml b/kubernetes/apps/ai/litellm/app/configmap.yaml index 5773e9df..5e78ff45 100644 --- a/kubernetes/apps/ai/litellm/app/configmap.yaml +++ b/kubernetes/apps/ai/litellm/app/configmap.yaml @@ -227,6 +227,24 @@ data: # Required to configure self-hosted SearXNG endpoint allow_client_side_credentials: true + # ===================================================== + # STORY-063: Anthropic Pass-Through for Claude Max OAuth + # Workaround for LiteLLM bug (Issue #19618) where Authorization + # header is stripped before forwarding to Anthropic. + # Pass-through with forward_headers: true preserves OAuth token. + # Reference: https://docs.litellm.ai/docs/pass_through/anthropic_completion + # ===================================================== + pass_through_endpoints: + - path: "/anthropic" + target: "https://api.anthropic.com" + forward_headers: true + auth: true + guardrails: + lakera-guard: + request_fields: ["messages[*].content"] + openai-mod: + request_fields: ["messages[*].content"] + litellm_settings: # Drop unsupported params instead of erroring drop_params: true diff --git a/kubernetes/apps/ai/moltbot/app/helmrelease.yaml b/kubernetes/apps/ai/moltbot/app/helmrelease.yaml index f57da2c8..d7eaceea 100644 --- a/kubernetes/apps/ai/moltbot/app/helmrelease.yaml +++ b/kubernetes/apps/ai/moltbot/app/helmrelease.yaml @@ -101,11 +101,10 @@ spec: name: moltbot-secrets key: ANTHROPIC_OAUTH_TOKEN # STORY-063: Route Claude Code through LiteLLM for guardrails - # OAuth token forwarded via per-model forward_client_headers_to_llm_api + # Uses pass-through endpoint with forward_headers: true to preserve OAuth token + # Workaround for LiteLLM bug #19618 (clean_headers strips Authorization) ANTHROPIC_BASE_URL: - value: "http://litellm.ai.svc.cluster.local:4000" - ANTHROPIC_MODEL: - value: "claude-default" + value: "http://litellm.ai.svc.cluster.local:4000/anthropic" # x-litellm-api-key header for LiteLLM authentication/tracking # Pre-composed in 1Password (K8s $(VAR) substitution doesn't work with secretKeyRef) ANTHROPIC_CUSTOM_HEADERS: