promptdojo_

The data firewall — no employee data in prompts, as code — 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 full firewall, run against a week of payloads.

Reuse the gate logic from the last step — prompt_gate(payload) returning (verdict, reasons) with the provenance check first, then the never-list scan in dict order.

Then write the report loop yourself: print one line per payload (ALLOW, or BLOCK — with semicolon-joined reasons), count the blocks, and finish with a summary line:

blocked {n} of {total}

Five payloads run. Expected output:

Q1: ALLOW
Q2: ALLOW
Q3: BLOCK — unapproved source: er-notes; er: complaint against
Q4: BLOCK — identity: ssn
Q5: BLOCK — unapproved source: spreadsheet
blocked 3 of 5

(Match it byte for byte — the dash after BLOCK is an em-dash, , so copy it from the block above rather than reaching for the hyphen key.)

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