litellm/docs/my-website
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
..
blog Fix phase docs link 2026-02-25 01:21:38 +05:30
docs Add Lakera v2 post-call hook and tests (fixed PII masking) (#21783) 2026-02-25 17:20:38 -08:00
img fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
release_notes docs: update v1.81.12-stable release notes to point to v1.81.12-stable.1 (#22036) 2026-02-24 12:30:18 -08:00
src fix: prompt registry 2026-02-18 00:34:54 +05:30
static fix: prompt registry 2026-02-18 00:34:54 +05:30
.gitignore Inkeep searchbar and chat added to the Docs (#12030) 2025-06-26 10:13:42 -07:00
.trivyignore security fix 2025-11-14 18:43:41 -08:00
babel.config.js updating docs 2023-08-12 11:30:32 -07:00
Dockerfile fix docs warning (#7419) 2024-12-25 16:42:14 -08:00
docusaurus.config.js fix 2025-12-20 15:21:00 +05:30
index.md fix keys 2023-08-17 16:13:52 -07:00
package-lock.json fix(security): fix CVE-2025-69873 and CVE-2026-26996 in docs dependencies (#21782) 2026-02-21 10:56:11 -08:00
package.json security: fix critical/high CVEs in OS-level libs and NPM transitive 2026-02-24 19:40:09 +05:30
README.md updating docs 2023-08-12 11:30:32 -07:00
sidebars.js feat(realtime): guardrail hook for voice transcription (#21976) 2026-02-23 21:04:40 -08:00

Website

This website is built using Docusaurus 2, a modern static website generator.

Installation

$ yarn

Local Development

$ yarn start

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

Build

$ yarn build

This command generates static content into the build directory and can be served using any static contents hosting service.

Deployment

Using SSH:

$ USE_SSH=true yarn deploy

Not using SSH:

$ GIT_USER=<Your GitHub username> yarn deploy

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the gh-pages branch.