How to prevent PII leakage to LLM providers

PII leaks to LLM providers through three paths. Here is why regex alone fails, and how to choose between redaction, blocking, and tokenization.

Direct answer: Prevent PII leakage by inspecting prompts and responses inline at the gateway, redacting sensitive values before transmission, and auditing every redaction event.

The three leak paths

  • Outbound prompts user or application content containing PII.
  • Inbound responses providers echoing sensitive values back.
  • Tool calls agents passing sensitive data to external tools.

Why regex alone fails

Regex misses contextual identifiers, produces false positives on formatted data, and cannot distinguish a real account number from a test fixture. Semantic classification and format validation reduce both false positives and misses.

Redaction vs. blocking vs. tokenization

  • Redaction replace with synthetic or tagged placeholders; preserves LLM utility.
  • Blocking reject the request outright; simplest but reduces productivity.
  • Tokenization replace with reversible tokens; supports downstream re-identification.

Air-gapped detection

If your detector calls out to a third-party moderation API, you have just moved the leak, not fixed it. Detection must run in-process, inside your perimeter.

Audit trails for SOC 2, HIPAA, and the EU AI Act

Every redaction should produce a timestamped, identity-stamped audit event exported to your SIEM.

Next: Talk to sales to see Assert running on your own data, or explore the full product.

See Assert on your own data

Deploy air-gapped in your private cloud. Block sensitive data, classify risk, and keep control of every request.

Talk to sales