promptdojo_

The PII proxy — mask before the model, unmask for the named human — step 8 of 8

Checkpoint

One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.

Checkpoint: the send gate. Same three tickets, both sides of the proxy printed — what would leave for the model, and who (if anyone) gets the real values back.

Write proxy_gate(ticket):

  1. Print {id}:
  2. Mask as in the last step ([KIND_n], n from 1 in pii order). Print outbound: {masked}
  3. Collect leftover KNOWN values still in the masked text, in KNOWN order. If any → print leftover: {values comma-joined} and verdict: BLOCKED — raw PII
  4. Elif reviewer is falsy or "auto" → print leftover: none and verdict: BLOCKED — no named human
  5. Else unmask MODEL_DRAFT[id] and print leftover: none and for {reviewer}: {restored}

Expected output:

exc-441:
  outbound: Member [MEMBER_1] at [EMAIL_2] — late refill. Call [PHONE_3].
  leftover: none
  for vera: We'll call 415-555-0142 about MBR-104221 and email [email protected].
exc-442:
  outbound: Member [MEMBER_1] called from 415-555-0142.
  leftover: 415-555-0142
  verdict: BLOCKED — raw PII
exc-443:
  outbound: Email [EMAIL_1] about the missed window.
  leftover: none
  verdict: BLOCKED — no named human

full-screen editor opens — close anytime to keep reading.