Veil finds personal data in text (names, emails, phones, street addresses, card numbers, IBANs, national IDs, passwords, API keys and more) and returns each with offsets. Ask for redact and you also get the text back with every one replaced.
Redact with type tags ([EMAIL]), a fixed mask, or numbered placeholders ([PERSON_1], [PERSON_2]) that keep who-said-what readable for an LLM.
Use it
curl https://labs.greatwork.company/v1/run \
-H "Authorization: Bearer $GWL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "veil-1",
"input": "Hi, I'\''m Dana Whitfield, my account email is dana.whitfield@example.com and my card ending 4242 4242 4242 4242 was charged twice. Call me at (512) 555-0187."
}'const res = await fetch("https://labs.greatwork.company/v1/run", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.GWL_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "veil-1",
"input": "Hi, I'm Dana Whitfield, my account email is dana.whitfield@example.com and my card ending 4242 4242 4242 4242 was charged twice. Call me at (512) 555-0187."
}),
});
const { output, usage } = await res.json();import os, requests
res = requests.post(
"https://labs.greatwork.company/v1/run",
headers={"Authorization": f"Bearer {os.environ['GWL_API_KEY']}"},
json={
"model": "veil-1",
"input": "Hi, I'm Dana Whitfield, my account email is dana.whitfield@example.com and my card ending 4242 4242 4242 4242 was charged twice. Call me at (512) 555-0187."
},
)
output = res.json()["output"]Set GWL_API_KEY to a key from your dashboard. The bare name veil works too and follows new versions.
Options
input: A string, or an array of up to 64 strings to run as a batch.
| Name | Type | Default | What it does |
|---|---|---|---|
redact | string none | type | mask | numbered | "type" | How to rewrite the text: type gives [EMAIL], mask gives ████, numbered gives [PERSON_1], none skips the rewrite. |
types | string[] | Only detect these types (e.g. ["email", "phone", "credit_card"]). | |
threshold | number | 0.5 | Score at or above which a span is returned. |
Output
| Field | Type | Meaning |
|---|---|---|
redacted | string | The text with every span replaced (unless redact: "none"). |
spans | object[] | type, text, start, end, score for each piece of personal data. |
counts | object | How many of each type. |
Every response wraps this in {"id", "model", "output", "usage": {"units", "unit", "cost_usd"}, "latency_ms"}. Send an array as input and output is an array in the same order.
Examples
Support email
{
"model": "veil-1",
"input": "Hi, I'm Dana Whitfield, my account email is dana.whitfield@example.com and my card ending 4242 4242 4242 4242 was charged twice. Call me at (512) 555-0187."
}{
"redacted": "Hi, I'm [PERSON], my account email is [EMAIL] and my card ending [CREDIT_CARD] was charged twice. Call me at [PHONE].",
"spans": [
{
"type": "person",
"text": "Dana Whitfield",
"start": 8,
"end": 22,
"score": 0.9794
},
{
"type": "email",
"text": "dana.whitfield@example.com",
"start": 44,
"end": 70,
"score": 0.9949
},
{
"type": "credit_card",
"text": "4242 4242 4242 4242",
"start": 90,
"end": 109,
"score": 0.9988
},
{
"type": "phone",
"text": "(512) 555-0187",
"start": 140,
"end": 154,
"score": 0.9987
}
],
"counts": {
"person": 1,
"email": 1,
"credit_card": 1,
"phone": 1
}
}Captured on our production servers: 78 ms, 1 text, $0.00002.
Numbered
{
"model": "veil-1",
"input": "Call notes: Sofia Ramirez asked Daniel Okafor to send the signed lease to Daniel's office at 18 Harbor Road, Portland. Sofia's number is +1 503 555 0148.",
"redact": "numbered"
}{
"redacted": "Call notes: [PERSON_1] asked [PERSON_2] to send the signed lease to Daniel's office at [STREET_ADDRESS_1], [LOCATION_1]. [PERSON_1]'s number is [PHONE_1].",
"spans": [
{
"type": "person",
"text": "Sofia Ramirez",
"start": 12,
"end": 25,
"score": 0.9638
},
{
"type": "person",
"text": "Daniel Okafor",
"start": 32,
"end": 45,
"score": 0.9148
},
{
"type": "street_address",
"text": "18 Harbor Road",
"start": 93,
"end": 107,
"score": 0.9925
},
{
"type": "location",
"text": "Portland",
"start": 109,
"end": 117,
"score": 0.8735
},
{
"type": "person",
"text": "Sofia",
"start": 119,
"end": 124,
"score": 0.5785
},
{
"type": "phone",
"text": "+1 503 555 0148",
"start": 137,
"end": 152,
"score": 0.9955
}
],
"counts": {
"person": 3,
"street_address": 1,
"location": 1,
"phone": 1
}
}Captured on our production servers: 71 ms, 1 text, $0.00002.
Leaked secret
{
"model": "veil-1",
"input": "deploy failed, here's my config: STRIPE_KEY=sk_live_51HxQe2LkdIwHu7ix and the server is at 10.0.4.17 with password Tr0ub4dor&3",
"redact": "mask"
}{
"redacted": "deploy failed, here's my config: STRIPE_KEY=████████████ and the server is at █████████ with password ███████████",
"spans": [
{
"type": "secret",
"text": "sk_live_51HxQe2LkdIwHu7ix",
"start": 44,
"end": 69,
"score": 0.9784
},
{
"type": "ip_address",
"text": "10.0.4.17",
"start": 91,
"end": 100,
"score": 0.9511
},
{
"type": "password",
"text": "Tr0ub4dor&3",
"start": 115,
"end": 126,
"score": 0.9985
}
],
"counts": {
"secret": 1,
"ip_address": 1,
"password": 1
}
}Captured on our production servers: 77 ms, 1 text, $0.00002.
Good for
- Strip PII from support tickets before sending them to an LLM
- Clean logs and transcripts
- Anonymize datasets for analytics
- Mask card numbers and secrets in chat
Limits and caveats
- Not a guarantee of anonymization: review anything you'll publish.
- Every date is tagged, not only birth dates.
- Unusual ID formats may be partly masked.
- Types: account_id, age, bank_account, coordinate, credit_card, credit_card_cvv, date, date_of_birth, device_id, driver_license, email, ip_address, license_number, location, mac_address, medical_id, national_id, organization, passport, password, person, phone, postcode, secret, street_address, tax_id, url, username, vehicle_id.
Pricing
$0.02 per 1,000 texts. One unit per text up to 2,000 characters; longer texts are split into 2,000-character chunks and each chunk is a unit. Failed calls aren't charged, and a call never costs more than its estimate (POST /v1/estimate tells you before you run it).
Built on
Horizon-Labs/pii-redactor-small, 141M (mmBERT-small encoder) parameters. License: Apache-2.0 (training data CC-BY-4.0). We run it on our servers with our own long-text chunking and score aggregation.