litellm/tests/test_litellm/proxy/policy_engine
yucheng-berri 1139012b45
fix(guardrails): scan text on /guardrails/apply_guardrail for Azure Content Safety (#36894)
* fix(guardrails): scan text on /guardrails/apply_guardrail for Azure Content Safety

The two Azure Content Safety guardrails never implemented apply_guardrail, so the
endpoint fell through to the base no-op and answered 200 with the caller's text
echoed back, having scanned nothing.

Implementing that method also flips the proxy's unified-vs-native dispatch, which
would move request traffic off these guardrails' own hooks. Add an opt-out that
keeps every lifecycle event on the native hooks, so only the endpoint changes.

* test(guardrails): cover the remaining native-hook opt-out dispatch sites

Adds regression tests for the parallel post-call path, the MCP post-call hook, and
the policy engine step, so every read of the opt-out flag fails when removed.
2026-08-17 11:18:40 -07:00
..
__init__.py [Feat] New LiteLLM Policy engine - create policies to manage guardrails, conditions - permissions per Key, Team (#19612) 2026-01-22 19:49:53 -08:00
test_attachment_registry.py fix(policy_engine): only hide config policies behind production DB versions in policies list 2026-07-30 15:33:52 -07:00
test_condition_evaluator.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_pipeline_executor.py fix(guardrails): scan text on /guardrails/apply_guardrail for Azure Content Safety (#36894) 2026-08-17 11:18:40 -07:00
test_policy_engine_endpoints.py fix(policy_engine): decide config policy suppression from fresh db query only 2026-07-30 16:01:57 -07:00
test_policy_matcher.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_policy_resolver.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_policy_validator.py fix(policies): reject non-existent team/key/model scope entries on attachment create (#32131) 2026-07-04 11:58:29 -07:00
test_policy_versioning.py fix(policy_engine): warn that the config-defined policy reactivates when all DB versions are deleted 2026-07-30 19:48:35 -07:00
test_policy_versioning_e2e.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00