Topic 4 of 5 · 5 min read
Safeguards for sensitive data in AI workflows
Goal: Choose the safeguards for a workflow that sends sensitive records to an AI model and justify each one.
Protect sensitive data in an AI workflow with layers: send less, hide what remains, choose a place where the model keeps nothing, limit who can use it, and have a person check the output. No single layer is enough, so pick the set that fits the risk.
Check yourself · 1 of 3
What does pseudonymisation do to a name in a record?
Why it matters
Once a record is sent to a model, you may not control where it goes. It may be logged, reviewed by staff for abuse checks, or used to train future models, depending on the plan. A model can also reveal text from its own prompt, or repeat private details in a later answer. Safeguards decide whether a mistake becomes a leak.
The five layers
- Minimise. Ask what the model really needs. A summary of symptoms needs symptoms, not an address.
- De-identify. Redaction deletes the identifier ("[NAME]"). Pseudonymisation swaps it for a code and keeps the key somewhere else, so you can restore it later. Aggregation turns records into counts. Tools that find names and numbers miss things in free text, so sample and check the results.
- Choose where the model runs.
- A cloud service on a business plan with zero retention (no storing of prompts) and a signed agreement, such as a BAA or data processing agreement.
- A local or self-hosted open-weight model inside your network, so data never leaves.
- A consumer chat app is the wrong place for sensitive records.
- Control access. Give accounts to named staff, use single sign-on, log who sent what, and block pasting from sensitive systems into unapproved tools. NIST's HIPAA guide has a practical risk analysis for this.
- Keep a human in the loop. A trained person reads the output before it reaches a patient, customer or file, because models invent details and may mix up records.
Before and after
Before: An analyst exports 5,000 full customer complaints, with names and health details, into a public chatbot to find themes.
After: The analyst picks the fields the theme task needs, runs a redaction step, checks 50 random rows by hand, then uses a business-plan tool with zero retention and an agreement. A second person reviews the themes.
An optional code branch for engineers shows the redaction idea:
import re
def redact(text: str) -> str:
text = re.sub(r"\b[\w.]+@[\w.]+\.\w+\b", "[EMAIL]", text)
text = re.sub(r"\b\d{3}[-. ]?\d{3}[-. ]?\d{4}\b", "[PHONE]", text)
return text
This catches only patterns. It will not find a name inside a sentence, so pair it with a named-entity tool and a sample check.
What goes wrong
- Teams redact once and never test, so identifiers slip through in free text.
- Teams trust the words "private mode" on a consumer app without reading what it keeps.
- Teams add review as a formality, and the reviewer approves without reading.
Examples
Triage notes for a clinic
A clinic wants a tool to draft triage summaries. The plan: send only symptoms and age band, redact names and phone numbers, run a business-plan model under a BAA with zero retention, give access only to triage nurses, and have a nurse approve every summary before it enters the record.
A private model for legal papers
A law firm cannot send client files outside its network. It runs an open-weight model on its own server, limits access to the matter team, logs every use and has a lawyer verify every citation in the output. No data leaves the building, though the firm must still patch and secure the server.
Key points
- Layer your safeguards: minimise, de-identify, choose where the model runs, control access, and review the output.
- Redaction deletes identifiers, pseudonymisation replaces them with codes and keeps a separate key, and aggregation shares only counts.
- Automatic redaction misses identifiers in free text, so check a sample by hand.
- Zero-retention business plans and local open-weight models keep prompts from being stored or used for training.
- A person must review output because models can invent details and mix up records.
Common mistakes
- Relying on one safeguard, such as redaction, and skipping the rest.
- Assuming a regex or an automatic tool finds every identifier.
- Believing a consumer app's privacy toggle is the same as a signed agreement.
- Letting reviewers approve outputs without reading the source record.
Check yourself · 2 of 3
Why should you check a sample after running a redaction tool?
Check yourself · 3 of 3
A firm must keep client files inside its network but still wants AI help. Which setup fits best?
Practice items, not counted towards your mastery.
Where to go in your country
- NIST SP 800-66 Rev. 2: Implementing the HIPAA Security Rule (opens in a new tab)DocsFreeUS
A practical guide to access control, risk analysis and safeguards for systems that hold health data.
- 45 CFR Part 164: HIPAA Privacy, Security and Breach Notification Rules (eCFR) (opens in a new tab)StandardFreeUS
The rule text itself: business associate contracts, the 18-identifier Safe Harbor method and the breach notification deadlines.
- GDPR Article 9: special categories of personal data (opens in a new tab)DocsFreeEU
The list of special categories and the ten conditions that lift the ban on processing them.
- GDPR Article 33: notification of a personal data breach to the authority (opens in a new tab)StandardFreeEU
The 72-hour deadline and the list of what a breach notification must contain.
- EDPB Guidelines 9/2022 on personal data breach notification (opens in a new tab)ArticleFreeEU
How European regulators read "aware of a breach", with worked examples and what to document.
- EU AI Act Article 5: prohibited AI practices (opens in a new tab)DocsFreeEU
The banned uses, including emotion recognition at work and school and untargeted scraping of face images.