Data flow mapping for an AI system under GDPR means tracing every category of personal data from where it enters to every place it is stored or sent. Along the way it passes through each pipeline step: prompt assembly, embedding, retrieval, inference, tool calls, logging and evaluation. At each place it lands, you record who processes it and when it is deleted. That map is the backbone of a Data Protection Impact Assessment (DPIA). Article 35 asks for a systematic description of the processing, and you cannot describe, assess or mitigate what you have not traced.
Below, one realistic AI workflow goes from a blank page to a map you can defend. Along the way we flag the places where AI pipelines hide copies of personal data.
Why an AI pipeline needs its own data flow map
A conventional data map is fairly tidy. The web form writes to a database, the database is backed up, a report pulls from it, and records are purged after a retention period. AI systems break that tidiness in a specific way: they create copies.
Follow a single customer email. It becomes a prompt, which is sent to a model provider that may retain it for abuse monitoring. Your tracing tool stores the full prompt and response for debugging, and a sample ends up in an evaluation dataset. The drafted reply is itself new personal data, sometimes containing inferences about the person that nobody wrote down before. Each of those copies is processing under GDPR. Each has a location, a processor, a retention period and a lawful basis that has to hold up.
Vector stores add a wrinkle. Embeddings derived from personal data are not anonymous just because they look like arrays of floats. They are linked to source records and usually stored alongside the original text as metadata. They can also leak information about the content they were built from. Treat them as personal data unless you can demonstrate otherwise.
Agents widen the map further. An agent with tools can read from one system and write to another. A single run can therefore move personal data across three or four boundaries that no human explicitly chose. For agentic workflows, the map is less a compliance artefact than the only accurate description of what the system is permitted to touch.
Our guide to AI security and compliance for EU firms covers the wider control set. This article stays on the map and the DPIA it feeds.
Does your AI system actually need a DPIA?
Article 35 of the GDPR requires a DPIA where processing is likely to result in a high risk to individuals, particularly where new technologies are used. It names three cases outright:
- systematic and extensive evaluation of people that leads to decisions with legal or similarly significant effects;
- large-scale processing of special category or criminal offence data;
- large-scale systematic monitoring of publicly accessible areas.
EDPB-endorsed guidance adds wider criteria, including vulnerable data subjects, innovative technology, matching or combining datasets, and evaluation or scoring. The working rule is that a project meeting two or more of them should have a DPIA. Supervisory authorities, including the Data Protection Commission in Ireland, also publish lists of processing types that require one.
Most production AI systems that touch customer or employee data tick the innovative technology box straight away, and many also combine datasets or score people. If your system processes personal data about customers or staff at any volume, assume a DPIA is needed and do the mapping regardless. The map is the expensive part of the work. It pays for itself in architecture decisions even if your DPO later concludes a full DPIA was not mandatory.
Walkthrough: mapping one AI workflow end to end
Take a concrete example: a support triage assistant for a mid-sized Irish services business. It reads inbound customer emails. It retrieves the customer’s account history from the CRM and relevant policy documents from a knowledge base. It then drafts a reply, and a support agent approves or edits it before it goes out. The workflow is ordinary and useful, and it is full of data flows.
Step 1: Fix the scope and the data categories
Write one DPIA per purpose, not per platform. ‘Our AI platform’ is not a scope; ‘drafting replies to inbound support email’ is.
Then list the categories of personal data in play. Here they are contact details, account and billing history, the free text of the email, the staff member’s identity as approver, and the generated draft.
The free text matters most. Customers write things you never asked for, including health information. Plan for special category data arriving unprompted, even if the use case does not need it.
Step 2: Draw every hop, including the boring ones
Walk the request path from trigger to final storage and write down each hop. For the triage assistant it looks like this:
- Email arrives in the shared mailbox and is picked up by the orchestration service.
- The service queries the CRM for the sender’s account record.
- The email text is embedded and used to search the knowledge base vector store.
- A prompt is assembled from the email, the account record and the retrieved documents.
- The prompt is sent to the model provider’s API, and the draft comes back.
- Prompt, response, latency and token counts are written to the tracing or observability tool.
- The draft is written to the ticketing system for human review.
- A sample of interactions is copied into an evaluation set used to test prompt changes.
- Application logs and backups capture some or all of the above.
Hops 6, 8 and 9 are the ones that get left off the whiteboard version. They are often where the largest and longest-lived copies of personal data end up.
A diagram helps with communication: boxes for systems, arrows for flows, and a dashed line at every organisational or geographic boundary. The numbered list, though, is what you annotate.
Step 3: Annotate each hop
Ask the same questions of every hop. The table below shows the questions and what a good answer looks like for the riskiest hop in the example, the call to the model API.
| Question per hop | Why it matters | Example answer (hop 5, model API) |
|---|---|---|
| Which data categories cross this arrow? | Data minimisation, Article 5(1)(c) | Email text, customer first name, plan type and the last three ticket summaries. Not the full billing history. |
| Who processes it, and in what role? | Processor contract, Article 28 | Model provider acts as processor under its data processing agreement, with sub-processors listed. |
| Where is it physically processed? | International transfers, Chapter V | EU region endpoint selected, with the transfer mechanism documented for any fallback region. |
| How long is it retained, and by whom? | Storage limitation | Provider retention for abuse monitoring as set out in the contract. The zero-retention option has been checked and the outcome recorded. |
| Is it used for anything else? | Purpose limitation | Contract excludes training on inputs, and this is confirmed in the account settings. |
| Can it be found and deleted on request? | Data subject rights | Traces are keyed by ticket ID, and the deletion job covers the tracing tool and the eval set. |
| What controls the arrow? | Security of processing, Article 32 | TLS, a scoped API key, an egress allow-list, and redaction before send. |
Do this for all nine hops. It is tedious, and it is the work. The questions you cannot answer are the findings of your DPIA.
From the map to the DPIA: the risks AI pipelines actually create
Article 35(7) sets out what a DPIA must contain. It needs a description of the processing and an assessment of necessity and proportionality. It also needs an assessment of risks to individuals, and the measures to address those risks. The annotated map gives you the first almost for free. The rest comes from reading the map critically, and the same handful of risks tends to surface.
Over-sharing in the prompt
The path of least resistance at hop 4 is to dump the whole CRM record into context. It works, but it sends far more personal data to a third party than the task needs.
The fix is deliberate field selection, plus redaction or pseudonymisation of identifiers the model does not need to see. If you use retrieval, enforce access control at query time so the vector search can only return documents the requesting user is entitled to.
Our comparison of RAG and fine-tuning explains why retrieval is generally the easier architecture to govern. Fine-tuning bakes data into model weights, and you cannot selectively delete from those.
Shadow copies in observability and evaluation
Tracing tools are essential for debugging LLM applications, and they store everything by default. An eval set built from production samples is a new dataset with its own purpose and retention. Both need redaction at write time, a retention limit, and coverage in your erasure process. If they cannot meet that bar, they should not receive production personal data.
Transfers and provider terms
Where the model runs determines your transfer analysis. Many providers now offer EU data residency and contractual exclusions on training. The defaults differ, however, between consumer, team and enterprise tiers, and between the API and the chat product. Record which plan, endpoint and settings you rely on.
For particularly sensitive categories, running the model yourself removes a whole class of transfer and retention questions, at a real operational cost. The trade-offs are laid out in self-hosted LLM vs API.
Dataflow security at the agent boundary
Every arrow on the map is a trust boundary, and with LLMs the content crossing it can carry instructions. Consider a customer email containing a prompt injection. In a poorly scoped agent, it could cause the model to call a tool that sends account data somewhere it should not go.
The map tells you which tools can send data out. Mitigate with least-privilege scopes on every tool and an allow-list of permitted destinations. Require human approval for any action that sends personal data outside the organisation. The data security and privacy practices for AI projects article covers those controls in more depth.
Automated decisions and accuracy
The human review at hop 7 can become a rubber stamp. If it does, you may drift into solely automated decision-making under Article 22, and model errors become accuracy problems under Article 5(1)(d).
Document what the reviewer actually checks, and measure how often they change drafts. A review step with a near-zero edit rate deserves a closer look.
Keeping the map current after go-live
A DPIA is not a one-off document. Article 35(11) expects a review when the risk changes, and in AI systems the risk changes quietly. Someone swaps model providers after a price change, enables a new tracing integration, adds a tool to the agent, or widens the retrieval index. None of those feel like data protection events to the engineer making them, yet each one alters the map.
The practical fix is to keep the map next to the code. Store the hop list and a text diagram, such as Mermaid, in the repository so changes show up cleanly in review. Then require a map update in the same pull request as any change to model endpoints, tool definitions, logging destinations or retention configuration.
We apply the same principle to our own infrastructure, with home lab documentation that keeps itself current through Gitea, GitHub and a nightly snapshot. Documentation that depends on someone remembering to update it will be wrong within a quarter.
If your system may also fall under the EU AI Act, the same map feeds the documentation obligations there. The EU AI Act compliance checklist for SMEs sets out the deadlines.
The most common failure: mapping the design instead of the running system
The usual failure is a DPIA that describes the design-phase architecture diagram rather than the system in production. The diagram shows five clean boxes. The running system also has a tracing service someone enabled in week two and verbose request logging left on from debugging. Its provider account is still on default retention settings, and someone has copied a spreadsheet of ‘good examples’ out for prompt testing. The DPIA is signed, filed, and inaccurate from day one.
Avoiding this is mostly a matter of checking the map against reality:
- Inspect the actual outbound network destinations from the application environment.
- Capture and read a real request payload at each hop.
- Open the provider console and screenshot the retention and training settings you are relying on.
- Search your logging platform for a known test customer’s email address.
If the test identifier shows up somewhere the map does not mention, the map is wrong. It is better to find that yourself than in response to a subject access request.
D3X Solutions LABS builds and reviews AI systems with this map as a first-class engineering artefact. We start by tracing a single real request through your pipeline to every place it lands, and annotating each hop against the questions above. From there we tighten prompt assembly, retrieval scoping, logging and tool permissions, so the DPIA your DPO signs describes the system that actually runs. If you have an AI workflow heading into production, or one already live without a current map, book a free 30-minute call and we will work out which hops need attention first.
Frequently Asked Questions
Do I need a DPIA to use an LLM API like OpenAI or Anthropic?
Not automatically. The trigger is the processing, not the tool. If you send customer or employee personal data to the API at any meaningful volume, you will usually meet at least two of the EDPB high-risk criteria, one of them being innovative technology. In that case a DPIA is expected, and mapping the data flow first is the sensible starting point either way.
Are vector embeddings personal data under GDPR?
If they are derived from personal data, treat them as personal data. They are typically stored alongside the source text or linked to identifiable records, and research has shown embeddings can leak information about their source content. That means they must be covered by your retention, access control and erasure processes.
What should an AI data flow diagram include?
Every system that receives personal data, including the parts people forget. That covers the model provider, the vector store, tracing and observability tools, evaluation datasets, application logs and backups. Each arrow should be annotated with the data categories that cross it, the processor, the location, the retention period and the controls applied. Mark organisational and geographic boundaries clearly, because that is where transfer and contract questions arise.
Who is responsible for the DPIA on an AI system?
The controller, meaning the organisation deciding why and how the data is processed. Under Article 35(2), the controller must seek the advice of its Data Protection Officer if it has one. In practice the engineering team produces the data flow map and the technical measures, while the DPO or privacy lead owns the risk assessment and sign-off.
How often should an AI DPIA be reviewed?
Whenever the risk changes, as Article 35(11) requires. In AI systems that means switching model providers, adding agent tools, enabling new logging or tracing, or widening the data the system can retrieve. Tying map updates to code changes in the same pull request is the most reliable way to keep the DPIA accurate.
Want this working in your business?
D3X Solutions LABS builds AI agents and automation that pay back fast. Talk it through with an engineer on a free 30-minute call; you leave with a short, concrete next step.
Get in touch






