Topic 1 of 5 · 5 min read
Mapping data flows of an AI feature
Goal: Map the data flows of an AI feature and mark every store, vendor and region that personal data reaches.
Before you can protect personal data in an AI feature, you have to know every place it goes, and a written map of those places is the first privacy control. Most teams think of an AI feature as "user types, model answers". In practice the data takes many more routes.
Check yourself · 1 of 3
What is the best first step when starting to map the data flow of an AI feature?
Why it matters
Privacy law asks you to know what you process, where and with whom. The EU's rules also expect a record of processing activities. You cannot delete, secure or disclose data you cannot find. AI features are easy to under-map, because the prompt is only one of many copies.
How to do it
Pick one feature, such as "support reply assistant". Then follow the data in order and write one row per stop.
- Inputs. What does the user type or upload? What does the app add on its own: name, account id, order history, the last ten messages?
- Retrieval and tools. Does the model search a knowledge base, a CRM or email? What can those tools return?
- The model call. Which vendor and which region? Is the vendor allowed to keep the request, and for how long?
- Outputs. Is the answer stored, shown to others, or sent on to another system?
- Side copies. Logs, traces, analytics events, error reports, caches, embeddings in a vector store, backups, evaluation datasets, and support screenshots.
For each row record: the data type, the purpose, the system, the vendor, the country, the retention period and who can read it. Mark the special categories, such as health data, and the data about children.
Before and after
Before: "We send the question to the model. Nothing is stored."
After, as a table row set:
- Prompt text with customer name and order id goes to the model vendor in the US, kept 30 days for abuse checks.
- The same prompt is written to our app logs in the EU, kept 1 year.
- The reply is saved in the ticket system, kept as long as the ticket.
- The prompt is also embedded and stored in a vector database run by a second vendor, with no expiry.
The "nothing is stored" claim was wrong in three of four rows.
What goes wrong
- Mapping the happy path only. Logs, traces and backups hold the most copies and are mapped least.
- Forgetting the model's own tools. An agent with email access can pull in data the user never typed.
- Treating the map as a one-off. A new tool or vendor changes the flow. Review the map with each release.
Examples
A support assistant, mapped
The first draft of the map had three rows: user message, model, reply. Walking the code found five more: the CRM lookup that adds the customer's address, the debug log of full prompts, the vector index of past tickets, the error tracker that captures request bodies, and a nightly backup. Two of those had no retention limit. The map turned a vague worry into two concrete fixes.
A data map in code form
{
"feature": "support-reply-assistant",
"stops": [
{"system": "model-api", "vendor": "ExampleAI", "region": "US", "data": ["name", "order_id", "message"], "retention_days": 30},
{"system": "app-logs", "vendor": "self", "region": "EU", "data": ["full prompt"], "retention_days": 365}
]
}
Keeping the map as a file in the repo lets a pull request that adds a vendor also change the map.
Key points
- Write one row per stop the data makes: input, retrieval, model call, output and every side copy.
- Logs, traces, caches, embeddings and backups are data stores and belong on the map.
- For each stop record data type, purpose, vendor, country, retention and who can read it.
- Tools and retrieval can bring in personal data the user never typed.
- A data map is a living record: update it whenever a tool, vendor or region changes.
Common mistakes
- Mapping only the call to the model and ignoring logs and caches.
- Writing the map once for the audit and never updating it.
- Listing systems but not the country or the retention period.
- Assuming a vendor that says it does not train on your data also does not store it.
Check yourself · 2 of 3
Which of these is most often missing from an AI feature's data map?
Check yourself · 3 of 3
An agent can search the company's email to help answer a user. What does that mean for the data map?
Practice items, not counted towards your mastery.
Start here
- NIST Privacy Framework (opens in a new tab)DocsFree
A free, vendor-neutral framework for mapping data and managing privacy risk.
Where to go in your country
- GDPR Article 25: Data protection by design and by default (opens in a new tab)StandardFreeEU
The legal text behind privacy by design, in a few short paragraphs.
- EDPB Guidelines 4/2019 on data protection by design and by default (opens in a new tab)DocsFreeEU
The regulator's own reading of how to build data protection into a product from the start.
- GDPR Article 28: processor (opens in a new tab)DocsFreeEU
What a data processing agreement must contain, including subprocessors and deletion.
- GDPR Article 13: Information to be provided (opens in a new tab)StandardFreeEU
The list of facts a notice must give when you collect personal data from a person.
- EDPB Opinion 28/2024 on data protection aspects of AI models (opens in a new tab)DocsFreeEU
How EU regulators treat personal data in AI model training, including legitimate interest and anonymity.