Week 10 · Field delivery

Mask PII before the model sees it

0:00 / 3:00

15 seconds

SSN in the prompt.

The chunk had a national ID. The model echoed it in the answer.

Raw chunkPIIRedactFirstModelSees masked
Lesson notesMask PII before the model sees it: the short version+

Week 10 · AI security & red teaming · about 3 minutes

What you will be able to do

Redact Helix PII first, then send the remaining text to the model.

The idea

Mask or tokenize PII before the completion call. Re-hydrate only in a controlled UI if needed.

Hoping the model "won't repeat it" is not a control.

safe = mask_pii(chunk)  # SSN, phone, MRN patterns
complete(prompt_with(safe))

If the model never saw it, it cannot leak it.

Key takeaways

  • Mask before complete.
  • Do not rely on manners.
  • Log masked forms.

Part of the Forward Deployed Engineer roadmap. New to the role? Start with what a Forward Deployed Engineer does.