Ivan Savchenko
← All demos
PII Shield

Strip personal data before it reaches the LLM — and put it back

An OpenAI-compatible gateway that swaps names, emails, card numbers and secrets for placeholders.

1.8%
gold PII values reached the provider (support-chat policy, 6 of 330)
0.96
detection F1, partial match (202 docs, 13 types, 5 languages; 0.96 on the 36 held-out docs too)
67 ms
mean per document, CPU only (p95 80 ms)
39/39
placeholders in real model answers restored correctly
Interactive demo

Redact it yourself

Paste any text. Everything is detected in your browser. Turn the name detector off to see what patterns alone miss.

A small browser version with a deterministic fake model — no API key, nothing leaves your device. The real project is in the repo.

What it solves

Support tickets, CRM notes and emails contain names, phone numbers and card numbers, and contracts, GDPR or the security team often say they must not be sent to a third-party LLM provider.

How it works

  1. Patterns with validators (Luhn, IBAN checksum) catch structured data precisely.
  2. A NER model (GLiNER, CPU) finds names and addresses that patterns cannot.
  3. The model sees only placeholders like [PERSON_1]; the real values are restored in its answer.

The honest verdict

6 of 330 gold values (1.8%) still reached the provider under the support-chat policy: a lone first name, a lowercase name, a Russian and a US street address, and two secret formats the patterns do not know (both secrets come from the held-out split). Patterns alone let 57% through — precise, but they only catch structured data. On the 36 held-out documents detection F1 was 0.96 as well (97.1% of values redacted, against 98.2% overall). Redacted replies were as good or better in 65% of blind comparisons (13 of 20), against a 70% noise floor for two samples of the same prompt; with 20 documents that gap is not statistically meaningful, and a second judge rated the same answers 55%.

PythonGLiNER (NER)Regex validators
Next demoClearance →