Back to services

presidio

An open-source framework for detecting, redacting, masking, and anonymizing sensitive data (PII) across text, images, and structured data. Supports NLP, pattern matching, and customizable pipelines.

View alternatives to presidio
Suggest edit
Open source
Self-hostable
MIT
Recent reviews

Alternatives

Tech stack

No tech stack added yet. Sign in to suggest some

Note: Fetching the official website failed, so the following content is based on what is known about the Presidio project. For version details, please refer to the official website and the GitHub repository.

Overview

The name Presidio comes from the Latin word praesidium, meaning "protection" or "guard." It is Microsoft's open-source data protection and de-identification toolkit, used to quickly identify and anonymize sensitive information in text, images, and structured data, such as names, locations, phone numbers, email addresses, credit card numbers, ID document numbers, and IP addresses.

Main Components

  • Presidio Analyzer: Detects PII entities in text. It combines several approaches: named entity recognition (NER), regular expressions, rule-based logic, checksum validation, and context word enhancement.
  • Presidio Anonymizer: De-identifies sensitive content based on detection results. It has built-in operators for replacing, deleting (redact), masking, hashing, and encrypting, and also supports custom operators. Encrypted content can be restored (deanonymized).
  • Presidio Image Redactor: Uses OCR to find sensitive text in images and redact it, and supports DICOM medical imaging files.
  • Presidio Structured: Detects and de-identifies PII in structured or semi-structured data such as tables and JSON.

Target Users and Use Cases

It suits data engineers, machine learning engineers, security and compliance teams, and developers who handle user data. Common uses include: cleaning private information out of data before passing it to a large language model (LLM), de-identifying logs, customer service conversations, and medical records, preparing anonymized datasets for testing and analytics, and meeting the requirements of privacy regulations such as GDPR.

Key Strengths

  • Extensible: You can create custom recognizers to add new entity types, languages, or business rules.
  • Pluggable NLP engines: Supports models such as spaCy, Stanza, and Hugging Face Transformers.
  • Multilingual: Once the appropriate NLP models are configured, it can recognize text in multiple languages.
  • Flexible deployment: It can be embedded in applications as a Python library, deployed as a REST service with Docker, or plugged into big data pipelines such as Spark for batch processing.
  • Free and open source: Licensed under MIT, with the code hosted on GitHub (microsoft/presidio).

Installation and Deployment

Python installation:

pip install presidio-analyzer presidio-anonymizer
python -m spacy download en_core_web_lg

Simple example:

from presidio_analyzer import AnalyzerEngine
from presidio_anonymizer import AnonymizerEngine

text = "My phone number is 212-555-5555"
results = AnalyzerEngine().analyze(text=text, language="en")
print(AnonymizerEngine().anonymize(text=text, analyzer_results=results).text)

Docker deployment: Official container images are provided for the Analyzer, Anonymizer, and Image Redactor, which you call through an HTTP API once deployed.

Technical Requirements

  • Python 3 (check the official documentation for the specific supported versions)
  • NLP models, such as spaCy language models (these are large, so reserve enough disk space and memory)
  • Image redaction requires Tesseract OCR to be installed

Notes

Presidio detects PII automatically and cannot guarantee that all sensitive information will be found. The official documentation also cautions that when used in production or compliance scenarios, you should carry out additional evaluation and customization for your specific business.