1:1 mentoring with Big Tech AI engineers
System Design

PII Detection

A PII gateway on the request path: what each detector catches and misses, checksums as the precision gate, redaction by purpose with the mapping treated as personal data, the order the gateway runs in, and the output scan.

Last updated

Production10 min readFirst readSecurity Overview

After this section you can

  • Choose a detector for each kind of PII, and name what it misses
  • Redact by purpose, and guard the mapping as personal data
  • Order the gateway's checks, and scan the reply against the input mapping
13

PII Detection

Catch PII with checksums, redact by purpose, and scan the reply for PII the input never had.

Key idea

Detect PII with a checksum-gated stack, redact by purpose, run the read-only checks after redaction, scan the model's reply against the input mapping, and treat the mapping as personal data.

Every value is redacted before the model, and checked again after it
User input names, e-mails, card numbers Detect and redact checks, then tokens Model sees tokens only Reply to the caller only authorised values Re-inflate authorised callers only Output scan blocks what the input lacked Mapping vault written at redact 1 · raw text 2 · tokens 3 · reply 4 · check 5 · release reads it to re-inflate

Blue input, teal the gateway, amber the model, green the reply, purple the vault. Pans sideways on a phone.

Related

More in System Design

Get full access to all 149 sections with code examples, diagrams, and interactive animations.

Unlock Premium