CSE Roadmap

Core tier · about 4 hours · 4 parts

Part 2 of 4 · 10 min read

Definitions

Covers: Definitions; Data flow; Results; Design rules; Interview questions, with the follow-ups; Common mistakes; What the example does not do.

Definitions

Personal data, PII

  • Personal data: information that can identify a person, alone or combined with other data.
  • PII: the common US-style term; legal definitions vary by jurisdiction.

Minimisation, pseudonymisation, redaction

  • Minimisation: collecting and passing only what the task needs.
  • Pseudonymisation: replacing identifiers with tokens, with the mapping kept separately.
  • Redaction: removing or masking the value, irreversibly.

Retention, erasure, lineage

  • Retention: how long each copy is kept.
  • Erasure: deleting a person's data on request.
  • Lineage: records of which items were derived from which, so derived copies can be found.

Precision and recall of a detector

  • Precision: of the items it flagged, how many were truly personal data.
  • Recall: of the truly personal items, how many it flagged.

Data flow

AAAWgmp1bWIAAAAeanVtZGMycGEAEQAQgAAAqgA4m3EDYzJwYQAAABZcanVtYgAAAEdqdW1kYzJtYQARABCAAACqADibcQN1cm46YzJwYTo4NjU3ZGRmZS1iMzg0LTRjNDYtOTdhMy1hNmE1NGM5YzkyZGUAAAADl2p1bWIAAAApanVtZGMyYXMAEQAQgAAAqgA4m3EDYzJwYS5hc3NlcnRpb25zAAAAALxqdW1iAAAARGp1bWRjYm9yABEAEIAAAKoAOJtxE2MycGEuaW5ncmVkaWVudC52MwAAAAAYYzJzaIV6fGkn76mNWxAHzcf77/QAAABwY2JvcqNpZGM6Zm9ybWF0bWltYWdlL3N2Zyt4bWxqaW5zdGFuY2VJRHgseG1wOmlpZDoxNTdmY2RiYS0zYTU5LTQ3NWUtYTgzNy0zZWNiNjQ2OTVjOTFscmVsYXRpb25zaGlwaHBhcmVudE9mAAAB4mp1bWIAAABBanVtZGNib3IAEQAQgAAAqgA4m3ETYzJwYS5hY3Rpb25zLnYyAAAAABhjMnNolXnFxjc1UEeCkmrZTYrr3wAAAZljYm9yomdhY3Rpb25zgqJmYWN0aW9ua2MycGEub3BlbmVkanBhcmFtZXRlcnOha2luZ3JlZGllbnRzgaJjdXJseC1z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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZYQGHdBVmH2boShBTdvvOULhdgGq5Gmp/9zjNG72jZa56gTEsY4BcLJu0yzwrvfQHFY7Pecxwb+EsEXHAxyf8lpr8=Personal data should reach the model only when needed, and never reach logs rawSource recordsfull customer recordMinimisepick the fields the task needsTokenisePII to stable tokens;map stays in a vaultModel + tracessees tokens only;logs hold tokensBoundarydetokenise only thefield a tool must sendRetention: every copy has a time limit. Erasure: follow lineage to summaries, embeddings and logs derived from a record.Detection is imperfect: redaction lowers exposure, minimisation removes it. Prefer not sending data over hiding it.This is engineering guidance, not legal advice: what counts as personal data and what you must do depends on the law that applies (module 10).
Source record, minimise, tokenise, model and traces, boundary detokenisation.

Results

Type Found / labelled False positives
Email 3 / 4 0
Phone 3 / 4 0
SSN-format 2 / 2 0
Card (Luhn) 2 / 2 0
IPv4 1 / 1 0
Titled name 2 / 3 0
IBAN (no rule) 0 / 1 0
Total 13 / 17 (recall 76%) 0 (precision 100%)

Without the Luhn check, an order number, a tracking number and a block of digits inside an IBAN added 3 false positives (precision 81%).

