Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

polanon

Latest version: v0.4.4

Overview

Last scanned
24 Nov 2026
Published
24 Nov 2026
PyPI package Publisher: BoroMat
41 Stars
11 Forks
19 Versions
2.6K Downloads
Python Repo language

Scan summary

polanon was last scanned on 24 Nov 2026 at version 0.4.4. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 19 versions; the latest 4 were published within 6 days (19–24 Nov 2026).
  • Findings: No rules fired in version 0.4.4.
  • Downloads: 2,552 downloads.

Versions

19 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.4.4 LATEST 24 Nov 2026 No rules fired
0.4.3 22 Nov 2026 No rules fired
0.4.2 22 Nov 2026 No rules fired
0.4.1 19 Nov 2026 Not shown
0.4.0 17 Nov 2026 Not shown

No rules fired in 0.4.4

Findings

Findings for v0.4.4. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.4.4; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

polanon

CI Python 3.11+ License: MIT

English | Polski

Reversible PII masking for LLM calls, Polish-first. Mask personal data before a prompt leaves your network, send only tokens to the model, and put the originals back into its answer, even while it streams. Pure Python: the standard library is the whole core.

Written about us

Without writing code, with the gateway in Docker. Claude Code, n8n, Open WebUI, LibreChat, Hermes Agent and any other tool that speaks the OpenAI or Anthropic API keep working as they did, and every call is masked before it leaves:

export POLANON_UPSTREAM_KEY=sk-...                 # your provider's key
export POLANON_GATEWAY_KEY=$(openssl rand -hex 16)  # the key your tools will send
docker run --rm -p 127.0.0.1:8787:8787 -e POLANON_UPSTREAM_KEY -e POLANON_GATEWAY_KEY \
    ghcr.io/boromat/polanon-gateway:0.4 --upstream https://api.openai.com/v1

Then give the tool http://127.0.0.1:8787/v1 as its base URL and the value of POLANON_GATEWAY_KEY as its API key. One gateway serves one provider: for Claude Code start another with --upstream https://api.anthropic.com/v1, an Anthropic key and -p 127.0.0.1:8788:8787, then run ANTHROPIC_BASE_URL=http://127.0.0.1:8788 ANTHROPIC_API_KEY=$POLANON_GATEWAY_KEY claude. Every tool, the gateway without Docker, and what it does with a call are in the gateway's section.

In Python, in your own code: mask a text, send it, restore the answer.

pip install polanon
from polanon import Anonymizer, default_guards

anonymizer = Anonymizer(default_guards(with_ner=False))

result = anonymizer.anonymize_sync(
    "Proszę o korektę faktury dla Jana Kowalskiego, PESEL 50810112354, "
    "konto PL61109010140000071219812874, mail jan.kowalski@example.com."
)
print(result.anonymized)
# Proszę o korektę faktury dla <OSOBA_1>, PESEL <PESEL_1>, konto <IBAN_1>, mail <EMAIL_1>.

answer = "Korekta dla <OSOBA_1> (PESEL <PESEL_1>) jest gotowa."  # what the model replied
print(Anonymizer.restore(answer, result.mapping))
# Korekta dla Jana Kowalskiego (PESEL 50810112354) jest gotowa.

The model only ever sees <OSOBA_1>. The mapping that turns it back into a name never leaves your process. anonymize_sync works in scripts, Django and Flask views, Celery tasks and notebooks; in async code, await anonymizer.anonymize(...) does the same work in a worker thread.

Why another PII library

General-purpose tools are built around English. Polish data needs three things they do not do out of the box:

  • Checksums. A PESEL, NIP, REGON, ID card number, IBAN or payment card is validated, not just pattern-matched: the checksum rejects most random digit strings (for a PESEL, together with the birth date, about 98% of them), while a valid number always passes. KRS numbers, which have no public checksum, and passports are recognised next to their label as well. Eleven digits right after the word PESEL are masked even with a typo in them.
  • Seven grammatical cases. "Jan Kowalski", "Jana Kowalskiego" and "z Janem Kowalskim" are the same person. Polish first names are recognised in every case, in lowercase and typed without Polish letters, together with the surname that agrees with them, without any language model.
  • Polish model labels. Polish spaCy models tag people as persName, not PERSON. A pipeline configured for English labels finds no names at all, and says nothing about it.

It also reads foreign invoices: EU, UK and Swiss VAT numbers, company register numbers, Bankgiro, Plusgiro and sort codes, international phone numbers, street addresses and postcodes.

How it compares

polanon Presidio pii-veil piimask
Restores the model's answer Yes, from stable tokens such as <OSOBA_1>, also while it streams Not built in: its deanonymizer decrypts spans at known positions; its docs include a sample that restores an LLM answer Yes, from stable tokens and a saved mapping Yes, from stable tokens
Polish identifiers with a checksum PESEL, NIP, REGON, ID card, IBAN, payment cards PESEL; IBAN and payment cards in general PESEL, NIP, REGON, IBAN, payment cards; ID card and passport by pattern only None; IBAN and payment cards in general
Polish names in every grammatical case For listed first names and the surnames that agree with them, without a language model; spaCy adds the rest With a Polish spaCy model and its persName label mapped Not detected Not detected; its README suggests adding an NER model
What the core needs Nothing beyond the standard library spaCy, numpy, pydantic and a few more; a language model only for names and places pii-core and typer Nothing beyond the standard library
On Polish data neither was tuned on (OpenPII, KPWr) 72% of 5,255 values masked whole with pl_core_news_md, 306 false alarms; 90% of people in real text 66%, 2,641 false alarms; 90% of people (presidio-analyzer 2.2.366, same model) Not measured Not measured
On polanon's own sample documents, tuned on 99% fully masked with pl_core_news_md, 93% with rules alone 67% with the same model Not measured Not measured
License MIT MIT Apache-2.0 MIT

