Write run_proxy(ticket) — mask, refuse, unmask. A ticket has
id, text, pii (list of {kind, value}), and reviewer.
- Walk
piiin order. Token is[KIND_n]withnstarting at 1 (kinduppercased). Replace each value in the text. Keep a token map. - If any value in
KNOWNis still in the masked text → print{id}: BLOCKED — raw PIIand return. - If
revieweris falsy or equal to"auto"→ print{id}: BLOCKED — no named humanand return. - Otherwise take
MODEL_DRAFT[id], restore every token from the map, and print{id}: FOR {reviewer}: {restored}.
Expected output:
exc-441: FOR vera: We'll call 415-555-0142 about MBR-104221 and email [email protected].
exc-442: BLOCKED — raw PII
exc-443: BLOCKED — no named human