litellm/litellm/integrations
Shivam Rawat 7e57b15de2
fix(guardrails): team-level guardrails and global policy guardrails can run together (#26466)
* fix(guardrails): apply team-level guardrails alongside global policy guardrails

Two bugs prevented team-direct guardrails from being automatically applied
when using a team-scoped API key:

1. Auth caching: `valid_token.team_metadata` was never refreshed from the
   freshly-fetched team object at the "Check 6" step in
   `_user_api_key_auth_builder`. Guardrails added to a team after the key
   was first cached were therefore invisible to `move_guardrails_to_metadata`.
   Fix: propagate `_team_obj.metadata` → `valid_token.team_metadata` after
   every "Check 6" team fetch (user_api_key_auth.py).

2. Guardrail execution: `get_guardrail_from_metadata` checked
   `data["litellm_metadata"]` before `data["metadata"]`. When a request
   carried a non-empty `litellm_metadata` without a "guardrails" key, the
   merged guardrail list written to `data["metadata"]` by
   `move_guardrails_to_metadata` was shadowed and the guardrail received an
   empty requested-guardrails list (custom_guardrail.py).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix merge conflict

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 14:45:06 -07:00
..
_types style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
agentops style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
arize style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
azure_sentinel style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
azure_storage style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
bitbucket [Fix] CI/CD - mypy & check_code_and_doc_quality & mcp_testing (#17920) 2025-12-13 08:18:43 -08:00
cloudzero style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
compression_interception Prompt Compression - add it to the proxy (#25729) 2026-04-20 15:08:00 -07:00
datadog style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
deepeval fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
dotprompt fix(proxy): improve input validation on management endpoints 2026-04-09 14:14:53 -07:00
email_templates style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
focus [Staging] - Ishaan March 17th (#23903) 2026-03-18 15:09:01 -07:00
gcs_bucket style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
gcs_pubsub Fix gcs pub sub logging with env var GCS_PROJECT_ID (#10042) 2025-04-15 21:50:48 -07:00
generic_api Add Ramp as a built-in generic API callback with docs (#23769) 2026-04-08 20:06:48 -07:00
generic_prompt_management style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
gitlab style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
langfuse style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
levo docs: remove docs/my-website, point contributors to litellm-docs 2026-04-24 14:17:46 -07:00
litellm_agent Agent Builder - support new experimental agent builder, to ensure agents pass compliance checks (#21817) 2026-02-21 15:32:47 -08:00
opentelemetry_utils [Feat] s3 logger, add support for ssl_verify when using minio logger (#16211) 2025-11-03 13:56:00 -08:00
opik style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
prometheus_helpers [Fix] Apply black formatting to fix CI lint failures 2026-04-20 15:53:12 -07:00
SlackAlerting style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
vantage style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
vector_store_integrations style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
weave style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
websearch_interception [Fix] Apply black formatting to fix CI lint failures 2026-04-20 15:53:12 -07:00
__init__.py add linting 2023-08-18 11:05:05 -07:00
additional_logging_utils.py (Feat) - Allow viewing Request/Response Logs stored in GCS Bucket (#8449) 2025-02-10 20:38:55 -08:00
anthropic_cache_control_hook.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
argilla.py build(pyproject.toml): add new dev dependencies - for type checking (#9631) 2025-03-29 11:02:13 -07:00
athina.py build(pyproject.toml): add new dev dependencies - for type checking (#9631) 2025-03-29 11:02:13 -07:00
braintrust_logging.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
braintrust_mock_client.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
callback_configs.json feat: ability to trace metrics 2026-02-25 22:03:51 +05:30
custom_batch_logger.py build(pyproject.toml): add new dev dependencies - for type checking (#9631) 2025-03-29 11:02:13 -07:00
custom_guardrail.py fix(guardrails): team-level guardrails and global policy guardrails can run together (#26466) 2026-04-25 14:45:06 -07:00
custom_logger.py Litellm krrish staging 04 20 2026 (#26138) 2026-04-20 16:22:12 -07:00
custom_prompt_management.py [Fix] CI/CD - mypy & check_code_and_doc_quality & mcp_testing (#17920) 2025-12-13 08:18:43 -08:00
custom_secret_manager.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
custom_sso_handler.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
dynamodb.py fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
email_alerting.py (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
galileo.py (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
greenscale.py LITELLM: Remove requests library usage (#7235) 2024-12-17 12:50:04 -08:00
helicone.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
helicone_mock_client.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
humanloop.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
lago.py fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
langsmith.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
langsmith_mock_client.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
langtrace.py build(pyproject.toml): add new dev dependencies - for type checking (#9631) 2025-03-29 11:02:13 -07:00
literal_ai.py fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
logfire_logger.py fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
lunary.py build(pyproject.toml): add new dev dependencies - for type checking (#9631) 2025-03-29 11:02:13 -07:00
mlflow.py Fix: MLflow streaming spans for Anthropic passthrough (#17288) 2025-12-05 14:59:36 -08:00
mock_client_factory.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
openmeter.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
opentelemetry.py April 21st Ishaan Branch (#26213) 2026-04-21 20:18:56 -07:00
posthog.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
posthog_mock_client.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
prometheus.py [Fix] Apply black formatting to fix CI lint failures 2026-04-20 15:53:12 -07:00
prometheus_services.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
prompt_layer.py LITELLM: Remove requests library usage (#7235) 2024-12-17 12:50:04 -08:00
prompt_management_base.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
Readme.md (Feat) - Add GCS Pub/Sub Logging integration for sending DB SpendLogs to BigQuery (#7976) 2025-01-24 20:57:20 -08:00
s3.py Add allowing Key based prefix to s3 path (#16237) 2025-11-05 14:43:21 -08:00
s3_v2.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
sqs.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
supabase.py (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
test_httpx.py fix(utils.py): improved predibase exception mapping 2024-06-08 14:32:43 -07:00
traceloop.py (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
weights_biases.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00

Integrations

This folder contains logging integrations for litellm

eg. logging to Datadog, Langfuse, Prometheus, s3, GCS Bucket, etc.