Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.
Tool · AI & Machine LearningFree

Presidio: PII detection and anonymisation

An open source toolkit, started at Microsoft and now community maintained, that detects personal data such as names, phone numbers and card numbers in text and images, then redacts, masks, replaces, hashes or encrypts it.

Format

Tool

Topic

AI & Machine Learning

Provider

Data Privacy Stack community

Time needed

An afternoon for a first pipeline

Level

Intermediate

Access

Free

What it is

Presidio is an open source data protection toolkit for finding and de-identifying personal information (often called PII, personally identifiable information). It began as a Microsoft project and is now maintained by the Data Privacy Stack community, which is why older links point to a Microsoft GitHub address.

Components

  • Analyzer. Finds entities such as names, phone numbers, email addresses, credit card numbers and national ID formats in text, using patterns, rules and language models. You can add your own recognisers, for example for a local ID card format.
  • Anonymizer. Applies an operator to each detected entity: redact it, replace it with a placeholder, mask part of it, hash it or encrypt it.
  • Image Redactor. Uses OCR (optical character recognition) to find and blank out personal data in images.
  • Structured. Handles tables and semi-structured data.

Why it matters for AI governance

Personal data flows into AI systems constantly: support tickets used to fine-tune a model, chat logs sent to an LLM provider, documents loaded into a retrieval system. Data protection laws such as the GDPR expect data minimisation and appropriate safeguards, and anonymisation or pseudonymisation before data reaches a model is a common control. Presidio is a practical way for engineers to implement it, and a good way for policy people to see what such a control can and cannot do.

The important caveat

Presidio's own documentation warns that automated detection gives no guarantee of finding all sensitive information, so other protections are still needed. Treat it as one layer. Also remember the legal difference: pseudonymised data (where a key or mapping can re-identify people) is still personal data under the GDPR; truly anonymised data is not, and true anonymisation is harder than it looks.

How to use it

Run the analyzer on a few fake support tickets that mix names, phone numbers and order IDs. Look at what it misses and what it flags wrongly, then add a custom recogniser for a local phone or ID format. Write down the false negative rate: that number belongs in a risk assessment.

Free or paid?

Free and open source.

privacydata protectionpythonai governance

Ready to start?

Opens on Data Privacy Stack community in a new tab.

Open resource
Link broken or out of date?

Report a problem

With "Presidio: PII detection and anonymisation". Only Tauseef reads this.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.