layahost

PII redaction API

Mask personal data
before it spreads.

Send text, get back where the names, emails, phone numbers, card numbers and IDs are, and a copy with each one replaced by its type. Use it before you log a support ticket, store a chat, or pass text to an LLM. One HTTPS call, servers in the EU, nothing stored.

One call

POST /v1/decide
curl https://layahost.com/v1/decide \
  -H "Authorization: Bearer $LAYAHOST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hi, this is Anna Kowalski, my card 4111 1111 1111 1111 was charged twice. Call me on +1 415 555 0132.", "template": "pii"}'
Response · 200 (shortened)
{
  "decision": true,
  "probability": 0.99,
  "entities": [
    { "type": "person", "text": "Anna Kowalski", "start": 12, "end": 25, "score": 0.95 },
    { "type": "credit_card", "text": "4111 1111 1111 1111", "start": 35, "end": 54, "score": 0.99 },
    { "type": "phone", "text": "+1 415 555 0132", "start": 85, "end": 100, "score": 0.95 }
  ],
  "redacted": "Hi, this is [PERSON], my card [CREDIT_CARD] was charged twice. Call me on [PHONE].",
  "template": "pii"
}

decision answers “does this text contain personal data?”, so you can also branch on it in a decision flow. Ask for some types only with "options": ["email", "phone"].

What it finds

person</code>, <code>email</code>, <code>phone</code>, <code>address</code>, <code>credit_card</code>, <code>iban</code>, <code>ip_address</code>, <code>date_of_birth</code>, <code>national_id</code>, <code>account_number</code>, <code>username</code>, <code>password.

Two layers work together. Formats with a checksum or a strict shape are matched by rules: emails, card numbers (Luhn check), IBANs (mod-97), IP addresses and phone numbers (libphonenumber). Names, addresses, dates of birth, ID and account numbers, usernames and passwords come from GLiNER PII, an open (Apache-2.0) span-detection model, which reads context instead of patterns.

How accurate it is

Measured on held-out samples of two public datasets. A found entity counts as correct when its type matches and it overlaps the labelled one by at least half.

DatasetPrecisionRecallF1
NVIDIA Nemotron-PII (200 documents)0.970.880.92
Gretel synthetic finance PII (250 documents)0.670.690.68

Measured 2026-09-27. Gretel’s labels are incomplete (real-looking emails and names left unlabelled) and its texts are financial message formats, so its precision is pessimistic. Nemotron-PII is better labelled but may overlap the model’s training data, so treat it as optimistic. Weakest types: usernames and passwords inside codes. Test on your own text with a test set.

layahost or Microsoft Presidio?

Presidio is Microsoft’s open-source PII toolkit: you run its analyzer and anonymizer services yourself, choose NLP models, and write recognizers. It is the right choice when data must never leave your network, or when you need images, many custom recognizers or reversible anonymisation.

Presidiolayahost pii
SetupRun and update analyzer and anonymizer services, pick spaCy or transformer modelsAn API key
DetectionPatterns plus NER models, extensible with your own recognizersChecked patterns plus a PII-specific GLiNER model
OutputEntities; anonymisation operators (replace, mask, hash, encrypt)Entities with offsets, a [TYPE]-redacted copy, and a yes/no answer
Where data goesYour own serversOur servers in Helsinki (EU), processed in memory, not stored
CostFree software, your computeOne decision per text: $15 per million, $1 free to start

Common uses

FAQ

Do you keep the text?

No. Text is processed in memory and not written to disk; logs keep the verdict and metadata for 7 days, and the text only if you turn it on. Details in data handling.

Which languages?

English is measured above. Emails, card numbers, IBANs and IP addresses are found in any language. Phone numbers are read with US conventions, so numbers in international format (+48 512 345 678) are found everywhere, but local formats from other countries can be missed. Names and addresses in other languages are found less reliably.

Is layahost affiliated with Microsoft?

No. Presidio is Microsoft’s open-source project, named here for comparison only.