Skip to content

PII redaction layer for LLM applications

Consulting to remove CPF and CNPJ numbers, e-mail addresses, phone numbers and names from text before any model, with a policy for each organisation, encrypted audit and an OpenAI-compatible API.

By Wendelmaques Pereira ·

The challenge

Prompts carry customer data. A support ticket, a contract or a call transcript can contain identity numbers, contacts and names.

Each model provider that receives this text becomes one more place where the data lives.

Architecture

  • Detection before every call: rules for identity numbers, e-mail addresses and phone numbers, and a model for names.
  • Markers replace the values. The map from marker to value exists only in memory, during the request.
  • A policy for each organisation: placeholder, redact, block or monitor.
  • Fail closed: if detection fails, the request fails.
  • Audit copies only in encrypted form. Usage records keep categories and counts.

In production

Rota Nacional runs this layer in production as an API compatible with OpenAI and Anthropic.

Limits

  • Detection reduces the risk, but it is not perfect. Unusual names and formats need tests with your data.
  • The layer reads text. Images and audio need extraction first.
  • The monitor policy keeps personal data in the prompt. It is for measurement, not for protection.

Hire me for this

  • A privacy layer in front of your company's LLM calls.
  • Detection tests with your documents, with the hit rate measured.
  • Policies and an audit trail that your compliance team can review.

Looking for something else?Frequently asked questionsGuidesContact