Task Fields sent (of 12) Personal fields sent
Order status 2 0
Refund 3 0
Reply 3 0
Erasure method Copies of the customer left (of 4)
Delete raw record only 3
Follow lineage 0 (other customer kept)
AAAWgmp1bWIAAAAeanVtZGMycGEAEQAQgAAAqgA4m3EDYzJwYQAAABZcanVtYgAAAEdqdW1kYzJtYQARABCAAACqADibcQN1cm46YzJwYTpiOGFiNjkyYS0yMzNhLTQ4ZWItYTZiYy03ZjZhNDZlNGYyMzcAAAADl2p1bWIAAAApanVtZGMyYXMAEQAQgAAAqgA4m3EDYzJwYS5hc3NlcnRpb25zAAAAALxqdW1iAAAARGp1bWRjYm9yABEAEIAAAKoAOJtxE2MycGEuaW5ncmVkaWVudC52MwAAAAAYYzJzaLZulw38ir0yuey+0+Zz0zAAAABwY2JvcqNpZGM6Zm9ybWF0bWltYWdlL3N2Zyt4bWxqaW5zdGFuY2VJRHgseG1wOmlpZDphYjQyZmFiZC0xODY0LTQxYWItOTM5OS01MjI4MzZhYzU2ZmVscmVsYXRpb25zaGlwaHBhcmVudE9mAAAB4mp1bWIAAABBanVtZGNib3IAEQAQgAAAqgA4m3ETYzJwYS5hY3Rpb25zLnYyAAAAABhjMnNozQFlhV13+yQpYivNkrAByQAAAZljYm9yomdhY3Rpb25zgqJmYWN0aW9ua2MycGEub3BlbmVkanBhcmFtZXRlcnOha2luZ3JlZGllbnRzgaJjdXJseC1zZWxmI2p1bWJmPWMycGEuYXNzZXJ0aW9ucy9jMnBhLmluZ3JlZGllbnQudjNkaGFzaFggI0rug3AS3hUYRmpM9AmEhdLUAclEEr2xfWKpg8EJrbqkZmFjdGlvbngdY29tLmFudGhyb3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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZYQBSskqgQpYrmoSwbBEjsUClrBAwxm0dEIOkBQuzfL7aDyhDlLrNeCTs3xFz/LcnHS2ewJAD8xAhk5WqmbvPTBc4=Redaction accuracy on a 20-text labelled set, and erasure with derived copiesSpan-level detection (13 correct, 0 wrong, 4 missed)EMAILrecall 3/4 false positives 0PHONErecall 3/4 false positives 0SSNrecall 2/2 false positives 0CARDrecall 2/2 false positives 0IPrecall 1/1 false positives 0NAMErecall 2/3 false positives 0IBANrecall 0/1 false positives 0Overall precision 100%, recall 76%. Without the Luhn check on card numbers: precision 81%.Missed: obfuscated email, name without a title, spelled-out phone number, IBAN (no rule). The rules and labels are mine, so this is optimistic.Erasure of one customer (4 stored copies)delete the raw record only3 copies leftfollow lineage0 copies leftMinimisation: fields sent to the model per taskorder_status: 2 of 12 fields, 0 personal fieldsrefund: 3 of 12 fields, 0 personal fieldsreply: 3 of 12 fields, 0 personal fieldsVault: tokens round-trip, same value gives the same token.All personal data is fictional; the corpus is small and written by me.
Detection recall by type, erasure with and without lineage, and minimisation.
  1. The cheapest privacy control is not sending the field.
  2. Detectors miss what they have no rule for, so redaction is a reduction of risk, not a guarantee.
  3. Derived data is personal data too: summaries and embeddings built from a record must be traceable and deletable.
  4. Tokens preserve function: the model can still tell that two mentions are the same person.

Design rules

  • Inventory the copies (prompts, tool I/O, traces, memory, summaries, embeddings, eval sets, backups, provider logs) and give each an owner and a retention limit.
  • Minimise first: build the model's context from an allowlist of fields per task.
  • Tokenise before the model sees data, keep the vault and key outside prompts, logs and traces, and detokenise only at the boundary that needs the real value.
  • Redact traces and logs before export (Level 9 module 8); capture prompt content only on purpose, with short retention and restricted access.
  • Record lineage for every derived artefact so erasure and retention can follow it.
  • Set retention by data class and enforce it with a job that you test.
  • Validate detections (Luhn for cards, range checks for IPs) and measure precision and recall on your own data, per type and per language.
  • Treat memory and eval datasets as data stores, with consent and deletion paths (Level 7).
  • Check providers' data handling and regional rules, and document it; have the design reviewed for the laws that apply (module 10).
  • Test the deletion path, including backups and caches.

Interview questions, with the follow-ups

How do you handle PII in an LLM application?

"I list every place data is copied, then minimise what reaches the model, tokenise what must reach it with the mapping in a separate vault, redact traces and logs, set retention per data class and make erasure follow lineage to summaries and embeddings. I measure my detectors: in a small test regex rules had 100 percent precision and 76 percent recall, so I do not treat redaction as a guarantee." Follow-up: "What would you use instead of regex?" A named-entity model or a library such as Presidio, evaluated on my own data, plus the structural controls.

A user asks you to delete their data. What do you delete?

"The raw records, and everything derived from them: summaries, embeddings, memory entries, cached results, log lines and eval examples, using lineage records. In my test deleting only the raw record left three copies. Then I check backups and provider-side retention and record that it was done." Follow-up: "What about a model fine-tuned on the data?" That is much harder; avoid training on personal data without a plan, or keep it out of training sets in the first place.

Redaction or pseudonymisation?

