Free · Daily brief + weekly playbookDaily 60-sec AI Voice Brief + Weekly Production AI Agent PlaybookGet the brief →
ReleaseCode / SDK · ActionableHabr AI→ original

The Best Open-Source Anonymizers Leak Personal Data in One Out of Three Documents

An anonymizer replaces names, passport numbers and account numbers in a document with placeholders like [PERSON_1], so a contract can be sent to an LLM. The author tested five open-source anonymizers on 2,000 synthetic documents, in Russian and British English. Even the best tools left at least one real value in roughly one document out of three: 31.5% for pii-guard and 33.0% for OpenAI privacy-filter. Before you deploy, test your filter on documents where the numbers are written out in words.

AI-processed from Habr AI; edited by Hamidun News
The Best Open-Source Anonymizers Leak Personal Data in One Out of Three Documents
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
Key metric #1pii-guard missed numbers in the hard-format subset in 314 of 397 documents
Key metric #2The author's own engine, pii-roundtrip, left a leak in 0.3% and 0.2% of documents
Key metric #3Russian names came back correctly after the model's reply in 94.6% of cases at a 99% threshold

An anonymizer is a program that, before a contract or résumé is sent to ChatGPT or DeepSeek, replaces names, passport numbers and addresses with placeholders like [PERSON_1], then restores the real values in the model's reply. The developer tested five open-source anonymizers on 2,000 synthetic documents: 1,000 in Russian and 1,000 in British English. The results are discouraging. Even the best tools left at least one real value in roughly one document out of three: 31.5% for pii-guard on Russian and 33.0% for OpenAI privacy-filter on British English. For teams that send contracts and letters to LLMs, this means a ready-made filter cannot be trusted without your own testing.

Why this matters

Employees upload work documents to AI chatbots because it is faster. The Babushkinsky District Court in Moscow upheld the dismissal of a sales director who had sent reports from corporate Power BI to DeepSeek (case No. 02-1545/2026). The court found this amounted to disclosing a trade secret. According to a survey by SearchInform of 120 information security specialists, 40% of organizations experienced incidents involving AI services in 2026, compared with 6% a year earlier. The main motive, cited by 78% of respondents, was to work faster and more easily.

Bans do not remove that motive: a lawyer needs to review a contract, an HR specialist needs to write a letter based on a résumé. That is why teams use reversible pseudonymization. The model sees only placeholders, while the mapping table stays stored locally. The scheme works only if the filter has found everything: a single missed value goes to an external service.

How they tested and what they found

The comparison included pii-guard, GLiNER Guard Omni, Presidio, OpenAI privacy-filter, Prompt Anonymizer, and a baseline based on regular expressions with checksums. For Presidio, the author added his own Russian recognizers for passport, SNILS, INN, account and Mir card numbers. The final set comprised contracts, certificates, letters, HR documents and hospital discharge summaries. Numbers in them are written as digits, with dots, with typos, and in words; such hard-format entries appear in about 40% of documents. The rules, file hashes and test plan were published before the first run, and each tool went through the set once.

Share of documents where at least one original value remained, including organization names (lower is better):

  • pii-guard: 60.8% on Russian; does not support British English;
  • GLiNER Guard Omni: 99.6% on Russian and 58.3% on British English;
  • Presidio: 87.1% and 61.1%;
  • OpenAI privacy-filter: 97.0% and 81.1%;
  • Prompt Anonymizer: 100% on British English. It is designed for Japanese data, so this reflects a mismatch with the task rather than poor quality;
  • regular expressions: 100% on both languages, because they search only for numbers, emails and phone numbers.

pii-guard and OpenAI privacy-filter do not search for organizations at all. If you count only the data types each tool supports, the best results are 31.5% for pii-guard on Russian and 33.0% for OpenAI privacy-filter on British English. The author added this tally after the rules were set, so it is descriptive.

Tools struggle most with hard-format entries. pii-guard missed a value in 1 of 603 documents with ordinary numbers, but in 314 of 397 documents with numbers written in words, with dots, or with typos. A card number written in words ("two two zero two — three nine six four…") was not caught by Presidio, GLiNER Guard or OpenAI privacy-filter. A passport written with dots (97.09.710811) was missed by pii-guard, and "Stepanova F.V." with initials was missed by GLiNER Guard. On external datasets the results are milder, but no existing tool passed all thresholds.

The author's own engine and where it failed

The author built pii-roundtrip on top of pii-guard and GLiNER Guard Omni. He added checksum validation, number search with any separators and in words, rules for organizations and initials, and agreement of names across grammatical cases. On the final set, the value remained visible in 0.3% of Russian and 0.2% of British English documents. An important caveat: the engine was developed on documents from the same generator, and the other tools were not tuned for them, so the gap will be smaller on real documents. The author ran the benchmark on one of the participants.

The full cycle of cleaning, model reply and restoration was tested with local qwen3.5:9b and gemma4:12b. For British English, everything worked. For Russian, name placeholders came back correctly only in 94.6% of cases for the weakest model at a 99% threshold. At least one error appeared in roughly one Russian reply out of four. Of 288 failed occurrences, in 199 the name was kept correctly but inflected incorrectly, in 82 it was in the wrong form, and in 7 the evaluator made a mistake. The main cause is surname declension: pymorphy3's dictionary, on its first parse, treats "Kharitonov" as a first name rather than a surname.

Story

Key Questions Answered

Why this matters?

Employees upload work documents to AI chatbots because it is faster. The Babushkinsky District Court in Moscow upheld the dismissal of a sales director who had sent reports from corporate Power BI to DeepSeek (case No. 02-1545/2026). The court found this amounted to disclosing a trade secret. According to a survey by SearchInform of 120 information security specialists, 40% of organizations experienced incidents involving AI services in 2026, compared with 6% a year earlier.

How they tested and what they found?

The comparison included pii-guard, GLiNER Guard Omni, Presidio, OpenAI privacy-filter, Prompt Anonymizer, and a baseline based on regular expressions with checksums. For Presidio, the author added his own Russian recognizers for passport, SNILS, INN, account and Mir card numbers. The final set comprised contracts, certificates, letters, HR documents and hospital discharge summaries.

What are the key details on The author's own engine and where it failed?

The author built pii-roundtrip on top of pii-guard and GLiNER Guard Omni. He added checksum validation, number search with any separators and in words, rules for organizations and initials, and agreement of names across grammatical cases. On the final set, the value remained visible in 0.3% of Russian and 0.2% of British English documents. An important caveat: the engine was developed on documents from the same generator, and the other tools were not tuned for them, so the gap will be smaller on real documents.

ZK
Zhemal Khamidun — Head of AI at Alpina Digital · MIPT (academic supervisor of the Tech Entrepreneurship department). Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

Test Frontier LLMs & Autonomous Agents in One Workspace

Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.

Try Nomad AI →Launch Nomad Agent
Jemal Hamidun

Editor-in-chief · Cite this analysis

Jemal Hamidun

Head of AI at Alpina Digital · Academic Supervisor of the Tech Entrepreneurship Department at MIPT

Head of AI & CPO of AlpinaGPT at Alpina Digital, Academic Lead of Tech Entrepreneurship at MIPT. Founder of Hamidun News and Vibe Academy.

Ready-to-paste citation for journalists, blogs and Telegram channels

Source: Hamidun News — The Best Open-Source Anonymizers Leak Personal Data in One Out of Three Documents https://news.hamidun.com/en/news/18410/the-best-open-source-anonymizers-leak-personal-data-in-one-o

What do you think?
Loading comments…