mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-06 08:16:43 +00:00
* Add post-call hook for Lakera guardrail and mask PII in responses * Add post-call hook for Lakera and mask PII in responses * Fix post-call hook: pass event_type to call_v2_guard * Address Greptile review: return ModelResponse, fix mutation, add header, test location, mask order - PII masking path: return ModelResponse instead of dict so deployment hook accepts it - Avoid mutating request data: deep copy original_messages and messages in _mask_pii_in_messages - Add guardrail header in PII-only return path - Add test in tests/test_litellm/ (test_lakera_ai_v2.py) per PR checklist - Sort PII payload spans by (start,end) descending so multiple spans in one message mask correctly Co-authored-by: Cursor <cursoragent@cursor.com> * Updated ponteital for index mismatch when choices have null content and inconsistent on_flagged access pattern * Update litellm/proxy/guardrails/guardrail_hooks/lakera_ai_v2.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update to explicitly state supported endpoints - chat completions * Fix minor lint error on masked_entity_count --------- Co-authored-by: Steve <steve.giguere@lakera.ai> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| conftest.py | ||
| test_bedrock_guardrails.py | ||
| test_custom_guardrail.py | ||
| test_dynamoai_guardrails.py | ||
| test_eu_ai_act_article5.py | ||
| test_eu_ai_act_french_3_scenarios.py | ||
| test_guardrail_load_balancing.py | ||
| test_guardrails_config.py | ||
| test_javelin_guardrails.py | ||
| test_lakera_v2.py | ||
| test_lasso_guardrails.py | ||
| test_presidio_pii.py | ||
| test_semantic_guard.py | ||
| test_sg_mas_ai_guardrails.py | ||
| test_sg_pdpa_guardrails.py | ||
| test_tracing_guardrails.py | ||
| test_zscaler_ai_guard.py | ||