[LABEL_N] — square brackets, an upper-case label, an underscore, a 1-based index — written where /deidentify removed a value. A session is the vault scope that maps those placeholders back to the encrypted originals, until its TTL lapses or someone erases it.
When to use it
Read this before you send de-identified text to a model, route on it, or regex over it./deidentify rewrites text; everything downstream depends on the format below whether it knows it or not.
The flow
vpc-lattice-svcs) and goes through VPC Lattice to the service that owns the route. Rehydration and audit covers who may call what.
The placeholder format
ACCOUNT, ADDRESS, AGE, BUILDING_NUM, CITY, COORDINATES, CREDIT_CARD, DATE, DEA_NUMBER, DOB, DRIVERS_LICENSE, EMAIL, FIRST_NAME, ID_CARD, IP_ADDRESS, LAST_NAME, LICENSE_PLATE, LOCATION, MRN, NPI, PASSWORD, PHONE, PII, REFERENCE_NUM, SSN, STATE, TAX_ID, URL, USERNAME, VIN, ZIPCODE
What you can rely on:
- Indices are 1-based and per label, so
[EMAIL_1]and[FIRST_NAME_1]can coexist. - A value that recurs reuses its placeholder — within one call and across calls in the same session.
jane@example.comis[EMAIL_1]every time in that session. - Placeholder labels are display labels.
findings[].labelin the same response is the detector’s taxonomy label and can differ. Match placeholders with the regex, not by joining onfindings[].label. [PII_N]is a span the model flagged but couldn’t name (findings[].labelOTHER). It’s still removed and still restores. A clock time on its own — the time half of2/5/1994 12:00:00 AM— is one of these, not a date of birth.[REFERENCE_NUM_N]is a structured account or reference id, such asAC-2EA6-KY4B-G6FX.- A phone number keeps its extension.
+1 202 555 0137 ext 11037is one[PHONE_N], and+-prefixed international numbers are detected. - The index is not an identity.
[FIRST_NAME_1]in two different sessions is two different people.
Sessions
The
session_id is a capability: together with a role the rehydrate service admits, it returns plaintext until the session expires. Store it next to the conversation it belongs to, treat it like a credential, and never log it. Audit records carry session_ref, a keyed digest, instead.
Re-identification rules
- Single pass, allowlist only. Bracketed text is replaced only if it is an exact key in this session’s map. The output is never rescanned, so a restored value that happens to look like a placeholder can’t be substituted again.
- Hallucinated placeholders are not errors. A model that invents
[EMAIL_9]gets it back unchanged intextand listed inunresolved—200, not4xx. Checkunresolvedbefore you show the text to a person. - Pre-existing placeholder-shaped text in user input (
[EMAIL_1]typed by a user) can be substituted on re-identify if that session issued the same placeholder.
What your consumer must do
- Tell your model what the placeholders mean. A prompt that has never seen
[FIRST_NAME_1]treats it as noise or reasons through it badly. One line is enough: “Text in[LABEL_N]form is a placeholder for a removed value of that type. Keep placeholders exactly as written.” - Widen your token classes. A router or regex built for plain words won’t match
[FIRST_NAME_1]— brackets are outside[\w…]. Admit the placeholder regex explicitly. - Keep placeholders verbatim. A model that rewrites
[EMAIL_1]asEMAIL_1or[Email 1]produces text that won’t restore.
Wire de-identify → LLM → re-identify into an existing app, signed with the app's own IAM role.
Gotchas
/redactis not reversible. It rewrites withmask,last_four,hash_prefixordropand stores nothing. Use/deidentifywhen you need the values back.- Detection recall bounds everything. A value the detector missed is not replaced and reaches the model as-is. The services run at a confidence threshold of 0.55; a per-request
confidence_thresholdoverrides it. Measure recall on your own data before you rely on de-identification. Attestation. - Sessions are TTL-bounded, not a system of record. After expiry or erasure,
/reidentifyreturns404for that session and the values are gone. - Erasure answers
204whatever happened. Only the erasure audit record says whether the session existed (outcome: "erased") or not (unknown_session).