Presidio
Open-source PII detection and anonymization framework for text, images, and structured data.
About
Presidio is an open-source data protection SDK for detecting, redacting, masking, and anonymizing personally identifiable information across text, images, and structured data. It combines NLP-based named entity recognition (spaCy, Stanza, Hugging Face transformers), pattern matching, checksums, and custom recognizers in a pluggable Analyzer, with a separate Anonymizer that replaces, masks, hashes, or encrypts the detected spans using configurable operators. The image redactor handles OCR text and DICOM medical images, and the structured module covers tabular columns. It is the standard way to put a PII scrubbing layer in front of LLM or RAG pipelines without vendor lock-in.
Microsoft developed Presidio in the open starting in 2018, and in 2026 the project transitioned to community-led governance under the independent Data Privacy Stack organization, with Microsoft's support and the MIT license unchanged; Docker images moved to ghcr.io/data-privacy-stack. With roughly 11,350 GitHub stars and releases within days of this writing, it is the most adopted open-source PII anonymization framework available. Microsoft's own documentation is candid that Presidio does not guarantee finding all sensitive information, so it belongs as one layer in a defense-in-depth strategy with human review for compliance-critical flows, not as a standalone guarantee.
What it can do
- Pluggable PII Analyzer: NER, pattern, checksum, and custom recognizers
- Anonymizer with replace, mask, hash, redact, and encrypt operators
- Image redactor for OCR text and DICOM medical images
- Structured-data module for tabular PII columns
- 50+ built-in recognizers plus region-specific IDs (DE_*, PH_TIN, and more)
- Common pattern: sanitize LLM inputs and RAG chunks before the model sees them
Setup
- Install via pip:
pip install presidio-analyzer presidio-anonymizer(plus presidio-image-redactor / presidio-structured as needed), or use the Docker images. - Run the Analyzer on your text to get detected PII spans with entity types and scores.
- Pass the spans to the Anonymizer with your chosen operators (replace, mask, hash, encrypt).
- Add custom PatternRecognizers for internal ID formats, and wire the pipeline before LLM calls and after responses.
Prerequisites
Python 3.9+ (or Docker); spaCy or transformer NLP models for the NER backend.
Use cases
Works with
Trust score — 8/10
Scored 8/10 (verified tier, metrics-v1). Evidence: 11,350 GitHub stars, pushed 2026-10-09, not archived, MIT license (GitHub API); Microsoft origin since 2018, 2026 transition to Data Privacy Stack community governance documented (pasqualepillitteri.it, theagenttimes.com); repo verified live. Strengths: de-facto open standard for PII anonymization, permissive license, active maintenance, honest documented limitations. Docked for: (1) Microsoft stewardship ended, community governance is unproven long-term; (2) does not guarantee complete detection, needs layering. License: MIT.
★ 11,350 GitHub stars
How the trust score is built
Full methodology →- Adoption · stars/downloads, log-scaled vs peers
- 10.0/10
- Maintenance · recency, releases, issue load
- 9.0/10
- Openness · license + docs
- 10.0/10
- Manual review · sanity read + red-flag check
- 8.0/10
- · 11,350 GitHub stars, pushed 2026-10-09, not archived, MIT (GitHub API)
- · Microsoft origin 2018; 2026 transition to Data Privacy Stack community governance with Microsoft support
- · De-facto open standard for PII anonymization; Docker images at ghcr.io/data-privacy-stack
- · github.com/data-privacy-stack/presidio verified live
- · Community governance unproven long-term; documented incomplete-detection limitation
Sources
Every fact above was checked against these sources. Where a claim comes from the provider and couldn't be independently verified, the text says so.