guardrails capability group. It adds two tenant-edge checks to LiteLLM:
PII masking through self-hosted Presidio, and prompt-injection blocking through LiteLLM’s built-in
content filter. The decision record is ADR-0034.
Model
presidio-pii-mask: runs in LiteLLMpre_callmode. Presidio analyzer and anonymizer run in theguardrailsnamespace and mask email, phone, credit card, US SSN, IBAN, and person entities before the request leaves LiteLLM.prompt-injection-block: runs in LiteLLMpre_callmode. Matching prompts return HTTP 400 before any model is called, so this check does not need a GPU.- Resolver wiring:
scripts/resolve-guardrails.shwritesclusters/<env>/litellm-guardrails.generated.yaml. When the feature is off, that file is an empty no-op overlay. When it is on, LiteLLM receives theproxy_config.guardrailsblock.
1. Enable
llm-gateway layer:
guardrails catalog group deploys Presidio. The llm-gateway-core LiteLLM app consumes the
generated overlay.
2. Verify
Run the smoke test:- Injection prompt returns HTTP 400.
- Presidio detects PII entities.
- The PII call through LiteLLM returns HTTP 200 when the
embeddingsmodel is Ready.
3. Tune
The default entity list and injection categories live inscripts/resolve-guardrails.sh. Edit the
resolver, then regenerate:
clusters/<env>/litellm-guardrails.generated.yaml
together. Do not hand-edit the generated file.
4. Troubleshoot
Check that the feature selected both pieces:platform/guardrails/presidio-analyzer.yaml.
If make guardrails-smoke says the LiteLLM master key is missing, seed or sync the LiteLLM secrets
first:
5. Disable
Setfeatures.guardrails: false, run make resolve-groups, commit, and push. Argo prunes the
Presidio app group and LiteLLM receives the no-op guardrails overlay.