Reversible Anonymizer for LLMs
Privacy-preserving PII detection and reversible tokenization for enterprise GenAI & EU AI Act compliance.

Context and problem
Regulated enterprises cannot pass raw customer identifiers, support transcripts, or confidential records into external LLM endpoints without risking GDPR and EU AI Act exposure, yet irreversible redaction breaks downstream business workflows.
An open-source privacy engineering tool designed to detect, mask, and replace sensitive Personally Identifiable Information (PII) with synthetic data before passing prompts to LLMs, with deterministic reversible mapping for downstream response decoding.
My contribution
Designed, authored, and maintain the open-source Python package end to end, publishing versioned releases on PyPI and GitHub under the MIT licence.
Approach and key decisions
- Combined Google Cloud Sensitive Data Protection inspection with deterministic synthetic token generation via Faker so prompts preserve semantic coherence.
- Isolated reversible token vault mappings from model inference payloads so external LLMs never observe raw personally identifiable information.
- Packaged a lightweight, typed Python API suitable for both FastAPI middleware and batch RAG ingestion pipelines.
Outcome
Published as an installable open-source package on PyPI (`reversible-anonymizer`) with full source code, test coverage, and documentation on GitHub.
The source code is public, so the implementation speaks for itself. Questions about design decisions or adapting it to your environment are welcome: get in touch
Architecture Dossier
- Role
- Creator & Maintainer
- Stage
- Active Open Source
- Category
- Security & privacy
- Source code
- Public repository
Technology
- Python
- Google Cloud DLP
- Faker
- GenAI
- FastAPI
Topics
- Cloud DLP
- EU AI Act
- Privacy