Dev.to
7/29/2026

Document pseudonymization for AI assistants: sending the spreadsheet without sending the customers
Short summary
A detailed technical guide to pseudonymizing documents (spreadsheets, contracts, emails) before sending them to AI assistants, ensuring no personal data leaves the machine. The approach uses bijective same-format surrogate mapping so cross-references survive and restoration is exact. Detection runs in three layers: validated patterns, local NER via Presidio + spaCy, and a dictionary sweep — all running locally without cloud calls.
- •Bijective pseudonymization replaces real values with same-format surrogates, keeping documents plausible for AI reasoning
- •Three-layer detection: validated patterns, local NER (Presidio + spaCy), and dictionary sweep — nothing leaves the machine
- •Restoration is exact reverse substitution with longest-match-first to avoid partial replacements
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



