Open sourcePython · Data sanitisation

AnonAi

Sanitise before the model sees it

AnonAi detects and replaces personally identifiable and security-sensitive information in text, PDFs, Word documents and scanned images before that content reaches a language model. Replacement is consistent and reversible: the same value always becomes the same placeholder, and a mapping restores the originals once the model has answered.

piianonymisationpresidiocomplianceMIT
01How it works

Checksums and entropy, not pattern matching alone.

Two detection layers run in a single pass. Custom regex recognizers handle structured values where a pattern alone is not enough — Argentine CUIT/CUIL with mod-11 checksum validation, DNI, credit cards verified by Luhn, and API keys matched by known prefix (sk-, ghp_, AKIA, Slack tokens) or by Shannon entropy for unknown formats. Presidio with a spaCy NER model handles names, organisations and locations.

That checksum and entropy validation is what keeps precision usable: a 16-digit order number is not reported as a credit card, and a low-entropy string is not reported as a secret.

02For security teams

Sending client data to a hosted model is a data transfer.

Sending a client's logs, a pentest report or a support ticket to a hosted model is a data transfer, and in many engagements a contractual problem. AnonAi makes it safe by construction — the model sees structure and language but no identities, card numbers or live credentials. Irreversible mode produces no mapping at all.

03For organisations

A blocking compliance question becomes a reviewable control.

Teams adopting AI assistants hit the same wall — the data most worth analysing is the data least permitted to leave. A sanitisation layer with a defensible detection story turns a blocking compliance question into a reviewable control, and the entity whitelist/blacklist lets legal or privacy define exactly what gets scrubbed.

04Results

A measured detection rate, not a claim.

96% recall against a synthetic ground-truth corpus, 100% on every regex-backed entity type (CUIT/CUIL, DNI, credit cards, emails, IPs), with the gap being NER missing some unstructured names.

56 tests cover detection, token consistency, round-trip restoration, file extraction and a no-leak assertion. The integration suite prints a per-entity recall table — the detection rate is a measured, re-runnable number, not a claim.

Want this run against your own organisation?

We operate these tools continuously for our clients, and we train their teams to use them.

Talk to a security engineer