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.
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.
Discover more
Agenta
Agenta is a workspace where you and your team build agents and automations.
AnythingLLM
Stop renting your intelligence. Own it with AnythingLLM. Everything you need for a powerful local-first agent experience
AutoGPT
AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
Backlog.md
Backlog.md - A tool for managing project collaboration between humans and AI Agents in a git ecosystem
Codeman
Self-hosted mission control for AI coding agents: run Claude Code, OpenCode, Pi, Codex, and Antigravity & Gemini CLI 24/7, from any device, watch every subagent live
Context7
Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors