From 1ac191bff877053d8b1411c6eeb56ba1631007f9 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Fri, 20 Feb 2026 19:06:32 -0800 Subject: [PATCH] add TestInsultsContentFilter eval class --- .../guardrail_benchmarks/test_eval.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/guardrail_benchmarks/test_eval.py b/litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/guardrail_benchmarks/test_eval.py index 81a85939e9a..61c724b1836 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/guardrail_benchmarks/test_eval.py +++ b/litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/guardrail_benchmarks/test_eval.py @@ -227,6 +227,25 @@ def _content_filter(category: str): return _ContentFilterChecker(guardrail) +class TestInsultsContentFilter: + """Insults eval with production ContentFilterGuardrail + denied_insults.yaml.""" + + @pytest.fixture(scope="class") + def blocker(self): + return _content_filter("denied_insults") + + @pytest.fixture(scope="class") + def cases(self): + return _load_jsonl("block_insults.jsonl") + + def test_confusion_matrix(self, blocker, cases): + _confusion_matrix( + blocker, + cases, + "Block Insults — ContentFilter (denied_insults.yaml)", + ) + + class TestInvestmentContentFilter: """Investment eval with production ContentFilterGuardrail + denied_financial_advice.yaml."""