"Redaction is irreversible and simple but loses the link between mentions. Pseudonymisation with stable tokens lets the model reason about the same entity and lets a tool get the real value at the boundary, but you now hold a vault that must be secured and is itself personal data. I choose by whether the task needs the identity." Follow-up: "Where does the vault live?" Outside the prompt, logs and traces, with its own access control and retention.

Why do logs and traces matter?

"They copy everything, last longest and are readable by many engineers. The OpenTelemetry content attributes are opt-in because they can hold PII, so I capture content only on purpose, redact before export, and keep retention short." Follow-up: "How do you debug without content?" Log structured fields and token ids, and capture full content for a small consented sample.

Common mistakes

  • Sending the whole customer record to the model.
  • Logging full prompts and tool results forever.
  • Deleting the source record but not its summary or embedding.
  • Trusting a regex redactor (or a model) as complete.
  • Storing the token vault next to the logs.
  • Evaluating detectors on English test data only.
  • No retention limit on traces and eval sets.
  • Ignoring provider-side retention and region.

What the example does not do

  • Small, hand-written, fictional corpus; the same person wrote rules and labels, so the 100 percent precision is optimistic.
  • No named-entity recognition, non-English text, addresses, dates of birth or free-text identifiers.
  • Vault in memory, with a fixed demo key; no key rotation, access control or audit.
  • Erasure on an in-memory store, not on real databases, backups, caches or provider logs.
  • No re-identification analysis: combinations of harmless fields can identify a person.
  • No legal analysis, and no differential privacy or anonymisation guarantees.
  • Optional real experiment (I did not run this): take 200 real (consented, internal) support tickets, label PII by hand and compare your detector with an NER-based one per type.

Check yourself

You delete a customer raw record. Is their data gone? (Not if copies derive from it. With four stored copies, deleting the raw record left 3; following derivation links removed all 4.)

For the curious Detection is imperfect, so minimise first

Regex rules found 13 of 17 labelled items (recall 76 percent, precision 100 percent) on a 20-text set I wrote; they missed an obfuscated email, a name without a title and a spelled-out phone number. A Luhn check stopped order numbers and IBAN digit blocks being redacted as cards. The best defence is to not send the field at all: the three example tasks needed 2, 3 and 3 of 12 fields and none of the six personal ones. This is not legal advice.

What you will use daily at work

Practice What it looks like
Pass only the fields the task needs Do not rely on redaction after the fact.
Use stable tokens with a protected vault Detokenise only where a tool truly needs the real value.
Map every copy Prompts, logs, traces, memory, embeddings, eval sets, provider logs.
Erase by lineage and age Follow derived copies; apply retention limits.

Draft: confirm your providers data retention terms and what counsel requires for your region.

What you must be able to say (one page)

  • An agent system copies personal data in many places: the prompt, tool arguments and results, traces and logs, memory, summaries, embeddings and vector indexes, evaluation datasets built from traces (Level 9 module 2) and provider-side logs. Privacy engineering is about knowing every copy.
  • Order of preference: do not send it, then hide it, then protect it. (1) Minimise: pass only the fields the task needs. In my example, 12 fields in the record; the three tasks needed 2, 3 and 3 fields and none of the six personal fields. (2) Pseudonymise: replace personal data with stable tokens and keep the mapping in a vault outside the prompt and logs. (3) Redact in logs and traces.
  • Detection is imperfect, and I measured it. On a 20-text labelled set written by me (fictional data), regex rules found 13 of 17 labelled items with 0 false positives (recall 76 percent, precision 100 percent). It missed an obfuscated email ("alice at example dot test"), a name without a title, a spelled-out phone number and an IBAN. Because I wrote both the rules and the labels, treat these numbers as optimistic.
  • Validation cuts false positives. Card numbers need a Luhn check: without it, an order number, a tracking number and a block of digits inside an IBAN were wrongly redacted as cards and precision fell to 81 percent; with it, 0 false positives on card-like numbers.
  • Reversible tokens keep the agent useful. The vault replaces each value with a keyed token (<EMAIL_35beb7>), the same value always gets the same token within a vault, tokens differ across keys, and detokenisation can be limited by type at the point where a tool genuinely needs the real value (for example sending an email). Round trip and stability were tested.
  • Erasure must follow lineage. With four stored copies for one customer (raw record, a summary made from it, an embedding made from the summary, and a log line), deleting the raw record left 3 copies; following derivation links removed all 4 and kept the other customer's record. Retention by age (a 30-day limit on logs removed the log line) is a second, independent control.
  • Not legal advice. What counts as personal data, lawful bases, retention limits and erasure rights depend on the law that applies. From general knowledge (not re-checked here) regimes such as the GDPR give individuals rights over their data; module 10 looks at the current rules. Have counsel review any real design.
  • Honest limits: regex detection, fictional data, small corpus, no named-entity model, no differential privacy, no provider-side retention analysis.