Compared from each project's own documentation and source on 3 November 2026; measured on 17 November 2026. Only Presidio was run, with the scripts in benchmarks/. polanon's own thirteen documents are not neutral ground: its author wrote them and tuned its rules on them, and Presidio had only the Polish model, also for the three invoices from abroad. The Polish rows of ai4privacy's OpenPII and CLARIN-PL's KPWr are: polanon was never tuned on the parts measured, and on them the gap narrows to five points and eight times fewer false alarms, with a tie on people, where the same spaCy model does the work. Presidio wins on random codes written without a label, which it reads with low-score patterns that also mark product codes and order numbers. Each has its place: Presidio for many languages, structured data and its Azure integration; pii-veil for Polish identifiers under Apache-2.0 when names do not matter; piimask for language-neutral identifiers (e-mail, phone numbers, payment cards, IBAN, IP addresses, URLs) and US social security numbers, with fake-value, hashing and partial strategies and an encrypted vault. polanon is for Polish text on its way to a model, where the names in it and the restored answer matter as much as the numbers.

Install

You want Install
Identifiers, contacts, secrets, Polish names, companies by legal form pip install polanon
Also places, and names and organisations no rule can see pip install "polanon[ner]" then python -m spacy download pl_core_news_md
The stage-2 judges (a local Ollama model, or a remote one) pip install "polanon[judge]"
Components for Haystack 3 pipelines pip install "polanon[haystack]"
A gateway for tools that use the OpenAI API pip install "polanon[gateway]"
The gateway as a Docker image, with the spaCy model inside docker pull ghcr.io/boromat/polanon-gateway:0.4

Then use default_guards() with the model, or default_guards(with_ner=False) without it. Another spaCy model is one argument away: default_guards(spacy_model="pl_core_news_lg"). Package names copied from pip work too (pl-core-news-lg). A local model directory can be passed as a path; it must contain meta.json and config.cfg. Missing packages or model directories are reported when the guards are built, while the model itself loads on first use. An installed model package takes priority over a local path with the same name.

From the command line

Text comes from the arguments, from a file with --file, or from standard input. Masked text goes to stdout and the mapping to stderr, or to a file with --mapping:

polanon --version  # print the installed version
polanon "Jan Kowalski, PESEL 50810112354"
polanon --file umowa.txt --ner --mapping mapping.json > masked.txt
cat umowa.txt | polanon --ner > masked.txt 2> mapping.json
polanon --restore --mapping mapping.json --file answer.txt  # the model's answer, restored
polanon --json "Jan Kowalski, PESEL 50810112354"  # {"text": "...", "mapping": {...}}

--restore puts the originals back into masked text, such as the model's answer, with the mapping --mapping wrote, a person named in another case included; a token the mapping does not hold stays as it is. --json writes one JSON object to stdout instead, for a script: the text, and the mapping unless --mapping takes it.

A non-zero exit status means something went wrong and stderr says what. --file reads the file's bytes itself and tells UTF-8, UTF-16 (what Windows PowerShell 5.1 writes with >) and cp1250 apart; text it cannot decode for certain is refused rather than masked half-blind. --ner --paranoid masks every name the model finds, also in English prose and code, as mode="paranoid" does.

On Windows, prefer --file and --mapping to pipes and redirection. Windows PowerShell 5.1 re-encodes text piped into a program as ASCII, so Polish letters arrive as ? and a garbled name is not recognised, and its 2> wraps stderr in error records. If you do pipe, run $OutputEncoding = [System.Text.UTF8Encoding]::new($false) first; in cmd.exe, run chcp 65001.

Streaming

A provider streams arbitrary fragments, so <OSOBA_1> can arrive as <OSO and BA_1>. The restorer holds back anything that could still grow into a token:

restorer = Anonymizer.stream_restorer(result.mapping)
for chunk in stream:  # "Dzień dobry <OSO", "BA_1>, PESEL <PESEL", "_1> zweryfikowany."
    print(restorer.feed(chunk), end="")
print(restorer.flush())
# Dzień dobry Jana Kowalskiego, PESEL 50810112354 zweryfikowany.

With Claude, GPT or a local model

Mask before the call, restore while the answer streams. With the Anthropic SDK:

import anthropic
from polanon import Anonymizer, default_guards

anonymizer = Anonymizer(default_guards(with_ner=False))
masked = anonymizer.anonymize_sync(question)
restorer = Anonymizer.stream_restorer(masked.mapping)

with anthropic.Anthropic().messages.stream(
    model="claude-opus-5-5",
    max_tokens=64000,
    system="Personal data is replaced by tokens such as <OSOBA_1>. Copy a token exactly as written.",
    messages=[{"role": "user", "content": masked.anonymized}],
) as stream:
    for text in stream.text_stream:
        print(restorer.feed(text), end="")
print(restorer.flush())

Telling the model what the tokens are keeps it from rewriting them. The examples go further: openai_chat.py does the same for any OpenAI-compatible endpoint (OpenAI, OpenRouter, Azure, vLLM, a local Ollama), and anthropic_chat.py holds a conversation whose history keeps masked text only, so an answer restored for the reader is never sent back in the clear. Both are tested in CI against the real SDKs, offline.

A chat turn with tools

A turn of a chat with tools sends more than the question: the history, and the result of every tool the model calls. anonymizer.turn() masks all of it with one mapping, puts the originals back into the tool arguments and the answer, and refuses instead of sending anything it could not mask:

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases polanon

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Vulnerability Insights

OpenSSH Password Authentication Bypass on Alpine Linux (*sshole) – CVE-2026-123158

Frame 2085668439 (1)
Group 1261154229