litellm/litellm
Ishaan Jaff 371cabfebd
Add MCP Security guardrail to block unregistered MCP servers (#21429)
* Add MCP_SECURITY enum to SupportedGuardrailIntegrations

* Add MCP security guardrail initializer

* Add MCPSecurityGuardrail implementation

* Add MCP Security policy template

* Add Type filter to policy templates UI

* Add unit tests for MCP security guardrail

* fix(lint): remove unused Dict import from mcp_security_guardrail

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

* Add French language support for EU AI Act Article 5 guardrail (#21427)

* Add French language support for EU AI Act Article 5 template

- Create eu_ai_act_article5_fr.yaml with comprehensive French keywords
- Includes identifier words: concevoir, créer, développer, noter, classer, etc.
- Includes block words: crédit social, comportement social, émotion des employés, etc.
- Includes always-block keywords for explicit prohibited practices
- Includes exceptions for research, compliance, and legitimate use cases
- Catches circumvention attempts with phrase variations

* Add comprehensive tests for French EU AI Act guardrail

- Test 3 critical scenarios: blocked query, circumvention attempt, safe query
- Test edge cases: case-insensitive, mixed language, research exceptions
- All 7 tests passing
- Validates both blocking and allowing behavior

* Fix content filter to support conditional matching without inherit_from

- Enable conditional matching when identifier_words + additional_block_words are present
- Previously required inherit_from, but EU AI Act templates are self-contained
- Fixes Greptile feedback: conditional matching now works as documented

* Add pure conditional matching test for French guardrail

- Test identifier + block word combinations not in always_block_keywords
- Verifies conditional matching works independently
- Addresses Greptile feedback about test coverage gap

* Fix exception word bypass risk in French template

- Replace short words (film, jeu, juste) with context-specific phrases
- Prevents substring matching bypasses (e.g., enjeu matching jeu)
- Add tests for bypass prevention and legitimate game context
- Addresses Greptile security feedback

* Make conditional match assertion more robust

- Use getattr to safely access exception detail field
- Check if detail is dict before calling .get()
- Addresses Greptile feedback about brittle string assertion

* Add French EU AI Act Article 5 policy template to registry

- Add eu-ai-act-article5-fr template for French language support
- Includes French description and guardrail info
- Matches structure of English template

* Address greptile review feedback (greploop iteration 1)

- Use status_code=400 instead of 403 to match guardrail logging convention
- Use prefix stripping instead of split('/')[-1] for robust server name extraction

* remove French EU AI Act template from policy_templates.json

---------

Co-authored-by: Julio Quinteros Pro <jquinter@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-17 21:19:13 -08:00
..
a2a_protocol
anthropic_interface
assistants
batch_completion fix(batch_completion): submit all model futures before waiting (#20705) 2026-02-11 15:44:37 +05:30
batches fix mypy 2026-02-16 19:05:06 +05:30
caching fix(cache): prevent DualCache async batch check-then-act race (#20986) 2026-02-13 18:32:41 +05:30
completion_extras fix openai tests 2026-02-12 17:53:47 -08:00
containers
endpoints/speech/speech_to_completion_bridge
evals Add eval run endpoints and methods 2026-02-17 19:32:15 +05:30
experimental_mcp_client
files
fine_tuning
google_genai
images
integrations fix: remove unused asyncio imports (F401) 2026-02-17 18:54:18 -03:00
interactions
litellm_core_utils fix: complete asyncio.iscoroutinefunction deprecation fix across codebase 2026-02-17 18:20:44 -03:00
llms Fix mypy issues 2026-02-17 20:51:51 +05:30
ocr
passthrough
proxy Add MCP Security guardrail to block unregistered MCP servers (#21429) 2026-02-17 21:19:13 -08:00
proxy_auth
rag fix(ci): Fix ruff lint error - unused import in vertex_ai_ingestion (#21178) 2026-02-13 18:14:23 -08:00
realtime_api
rerank_api
responses fix: remove unused Reasoning import from transformation.py 2026-02-15 12:37:41 -03:00
router_strategy fix(router): remove repeated provider parsing in budget limiter hot path (#21043) 2026-02-12 20:05:55 -08:00
router_utils
search
secret_managers
skills
types Add MCP Security guardrail to block unregistered MCP servers (#21429) 2026-02-17 21:19:13 -08:00
vector_store_files
vector_stores
videos
__init__.py Add support for evals via sdk 2026-02-17 19:32:15 +05:30
_lazy_imports_registry.py fix: remove duplicate PerplexityResponsesConfig from LLM_CONFIG_NAMES (#21105) 2026-02-13 08:38:50 -08:00
_lazy_imports.py
_logging.py
_redis.py
_service_logger.py Add comments 2026-02-14 19:46:56 -05:00
_uuid.py
_version.py
anthropic_beta_headers_config.json Merge branch 'main' into litellm_litellm_anthropic_remote_url3 2026-02-13 18:40:00 +05:30
anthropic_beta_headers_manager.py Add support sync with remote URL for beta headers 2026-02-13 15:49:42 +05:30
budget_manager.py
constants.py Add Claude Sonnet 4.6 pricing (#21395) 2026-02-17 11:46:24 -08:00
cost_calculator.py fix mypy 2026-02-16 18:55:21 +05:30
cost.json
exceptions.py
main.py feat(vertex_ai): preserve usageMetadata in _hidden_params (#20559) 2026-02-12 20:44:59 -08:00
model_prices_and_context_window_backup.json add default version for opus 4.6 (#21397) 2026-02-17 11:46:44 -08:00
mypy.ini
policy_templates_backup.json feat: split EU AI Act Article 5 into 5 dedicated sub-guardrails per language (#21453) 2026-02-17 20:43:25 -08:00
py.typed
router.py Merge pull request #21089 from BerriAI/litellm_vector_store_endpoints 2026-02-13 22:18:29 +05:30
scheduler.py
timeout.py
utils.py fix(token-counter): normalize encode() return type and handle HF tokenizer fallback 2026-02-17 19:19:27 -03:00