presidio

data-privacy-stackMIT活跃维护

微软开源的 PII 检测与脱敏框架,能从文本、图像和结构化数据中识别并匿名化姓名、电话等敏感信息,支持 NLP 与正则规则组合的自定义流水线。

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.

2.2.366发布于 2026-10-27 09:26 UTC11,812star +38 / 7 天1,421fork同步于 2026-11-10 11:28 UTC

怎么上手

由 README 提炼,执行前请确认
pip install presidio-analyzer presidio-anonymizer
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

开源 PII 检测与脱敏 SDK,帮你从文本和图像中识别并匿名化敏感信息

微软开源的 PII 检测与脱敏框架,能从文本、图像和结构化数据中识别并匿名化姓名、电话等敏感信息,支持 NLP 与正则规则组合的自定义流水线。

核心能力

  • 用 NER、正则、规则和校验和识别 PII
  • 支持自定义识别器并接入外部 PII 检测模型
  • 提供文本匿名化与图像 PII 打码模块
  • 可从 Python、PySpark、Docker 到 Kubernetes 部署
  • 支持多语言上下文感知的 PII 识别

容易踩的坑

README 未给出具体安装命令,需查阅官方安装文档;自动检测无法保证找出所有敏感信息,需配合其他防护系统;项目已迁移到新仓库,注意版本与迁移说明

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本2.2.366
  1. 2.2.366Release 2.2.366最新正式版2026-10-27 · 2026-10-27 09:26 UTC

    This is a security release. It raises the Pillow requirement of presidio-image-redactor to 13.0.0, refreshes every lock file to clear 100 known advisories, locks Transformers 5.16.1 in the analyzer, and ships slimmed container images plus new distroless variants. It also drops Python 3.10.

    Packages: presidio-analyzer 2.2.366, presidio-anonymizer 2.2.366, presidio 2.2.366, presidio-image-redactor 0.0.62, presidio-structured 0.0.10.

    Upgrade notes

    • Python 3.10 is no longer supported. Python 3.10 reached end of life on 2026-10-01. All packages now require Python >=3.11,<3.15. Installs on Python 3.10 resolve to the previous releases.
    • presidio-image-redactor requires Pillow 13. The requirement is now pillow>=13.0.0,<14.0.0. Pillow 13 fixes the 41 security advisories (5 critical, 23 high) open against Pillow 12.3.0 (#2393).
    • The spaCy factory hf_token_pipe is gone. The analyzer no longer depends on spacy-huggingface-pipelines. TransformersNlpEngine now registers its own presidio_hf_token_pipe factory. A spaCy pipeline saved with nlp.to_disk() that references hf_token_pipe no longer loads; Presidio never saves such a pipeline itself. Detection results and scores are unchanged.
    • New minimums for the analyzer extras. The transformers extra requires transformers>=4.28.0,<6.0.0. The gliner extra requires gliner>=0.2.29, transformers>=4.51.3,<5.17.0 and a single onnxruntime>=1.19. Installing Transformers 5.10 or later is recommended to pick up the security fixes.
    • Container images no longer ship curl. The image HEALTHCHECK now probes /health with the Python standard library and ignores HTTP_PROXY. The docker-compose.yml healthcheck overrides were removed so the image healthchecks apply. Existing image tags keep their names.

    Security

    • Slimmed and hardened the default analyzer and anonymizer images: the python:3.12-slim and python:3.14-slim bases are re-pinned with OS security updates applied, uv is bind-mounted at build time instead of installed, and setuptools and wheel (plus pip in the anonymizer) are removed from the final image. Trivy critical, high and medium findings drop from 321 to 103 (anonymizer) and from 345 to 113 (analyzer). (#2407)
    • Refreshed every uv.lock file to fix the 100 known advisories in the locked development and CI dependencies, including pillow 13.0.0, virtualenv 21.14.13, pyjwt 2.15.1, aiohttp 3.14.5, urllib3 2.8.0, cryptography 50.0.2, filelock 4.2.4, oauthlib 4.0.0 and certifi 2026.10.23. Apart from the Pillow and onnxruntime requirements above, published dependency ranges are unchanged. (#2409)
    • Locked transformers to 5.16.1 in the analyzer, which fixes GHSA-xrqw-3rrv-vx5w and GHSA-x9r9-c232-4q39. (#2201)
    • Raised the presidio-image-redactor Pillow requirement to 13 and replaced the Image.getdata() call in the DICOM redactor with get_flattened_data(), since getdata() is deprecated in Pillow 13 and removed in Pillow 14. (#2393, #2409)

    Added

    • Distroless container images. The analyzer and anonymizer are also published as distroless images built on Azure Linux, tagged <version>-distroless and latest-distroless in the same GHCR repositories. The unsuffixed tags, including latest, remain the default images. The distroless images contain no shell, package manager, pip or uv, run Python 3.12 as UID 65532, listen on port 3000, and take gunicorn settings through GUNICORN_CMD_ARGS instead of PORT and WORKERS. Trivy findings are 1 (anonymizer) and 6 (analyzer). A docker-compose.distroless.yml override runs them locally. (#2407)

      docker pull ghcr.io/data-privacy-stack/presidio-analyzer:2.2.366-distroless
      docker pull ghcr.io/data-privacy-stack/presidio-anonymizer:2.2.366-distroless
      
    • Context-aware enhancer configuration in YAML. A new optional context_aware_enhancer section in the analyzer configuration sets the `LemmaContextA

  2. 2.2.365Release 2.2.3652026-10-25 · 2026-10-25 19:31 UTC
    查看更新说明

    What's Changed

  3. 2.2.364Release 2.2.3642026-07-22 · 2026-07-22 08:30 UTC
    查看更新说明

    What's Changed

  4. 2.2.363Release 2.2.3632026-06-28 · 2026-06-28 16:21 UTC
    查看更新说明

    What's Changed

  5. 2.2.362Release 2.2.3622026-03-18 · 2026-03-18 05:32 UTC
    查看更新说明

    What's Changed

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Presidio - Data Protection and De-identification SDK

    :mega: Presidio has moved to a new home! Read more here :mega:

    Context aware, pluggable and customizable PII de-identification service for text and images.


    Build Status MIT license Release OpenSSF Best Practices PyPI pyversions Discord

    ComponentDownloadsCoverage
    Presidio AnalyzerPypi DownloadsCoverage
    Presidio AnonymizerPypi DownloadsCoverage
    Presidio Image-RedactorPypi DownloadsCoverage
    Presidio StructuredPypi DownloadsCoverage

    What is Presidio

    Presidio (Origin from Latin praesidium ‘protection, garrison’) helps to ensure sensitive data is properly managed and governed. It provides fast identification and anonymization modules for private entities in text such as credit card numbers, names, locations, social security numbers, bitcoin wallets, US phone numbers, financial data and more.

    Presidio demo gif


    :blue_book: Full documentation

    :mega: Project transition update

    :question: Frequently Asked Questions

    :thought_balloon: Demo

    :flight_departure: Examples


    Goals

    • Allow organizations to preserve privacy in a simpler way by democratizing de-identification technologies and introducing transparency in decisions.
    • Embrace extensibility and customizability to a specific business need.
    • Facilitate both fully automated and semi-automated PII de-identification flows on multiple platforms.

    Main features

    1. Predefined or custom PII recognizers leveraging Named Entity Recognition, regular expressions, rule based logic and checksum with relevant context in multiple languages.
    2. Options for connecting to external PII detection models.
    3. Multiple usage options, from Python or PySpark workloads through Docker to Kubernetes.
    4. Customizability in PII identification and de-identification.
    5. Module for redacting PII text in images (standard image types and DICOM medical images).

    :warning: Presidio can help identify sensitive/PII data in un/structured text. However, because it is using automated detection mechanisms, there is no guarantee that Presidio will find all sensitive information. Consequently, additional systems and protections should be employed.

    Installing Presidio

    1. Using pip
    2. Using Docker
    3. From source
    4. Migrating from V1 to V2

    Running Presidio

    1. Getting started
    2. Setting up a development environment
    3. PII de-identification in text
    4. PII de-identification in images
    5. Usage samples and example deployments

    Support

    Contributing

    For details on contributing to this repository, see the contributing guide.

    This project has adopted the Contributor Covenant Code of Conduct.

    Contributors