PII leaks persist because teams treat masking as text replacement, not data classification

arpit_bhayani · x · 2026-08-28

Arpit Bhayani argues the root cause of PII leakage in LLM systems is nearly always the same: people treat masking as a text-replacement problem instead of a data-classification problem. The typical pattern is wiring a support bot or RAG pipeline to real customer data, running a regex to strip emails and phone numbers, and shipping it.

Regex handles fixed-shape PII like card numbers and emails but misses context-dependent PII such as "the patient in room 4B", where the sensitive part is a relationship between tokens. Classic NER can flag "Alice" as a PERSON from context, yet misses domain-specific identifiers like internal employee ID formats.

What actually works is layered defense:

Original post →

More from coding & agent

coding & agent channel →