Privacy Middleware Concept: Anonymize Sensitive Data Locally Before It Reaches LLMs

Ai_MOON_SHOT · reddit · 2026-09-24

A Reddit developer shares a privacy middleware concept that sits between an app and an external LLM: sensitive data (names, emails, IDs, medical/financial info) is detected locally, replaced with consistent placeholders like <PERSON1>, sent to the model, then restored from a locally-kept mapping after the response returns. Key design points: regex alone won't suffice (needs rules + local NER), placeholders must stay consistent across multi-turn conversations, the mapping needs encryption and strict access control, responses must be validated before restoration, and format-preserving synthetic values are an option. The author seeks feedback on detection reliability and existing open-source solutions.

Original post →

More from coding & agent

coding & agent channel →