[nonimo]
EN
Download the app

LiteLLM guardrails for PII: Presidio or Nonimo Gateway

· Written and maintained by Nonimo

If you already run LiteLLM in front of your models, you do not need a second router to keep personal data out of LLM calls. LiteLLM stays where it is, and you choose the PII filter behind it: the Presidio guardrail LiteLLM documents, or the plugin for Nonimo Gateway.

Nonimo Gateway runs on your own servers. See plans and get in touch.

This is an integration guide, not a case for replacing LiteLLM. It covers how LiteLLM guardrails work, what the Presidio guardrail does and does not document, the smaller built-in options, and where Nonimo Gateway fits.

LiteLLM and its guardrails, in brief

LiteLLM is a router: it puts one OpenAI-compatible interface in front of “100+ LLMs”, self-hosted, with virtual keys and cost tracking. Your application talks to it as it would to OpenAI, and guardrails run inside the proxy, so adding one does not change your code:

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://litellm.your-company.internal",  # your LiteLLM proxy
    api_key=os.environ["LITELLM_KEY"],  # a LiteLLM virtual key
)

Three guardrail behaviours matter for PII:

Per-key control, tag-based modes, model-level guardrails and team restrictions are marked “This feature requires a LiteLLM Enterprise license”, which has custom pricing. The basic configuration is in the MIT-licensed proxy.

The Presidio guardrail

This is the most complete PII option LiteLLM documents.

Where it gets thin:

The other built-in routes

Content Filter. A built-in, on-device regex and keyword filter with prebuilt patterns for us_ssn, email, us_phone, visa, mastercard and amex. It can BLOCK (HTTP 400) or MASK with a label such as [EMAIL_REDACTED], and in during_call mode it checks streaming chunks. Its patterns are US formats, and the page does not describe restoring masked values.

Generic Guardrail API. A beta contract, POST /beta/litellm_basic_guardrail_api, that lets an external service receive the texts and tool call fields and answer BLOCKED, NONE or GUARDRAIL_INTERVENED. The default is fail closed. The page does not cover streaming.

Custom guardrail. A Python class where “You only have to implement one method: apply_guardrail.” For streams, async_post_call_streaming_iterator_hook is where real-time filtering lives. Restoring values in a stream is then code you write and maintain.

Presidio guardrail compared with Nonimo Gateway

Presidio guardrail in LiteLLMNonimo Gateway
Role next to LiteLLMGuardrail calling your Presidio containersPlugin for LiteLLM, or an OpenAI-compatible endpoint on its own
What you runPresidio Analyzer and Anonymizer, plus language modelsNonimo Gateway on your own servers
Restores real valuesYes, output_parse_pii for replace operationsYes, real values back in the answer
StreamingNot mentioned on its pageReal values back in the answer
Languages and IDsPresidio’s, English by defaultNational documents per country, such as Spanish DNI/NIE/NIF, German Steuer-ID, French NIR, Italian codice fiscale, Brazilian CPF, Mexican RFC and CURP
LicenceMIT, with Enterprise features on custom pricingPlans on the Nonimo Gateway page

If your data is English and you already run Presidio, the Presidio guardrail is a small step. If your documents carry European or Latin American IDs, that is where the plugin comes in.

How Nonimo Gateway does it

Nonimo Gateway is a private proxy that replaces personal data before a request reaches the LLM API and restores the real values in the response. It runs on your own servers.

For LiteLLM users, there is a Nonimo Gateway plugin for LiteLLM, so you keep LiteLLM as your router. It recognises the national documents and numbers of each country it serves, including Spain’s CUPS number alongside the IDs above. If you do not run LiteLLM, the Gateway also works on its own as an OpenAI-compatible endpoint: you change base_url and keep your code. You keep your own OpenAI key, and plans and prices are on the Nonimo Gateway page.

Whichever route you take, replacing identifiers is pseudonymisation, not anonymisation; our guide on de-identified versus anonymised data explains the difference. It sits inside a wider process: a written rule for staff, such as our AI policy template, and a plan for when something slips, as in is putting client data in ChatGPT a data breach. If you are also moving off the archived LLM Guard toolkit, see our LLM Guard alternative guide.

Keep LiteLLM, add the plugin

You do not have to rebuild your router to protect personal data in it. Add Nonimo Gateway behind LiteLLM and keep everything else as it is. See Nonimo Gateway’s plans and get in touch for the plugin details.

Sources

Checked 20 October 2026.


This page is for information. Product details of other vendors were checked on their official pages on 20 October 2026 and can change.

Nonimo is the software that does this on your own computer: it redacts client names and IDs before your text reaches ChatGPT. No account needed, and the app does it without your files leaving your machine.

Common questions

Does LiteLLM detect PII on its own?

Partly. LiteLLM has a built-in Content Filter with prebuilt patterns for US Social Security numbers, emails, US phone numbers and Visa, Mastercard and Amex card numbers. For broader detection it relies on guardrails you connect, such as Presidio, a third-party service or the Nonimo Gateway plugin.

Can LiteLLM put the real values back into the response?

Yes, with the Presidio guardrail. LiteLLM documents an option called output_parse_pii that checks the LLM response and replaces the masked tokens with the original values, for Presidio replace operations.

Do LiteLLM guardrails run on streaming requests?

LiteLLM states that a guardrail runs on both streaming and non-streaming requests by default, and a stream_scope setting can restrict that. How each guardrail behaves on a stream is documented per guardrail, and the Presidio page does not cover it.

What do I need to run the Presidio guardrail in LiteLLM?

A deployed Presidio Analyzer container and a Presidio Anonymizer container, which LiteLLM calls. Language support is whatever your Presidio set-up provides, and Presidio is English by default.

Are LiteLLM guardrails free?

The basic guardrail configuration is in the open-source proxy, which is MIT licensed outside its enterprise directory. Some controls, such as per-key guardrails, tag-based modes, model-level guardrails and team restrictions, require a LiteLLM Enterprise licence, which has custom pricing.

Can I use Nonimo Gateway with LiteLLM?

Yes. There is a Nonimo Gateway plugin for LiteLLM, so LiteLLM stays your router and Nonimo Gateway handles the personal data. Plans and contact details are on the Nonimo Gateway page.

Tools

Remove personal information from a file or text before AI reads it. Or cover the details on a copy of your ID and add a watermark before you send it.

All tools →