litellm/litellm
mubashir1osmani a1e7293fa9
fix(mcp): apply key and team guardrails to MCP tool calls (#39629)
* fix(mcp): apply key and team guardrails to MCP tool calls

Guardrails attached to a virtual key or team were only enforced on LLM
routes. The synthetic request built for MCP tool call guardrail hooks
carried no guardrails in its metadata, so a guardrail with default_on
false never ran on tools/call even when the key explicitly listed it.
Resolve key, team, and project guardrails onto the synthetic request
with the same helper the chat path uses.

* fix(mcp): pass project metadata through without a mutable default

* fix(mcp): mark the request dict parameter mutable-ok with a reason

* test(mcp): explain the premium_user patch and tighten the helper docstring
2026-09-07 16:45:16 +00:00
..
a2a_protocol Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_decrease_anys_opus5_r4 2026-09-02 23:32:10 +00:00
anthropic_interface fix(anthropic_endpoints): return Anthropic type:error envelope for /v1/messages errors 2026-08-31 16:23:36 -07:00
assistants refactor(typing): replace Any with proven types in 89 more backend files 2026-09-02 23:08:42 +00:00
batch_completion
batches fix(batches): claim the batch cost spend row in the database before charging 2026-09-05 18:58:11 -07:00
caching Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_decrease_anys_opus5_r4 2026-09-04 21:02:19 -07:00
completion_extras Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_headroom_ccr_streaming_responses 2026-09-01 22:25:59 -07:00
compression refactor(typing): replace Any with proven types in 89 more backend files 2026-09-02 23:08:42 +00:00
containers Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_decrease_anys_opus5_r4 2026-09-02 23:32:10 +00:00
endpoints/speech/speech_to_completion_bridge refactor(speech): freeze httpx response header dicts (LIT002) 2026-08-31 21:12:53 -07:00
evals
experimental_mcp_client chore: merge origin/litellm_internal_staging into litellm_decrease_anys_opus5_r4 2026-09-04 18:59:35 -07:00
files refactor(typing): replace Any with proven types in 42 more backend files 2026-09-02 15:35:01 +00:00
fine_tuning refactor(typing): replace Any with proven types in 89 more backend files 2026-09-02 23:08:42 +00:00
google_genai refactor(types): replace Any with precise types across 73 modules 2026-09-01 11:05:02 +00:00
images refactor(typing): replace Any with proven types in 89 more backend files 2026-09-02 23:08:42 +00:00
integrations fix(azure_sentinel): split batches under the 1MB ingestion cap (#39880) 2026-09-05 17:15:36 -07:00
interactions refactor(typing): replace Any with proven types in 42 more backend files 2026-09-02 15:35:01 +00:00
litellm_core_utils Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_lit_7048_batch_cost_row_once 2026-09-05 23:03:41 -07:00
llms chore: merge litellm_internal_staging into litellm_mistral_voxtral_tts_speech 2026-09-06 03:24:55 -07:00
models feat(mcp): add opt-in per-server oauth relay discovery (#39936) 2026-09-05 18:04:35 -07:00
ocr feat(ocr): add Cohere Parse support for cohere and azure_ai 2026-09-04 21:25:46 -07:00
passthrough Merge origin/litellm_internal_staging into litellm_techdebt_20260901 2026-09-01 19:38:19 +00:00
proxy fix(mcp): apply key and team guardrails to MCP tool calls (#39629) 2026-09-07 16:45:16 +00:00
proxy_auth
rag chore: merge origin/litellm_internal_staging into litellm_decrease_anys_opus5_r4 2026-09-04 18:59:35 -07:00
realtime_api Merge pull request #39851 from BerriAI/litellm_fix_realtime_backend_close_hang 2026-09-05 09:51:15 -07:00
repositories feat(router): gate heuristic v1 tuning (#39952) 2026-09-05 19:24:00 -07:00
rerank_api fix(rerank): adopt declared authenticating providers in arerank instead of resolving them 2026-09-01 14:47:59 -07:00
responses fix(file_search): escape the dropped vector_store_id in the warning 2026-09-05 16:44:54 -07:00
router_strategy Merge pull request #40014 from BerriAI/litellm_lit_7036_retry_policy_400s 2026-09-07 09:38:43 -07:00
router_utils Merge pull request #39983 from BerriAI/litellm_lit_7081_azure_ai_gpt_6_astra_pricing 2026-09-06 01:27:22 -07:00
rust_bridge chore: merge litellm_internal_staging into litellm_techdebt_20260903 2026-09-04 16:23:52 +00:00
sandbox
search fix(search): forward search-tool params through the router, complete Parallel AI v1 param mapping (#37883) 2026-09-01 21:46:46 -07:00
secret_managers chore: merge origin/litellm_internal_staging into litellm_decrease_anys_opus5_r4 2026-09-04 18:59:35 -07:00
skills refactor(typing): replace Any with proven types in 42 more backend files 2026-09-02 15:35:01 +00:00
types Merge pull request #39723 from Atharva-Kanherkar/fix/anthropic-responses-refusal-translation 2026-09-06 00:03:06 -07:00
vector_store_files refactor(typing): replace Any with proven types in 42 more backend files 2026-09-02 15:35:01 +00:00
vector_stores Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_python_version_ci 2026-09-03 00:16:19 -07:00
videos
__init__.py Revert "perf: lazy-load SDK symbols so import litellm stays under 60 MB RSS (…" 2026-09-05 16:07:09 -07:00
_internal_context.py
_lazy_imports.py fix(lazy_imports): type import_map as Mapping to stay under the LIT001 budget 2026-09-05 16:12:45 -07:00
_lazy_imports_registry.py Revert "perf: lazy-load SDK symbols so import litellm stays under 60 MB RSS (…" 2026-09-05 16:07:09 -07:00
_logging.py fix(proxy): stop leaking internal exception details to clients (#39380) 2026-09-02 17:32:00 -07:00
_redis.py fix(redis): coerce env var string types and fix param discovery through decorator wrappers (#30644) 2026-08-31 20:51:31 -07:00
_redis_credential_provider.py refactor(typing): replace Any with proven types in 89 more backend files 2026-09-02 23:08:42 +00:00
_service_logger.py chore: merge origin/litellm_internal_staging into litellm_decrease_anys_opus5_r4 2026-09-04 18:59:35 -07:00
_uuid.py
_version.py
anthropic_beta_headers_config.json
anthropic_beta_headers_manager.py
blog_posts.json
budget_manager.py
constants.py perf(logging): scan large base64 payloads for log truncation off the event loop (#39890) 2026-09-05 11:51:15 -07:00
cost.json
cost_calculator.py Merge pull request #30856 from emerzon/litellm_vertex_lyria_models 2026-09-05 23:12:25 -07:00
exceptions.py refactor(typing): replace Any with proven types in 89 more backend files 2026-09-02 23:08:42 +00:00
main.py chore: merge litellm_internal_staging into litellm_mistral_voxtral_tts_speech 2026-09-06 03:24:55 -07:00
model_prices_and_context_window_backup.json chore: merge litellm_internal_staging into litellm_mistral_voxtral_tts_speech 2026-09-06 03:24:55 -07:00
policy_templates_backup.json
provider_endpoints_support_backup.json fix(ocr): send each provider a health-check document it accepts 2026-09-04 22:52:12 -07:00
py.typed
router.py Merge pull request #38755 from BerriAI/litellm_mistral_voxtral_tts_speech 2026-09-07 09:38:57 -07:00
scheduler.py
setup_wizard.py feat(models): add Claude Fable 5.1 across Anthropic, Bedrock, Vertex AI, and Azure AI 2026-09-01 18:07:06 +00:00
timeout.py
utils.py Merge pull request #38755 from BerriAI/litellm_mistral_voxtral_tts_speech 2026-09-07 09:38:57 -07:00