Skip to main content

↑↓ Navigate · ↵ OpenESC Close
Omotayo Aina

Language

Interface only. Articles and project write-ups stay in English.

Theme
MEDIUM · PYPIAI & Security8 min read

Reversible Anonymizer: A Python Package for Retrievable Text Anonymization

Reversible Anonymizer Python package preview card for Google Cloud DLP text anonymization
medium.com/@ainaomotayoMedium (syndicated publication, opens in a new tab)

When teams redact personal data with static placeholders like [REDACTED], downstream language models lose entity coreference and business workflows cannot restore real values for authorized recipients. I built reversible-anonymizer as an open-source Python package to solve both problems cleanly.

Core Package Capabilities

  • Full Google Cloud DLP InfoType Coverage: Inspect free-form text against Google Cloud Sensitive Data Protection detectors without writing brittle regular expressions.
  • Consistent Surrogate Mapping: Replace repeated entities with identical realistic or tokenized surrogates within a session so RAG prompts keep semantic continuity.
  • Pluggable Cache Backends and Batching: Support local, Redis/Memorystore, or Firestore token vaults alongside batch operations for high-throughput document ingestion.

Anonymization and Recovery Flow

  1. Detect sensitive spans through Cloud DLP and replace each unique entity with a deterministic surrogate.
  2. Persist the mapping table inside an access-controlled vault separate from LLM prompt logs and vector stores.
  3. Re-identify model responses on egress only for callers holding decryption authority.

Install from PyPI, inspect the MIT-licensed repository on GitHub, or read the launch post on Medium.