On-premise PII anonymization: evoiq use case cover illustration

On-premise PII anonymization starts from a problem every regulated team runs into: a language model finds personal data very well, but by the time it does, the data has already left your environment. A European payment institution wanted AI to help check business onboarding packs, but not at the price of sending names, ID codes and bank accounts to an outside model. So we built the step that comes first: personal data is found and replaced with pseudonyms inside the institution’s own environment, in any format and any EU language, before any model sees a single page.

The problem: KYB packs are full of personal data, and the names are the point

Anonymizing a KYB pack is harder than blacking out every name, for three reasons:

  • Any language, any format. A Lithuanian company owned by a Cypriot holding with a Polish shareholder means registry extracts in three languages, plus scans and phone photos with no text layer at all.
  • The names are what KYB checks. Directors, authorised persons and beneficial owners have to be linked across documents. Delete the names and the check can no longer be done.
  • Not everything personal-looking should go. A company’s registered address, registry code and a generic info@ mailbox are needed for the risk assessment. A director’s home address and private phone number are not.
  • “It usually works” is not an answer. A compliance officer or auditor will ask how much the anonymization misses, and expects a number.

What we built

A layered anonymization step that runs on a single machine with no internet connection:

  1. Read every page with its position. Text is extracted word by word with its location on the page. Scanned pages go through a local OCR engine first.
  2. Rules for anything with a format. IBANs are validated with their mod-97 checksum, national ID codes (Lithuanian, Estonian, Polish PESEL) with their check digit, and e-mail addresses and phone numbers by pattern. No model is involved here, so these checks give the same result every time.
  3. A small local model for names and addresses. Names, home addresses, birth dates and document numbers have no fixed format, so a compact multilingual model of about 300 MB finds them. It runs on an ordinary CPU, with no GPU, and makes no outside calls.
  4. A pack-level dictionary. A name found in one document is searched for in every other document of the pack in its other forms: capitals, “J. Surname” and “Surname, First name”. The same person appears many times in a KYB pack, so one find covers all of them.
  5. Consistent pseudonyms, not deletion. The same person becomes the same [PERSON_n] code in every document, so a later model can still understand that [PERSON_1] is the director and a 20% shareholder. The mapping table stays with the institution, and the model’s answer is translated back to real names on their side.
  6. Field-type policy. Company addresses, registry codes, document dates and generic company contacts are kept. Only natural persons’ data is replaced, both in the extracted text and in the PDF image itself.

The test pack had 11 fictional documents in Lithuanian, English, German and Polish, including one scanned Polish registry extract with no text layer. All 48 known personal data items were found, with no false positives, and all 8 company addresses that had to stay were kept. Rules found 12 of the items and the local model found 34. The whole pack took about 80 seconds on a laptop CPU, with Wi-Fi switched off.

On-premise PII anonymization: a German registry extract before and after, with each personal data item replaced by a consistent pseudonym and found by a rule or a local model
A German registry extract before and after anonymization: each person becomes a consistent pseudonym, the IBAN is found by its checksum, the company address is kept by policy. Interface shown in Lithuanian.

Is personal data the reason your team cannot use AI on its documents yet? Book a 30-min call and we will look at your process together.

Book a 30-min callor send us a message

What changes for the compliance and IT teams

Before With on-premise PII anonymization
Using AI on KYB packs Blocked, or personal data leaves the environment The model only ever sees pseudonyms
Languages and formats Masking lists per document type Any EU language, digital PDFs and scans
Linking people across documents Lost when names are deleted Kept through consistent [PERSON_n] codes
Company data needed for risk Often removed with everything else Kept by policy, per field type
Proof for the auditor “We mask personal data” Measured results per category on a known pack
Running cost Per-token fees to an outside service One container in your own environment

Where people stay in control

Nobody can promise 100% anonymization, so we measure it instead of promising it. The test pack is fictional, which means every personal data item in it is known and the result can be checked category by category. In a production setup, a second independent check reviews the anonymized text, and any pack that still looks like it contains personal data is held for a person instead of being passed on.

The limits are clear. Photos and signatures on identity documents are biometric data and need their own detection step. Handwritten text and poor scans can defeat OCR, and then the whole chain can miss something, so those pages always go to a person. Recall also has to be measured again on each new language and document type before it is relied on.

Where else this works

The same rules-plus-local-model approach fits any team that wants AI on documents full of personal data:

  • Banks and payment institutions: KYC and AML case files before they reach a model.
  • Insurance: claim files with medical and personal details.
  • Law firms and HR: contracts, CVs and employee files reviewed with AI without exposing the people in them.

Related use cases: KYB document check automation · EU AI Act for banks · AI contract review. All Document checks & reconciliation use cases · How we deliver this: Custom AI solutions

FAQ

Can personal data be anonymized without sending documents to an outside AI service?

Yes. In our build, OCR, the checksum rules and a small multilingual model all run on one machine with no internet connection. Nothing leaves the environment before anonymization.

Why pseudonymize instead of deleting names?

In KYB the names are what is being checked: directors, authorised persons and beneficial owners have to be linked across documents. Consistent codes keep those links for the model, and the mapping table stays with the institution.

How accurate is local PII detection?

On our fictional 11-document pack in four languages it found 48 of 48 known items with no false positives. Accuracy should always be measured again on your own document types and languages, and poor scans go to a person.

Is personal data the reason your team cannot use AI on its document checks yet? Book a 30-min call or send us a message.