litellm/docs/my-website/docs
Steve G 9806e21871
Add Lakera v2 post-call hook and tests (fixed PII masking) (#21783)
* 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>
2026-02-25 17:20:38 -08:00
..
adding_provider Merge pull request #21326 from BerriAI/litellm_oss_staging_02_16_2026 2026-02-18 17:47:57 +05:30
anthropic_unified fix: prompt registry 2026-02-18 00:34:54 +05:30
caching fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
completion fix: add prompt_cache_key and prompt_cache_retention support for OpenAI 2026-02-24 16:42:54 -08:00
contribute_integration docs(community.md): add new integration partner doc 2025-12-09 18:17:14 -08:00
contributing [Feat] Allow adding OpenAI compatible chat providers using .json + add public ai provider (#17448) 2025-12-04 17:59:25 -08:00
debugging Update local_debugging.md (#8308) 2025-02-06 16:19:32 -08:00
embedding docs: improve Getting Started page and SDK documentation structure (#17614) 2025-12-08 13:05:50 -08:00
extras fix: prompt registry 2026-02-18 00:34:54 +05:30
guides fix: prompt registry 2026-02-18 00:34:54 +05:30
integrations fix: prompt registry 2026-02-18 00:34:54 +05:30
langchain added tags to langchain 2025-09-10 00:32:26 -04:00
observability fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
pass_through fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
projects fix: prompt registry 2026-02-18 00:34:54 +05:30
provider_registration docs openai 2025-12-04 18:32:23 -08:00
providers Merge branch 'main' into litellm_oss_staging_02_23_2026 2026-02-24 19:32:48 +05:30
proxy Add Lakera v2 post-call hook and tests (fixed PII masking) (#21783) 2026-02-25 17:20:38 -08:00
search Add duckcukgo in docs 2026-02-18 16:17:39 +05:30
secret_managers fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
troubleshoot Update docs/my-website/docs/troubleshoot/rollback.md 2026-02-21 10:40:41 +05:30
tutorials fix(guardrails): prevent presidio crash on non-json responses 2026-02-25 16:11:24 +05:30
vector_stores Add vector store support for ragflow 2025-12-03 15:29:47 +05:30
a2a.md fix: prompt registry 2026-02-18 00:34:54 +05:30
a2a_agent_permissions.md [Docs] A2a - Permission management (#17515) 2025-12-04 17:29:47 -08:00
a2a_cost_tracking.md fix: prompt registry 2026-02-18 00:34:54 +05:30
a2a_invoking_agents.md fix: prompt registry 2026-02-18 00:34:54 +05:30
aiohttp_benchmarks.md docs benchmarks 2025-05-24 17:43:38 -07:00
anthropic_count_tokens.md fix: prompt registry 2026-02-18 00:34:54 +05:30
apply_guardrail.md Implement Bedrock Guardrail apply_guardrail endpoint support (#15892) 2025-10-24 10:24:03 -07:00
assistants.md docs: improve Getting Started page and SDK documentation structure (#17614) 2025-12-08 13:05:50 -08:00
audio_transcription.md Add support of audio transcription for OVHcloud (#17305) 2025-12-01 18:26:39 -08:00
batches.md fix: prompt registry 2026-02-18 00:34:54 +05:30
bedrock_converse.md docs boto3 instructions 2025-10-16 16:34:56 -07:00
bedrock_invoke.md docs boto3 instructions 2025-10-16 16:34:56 -07:00
benchmarks.md fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
budget_manager.md
contact.md docs: update broken Slack invite links to support page (#16546) 2025-11-12 12:41:55 -08:00
container_files.md fix: prompt registry 2026-02-18 00:34:54 +05:30
containers.md [docs] add docs for containers files api + code interpreter on LiteLLM (#17749) 2025-12-09 18:11:28 -08:00
contributing.md fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
data_retention.md fix: prompt registry 2026-02-18 00:34:54 +05:30
data_security.md docs(data_security.md): data_security.md 2025-06-09 17:53:11 -07:00
default_code_snippet.md
enterprise.md fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
evals_api.md fix: prompt registry 2026-02-18 00:34:54 +05:30
exception_mapping.md Adds support for returning Azure Content Policy error information when exceptions from Azure OpenAI occur (#16231) 2025-11-08 16:04:36 -08:00
files_endpoints.md Add support for file content download for bedrock batches 2025-12-04 13:27:53 +05:30
fine_tuning.md fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
generateContent.md fix: Metadata / Trace ID Missing in S3 Streaming Callbacks 2026-02-25 14:16:42 +05:30
image_edits.md fix: prompt registry 2026-02-18 00:34:54 +05:30
image_generation.md fix: prompt registry 2026-02-18 00:34:54 +05:30
image_variations.md New stable release - release notes (#8148) 2025-01-31 10:02:59 -08:00
index.md fix: prompt registry 2026-02-18 00:34:54 +05:30
interactions.md fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
load_test.md fix: prompt registry 2026-02-18 00:34:54 +05:30
load_test_advanced.md fix: prompt registry 2026-02-18 00:34:54 +05:30
load_test_rpm.md docs: usaged-based routing perf warnings (#14080) 2025-08-29 17:31:12 -07:00
load_test_sdk.md (docs) add 1k rps load test doc (#6059) 2024-10-04 16:56:34 +05:30
mcp.md Merge pull request #20509 from ryan-crabbe/docs/mcp-trailing-slash 2026-02-24 16:38:29 -08:00
mcp_control.md fix: prompt registry 2026-02-18 00:34:54 +05:30
mcp_cost.md [MCP Gateway] QA/Fixes - Ensure Team/Key level enforcement works for MCPs (#15305) 2025-10-07 17:34:48 -07:00
mcp_guardrail.md fix: prompt registry 2026-02-18 00:34:54 +05:30
mcp_oauth.md fix: prompt registry 2026-02-18 00:34:54 +05:30
mcp_public_internet.md fix: prompt registry 2026-02-18 00:34:54 +05:30
mcp_semantic_filter.md fix: prompt registry 2026-02-18 00:34:54 +05:30
mcp_troubleshoot.md fix: prompt registry 2026-02-18 00:34:54 +05:30
mcp_usage.md [MCP Gateway] QA/Fixes - Ensure Team/Key level enforcement works for MCPs (#15305) 2025-10-07 17:34:48 -07:00
migration.md
migration_policy.md docs migration policy 2024-08-09 18:06:37 -07:00
moderation.md docs(moderation.md): fix moderation quick start docs 2025-11-07 16:25:08 -08:00
ocr.md [Feat] /ocr - Add VertexAI OCR provider support + cost tracking (#16216) 2025-11-03 15:56:49 -08:00
oidc.md fix: prompt registry 2026-02-18 00:34:54 +05:30
old_guardrails.md Use the -d flag in docs instead of -D (#12179) 2025-06-30 15:25:42 -07:00
projects.md
proxy_api.md Corrected docs updates sept 2025 (#14916) 2025-09-25 15:49:19 -07:00
proxy_auth.md fix: prompt registry 2026-02-18 00:34:54 +05:30
proxy_server.md Contributor PR - Support OPENAI_BASE_URL in addition to OPENAI_API_BASE (#9995) (#10423) 2025-04-29 21:27:37 -07:00
rag_ingest.md fix: prompt registry 2026-02-18 00:34:54 +05:30
rag_query.md fix: prompt registry 2026-02-18 00:34:54 +05:30
realtime.md replaced with mock key 2026-02-24 03:28:28 -08:00
reasoning_content.md Add support for reasoning and tools viaconfig 2026-02-20 16:22:19 +05:30
rerank.md feat: Add IBM watsonx.ai rerank support (#21303) 2026-02-16 20:12:16 -08:00
response_api.md feat: add session_id to have better routing 2026-02-21 18:45:50 +05:30
response_api_compact.md fix: prompt registry 2026-02-18 00:34:54 +05:30
router_architecture.md docs(router_architecture.md): add router architecture docs 2024-11-26 12:54:38 +05:30
routing.md fix: prompt registry 2026-02-18 00:34:54 +05:30
rules.md
scheduler.md docs: usaged-based routing perf warnings (#14080) 2025-08-29 17:31:12 -07:00
sdk_custom_pricing.md
secret.md fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
set_keys.md Contributor PR - Support OPENAI_BASE_URL in addition to OPENAI_API_BASE (#9995) (#10423) 2025-04-29 21:27:37 -07:00
skills.md [Docs] Claude Skills API (#17052) 2025-11-24 15:32:03 -08:00
text_completion.md Guardrails - Responses API, Image Gen, Text completions, Audio transcriptions, Audio Speech, Rerank, Anthropic Messages API support via the unified apply_guardrails function (#15706) 2025-10-25 13:38:57 -07:00
text_to_speech.md fix: prompt registry 2026-02-18 00:34:54 +05:30
traffic_mirroring.md fix: prompt registry 2026-02-18 00:34:54 +05:30
troubleshoot.md fix: prompt registry 2026-02-18 00:34:54 +05:30
vector_store_files.md fix docs 2025-11-15 16:58:47 -08:00
vertex_batch_passthrough.md Litellm sameer oct staging (#15806) 2025-10-24 12:17:22 -07:00
videos.md [Feat] New Provider - Add RunwayML Provider for video generations (#16505) 2025-11-11 18:48:23 -08:00
wildcard_routing.md Litellm dev 12 28 2024 p2 (#7458) 2024-12-28 19:38:06 -08:00