Send the minimum personal data a task requires. A practical pattern is tokenised redaction: replace entities with placeholders before the model call and restore them afterwards, so the model never sees raw identifiers but the user still gets a natural answer.
ts
function redact(text: string) {
const map = new Map<string, string>();
let i = 0;
const out = text
.replace(/[\w.+-]+@[\w-]+\.[\w.]+/g, (m) => tok("EMAIL", m))
.replace(/\b(?:\d[ -]?){13,16}\b/g, (m) => tok("CARD", m))
.replace(/\b0x[a-fA-F0-9]{40}\b/g, (m) => tok("ADDR", m));
function tok(kind: string, value: string) {
const t = `[${kind}_${i++}]`;
map.set(t, value);
return t;
}
return { text: out, restore: (s: string) => [...map].reduce((a, [t, v]) => a.split(t).join(v), s) };
}Regexes catch structured identifiers; names and addresses need an NER model. Also: disable provider training on your data, set retention to the minimum, exclude prompt bodies from application logs, and keep a deletion path for stored memories.
Exercise: add redaction to a support-ticket summariser and confirm from the request log that no raw email address or card number ever leaves your service.