Skip to main content

Technical~/notes/stop-writing-redacted.md

Stop writing [REDACTED]

privacyllmphi

If you're sending sensitive text to an AI model, the obvious move is replacing names with [NAME]. It works, but the answers get worse

Look at it from the model's side: "[PERSON] saw [PERSON] on [DATE] about [PERSON]'s results". Who's who? It can't tell either

Use fakes instead

Swap each real value for a realistic fake of the same shape. Maria Lopez becomes Helen Hatfield, and an MRN becomes a different MRN in the same format. The model reads normal text and reasons normally

Keep an encrypted map of real to fake for the session, and swap the real values back into the reply. Same real value, same fake every time, so the story stays consistent

Dates are the sneaky part. Shift every date in a session by the same offset and "three days after admission" is still three days. Shift them randomly and you just broke the medical timeline

Shifted dates are still dates to HIPAA, though, so this alone isn't de-identification