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:
- Structural detectors for fixed-shape data
- NER for free-text entities
- A domain-specific rule layer for your own schema
More from coding & agent
- Antirez Open Sources Code, Invites Agents to Use It — antirez · 2026-08-28
- DeepSeek Open Source Project Hits 200k Stars with Plugin-Based Design — omarsar0 · 2026-08-28
- Context Engineering Guide: Structuring Info for Reliable Agents — Pavan_Belagatti · 2026-08-28
- AI agents might expose sensitive data buried in Git history — doodlestein · 2026-08-28
- Using Agents and Small Models to Bootstrap Object Detection Data — vanstriendaniel · 2026-08-28
- 27B model with 5 skills outperforms expectations on healthcare workflows — Ubunta · 2026-08-28