Home / Guides / deterministic-email-tokens

Designing deterministic [EMAIL_n] tokens for LLM traces

How stable [EMAIL_1]-style tokens keep support and debugging possible while keeping raw PII out of ChatGPT, Claude, and OpenAI request logs.

Published 2026-08-10 · NoeticGuard engineering notes

Random redaction ([REDACTED]everywhere) destroys the model's ability to refer to “the same person” twice. Stable tokens fix that. Within a vault session, identical emails (and other values of the same kind) also reuse one placeholder — so the outbound prompt does not restate the same raw PII string over and over, while your team can still unmask locally after the response.

Design rules

  1. Scope tokens to a vault session (conversation, request, or ticket) — not global forever across all customers.
  2. Prefer typed labels: [EMAIL_1], [CREDIT_CARD_1] — models learn the pattern quickly.
  3. Keep the vault off the LLM path: only your process holds email↔token maps; unmask after the response if the UI needs originals.
  4. On serverless, persist the vault (Redis/DB) so multi-step agents do not renumber mid-flight.

NoeticGuard implements this pattern in maskPii / unmaskPii. See Tokenization & vault and the OpenAI masking guide.