# Presidio

> Open-source framework for detecting, redacting, masking, and anonymizing PII in text, images, and structured data.

Presidio is an open-source SDK from the Data Privacy Stack organization that identifies and anonymizes private entities such as credit card numbers, names, locations, and social security numbers in text and images. It was originally created at Microsoft and is now a community-governed project. It is available as Python packages and as Docker-based REST services.

## What It Is

Presidio is a library suite for PII detection and de-identification, meant to be customized to an organization's needs rather than used as a hosted service. Its modules are the Analyzer (PII identification in text), the Anonymizer (de-identify detected entities using operators), the Image Redactor (OCR plus PII identification to redact images), and Structured (PII detection in tabular and semi-structured data).

## How Detection and Anonymization Work

The Analyzer combines Named Entity Recognition, regular expressions, rule-based logic, checksums, and context words across multiple languages. It ships predefined recognizers for global entities and country-specific identifiers for many countries, plus medical entities through an optional NER recognizer. Users can add custom recognizers, connect external PII detection models or services, and tune confidence thresholds to manage false positives and negatives. The Anonymizer can remove, redact, hash, or encrypt detected entities, and custom operators can be added.

## Customization and Deployment

Presidio supports spaCy and Stanza for NLP, and recognizers can use Transformers or Flair. Documented deployment options include Python or PySpark workloads, Docker, Kubernetes, Azure Data Factory, and Spark. The docs note that the API endpoints have no built-in authentication, so an authentication layer should be placed in front of them. The project warns that automated detection cannot guarantee finding all sensitive information.

## Features
- PII analyzer for text with predefined and custom recognizers
- NER, regex, rule-based and checksum detection with context
- Anonymizer with redact, hash, encrypt and custom operators
- Image redactor using OCR, including DICOM images
- Structured and semi-structured data PII detection
- Multi-language support
- External PII model and remote recognizer connections
- REST API via Docker
- YAML no-code configuration
- Deployment samples for Kubernetes, Spark, and Azure Data Factory

## Integrations
spaCy, Stanza, Hugging Face Transformers, Flair, GLiNER, Azure AI Language, Azure Health Data Services, Kubernetes, Spark, Azure Data Factory, LiteLLM, Streamlit

## Platforms
MACOS, LINUX, API, DEVELOPER_SDK, CLI

## Pricing
Open Source

## Version
2.2.364

## Links
- Website: https://presidio.dataprivacystack.org
- Documentation: https://presidio.dataprivacystack.org/getting_started/
- Repository: https://github.com/data-privacy-stack/presidio
- EveryDev.ai: https://www.everydev.ai/tools/presidio
