The Deska blog
Mapping Data Flows for a Privacy Review
Learn technical strategies for mapping data flows during a privacy review to ensure compliance when building with LLMs and AI coding agents.
· 10 min read
Mapping data flows for a privacy review is a critical technical requirement for any modern engineering team. As regulatory frameworks like GDPR and CCPA evolve, the burden of proof rests on developers to demonstrate exactly how information moves through their stack. This process involves identifying every touchpoint where sensitive information, especially Personally Identifiable Information (PII), is ingested, processed, stored, or transmitted to third party services. In an era where AI agents and large language models (LLMs) are integrated into development workflows, the complexity of these flows has increased significantly.
The Foundations of Data Flow Mapping
A thorough mapping exercise begins with identifying data subjects and the categories of data they provide. You must document the lifecycle of a piece of data from the moment it enters your system until it is eventually purged. This is often referred to as data lineage. For developers, this means looking beyond high level architecture diagrams to examine actual execution paths.
Engineers should categorize flows into three distinct segments. First, there are internal flows where data moves between your own services or databases. Second, there are egress flows where data leaves your perimeter to reach third party APIs, such as an LLM provider. Third, there are ingress flows where external data enters your environment for processing.
Identifying PII Ingress Points
The initial step in mapping data flows is documenting every entry point. This include web forms, API headers, logged session data, and even metadata attached to file uploads. When you map these, you should distinguish between data that is strictly necessary for the service to function and optional data that could be stripped to reduce risk.
Documenting Transformation and Storage
Once data is inside your system, you must track where it is persisted. This is not just about the primary database. It includes logs, cache layers like Redis, and temporary files. A common failure in privacy reviews is overlooking the data that resides in error logs or debugging output. If a service crashes and dumps the state of a request into a log file, that file now contains PII that must be accounted for in your map.
Integrating AI Agents into the Privacy Map
The use of AI coding agents introduces new variables into your privacy posture. Unlike static tools, agents can dynamically interact with your filesystem, terminals, and external APIs. When mapping data flows for a privacy review in an environment using these tools, you must account for the context windows of these models.
Tools like Deska allow you to run multiple agents like Claude Code, Codex CLI, and OpenCode side by side. Each of these agents interacts with your local environment in specific ways. Because Deska is a local-first application, the primary flow of your source code and local files stays on your machine. However, when an agent sends a prompt to an AI provider, that represents an egress flow.
Local Versus Cloud Processing
The choice of infrastructure fundamentally changes your data flow map. If you use a cloud based IDE, every keystroke might be transmitted to a remote server. In contrast, using a desktop application to manage your workspaces keeps the operational data resident on your local hardware.
| Data Type | Cloud IDE Flow | Local-first Flow (Deska) |
|---|---|---|
| Source Code | Sent to remote server | Remains on local disk |
| Terminal Output | Proxied through cloud | Stays in local process |
| Prompt History | Stored in provider cloud | Stored locally (BYOK option) |
| Metadata | Tracked by platform | Internal to application |
When you use your own API keys for managed inference, the data flow is directly between your machine and the AI provider. This bypasses the need for an intermediate platform to store your code. Mapping this flow is simpler because you are only tracking the transit to the LLM endpoint rather than multiple hops through a third party IDE provider.
Automating the Discovery Process
Manual mapping is prone to human error. Developers should use automated tools to identify PII within their codebases and databases. Static analysis security testing (SAST) tools can help identify variables and functions that handle sensitive data. Similarly, dynamic analysis can monitor network traffic to confirm that data is only being sent to expected endpoints.
Using Terminals and Scripts for Auditing
A practical way to verify your map is to run network monitoring scripts during a typical development session. Within Deska, you can open multiple terminals alongside your code editor to run tcpdump or wireshark while you interact with an agent. This allows you to verify in real time whether your data is leaving the local environment.
You can also use the ask-deska assistant to help organize your findings. By asking the assistant to open specific notes or run discovery commands, you can build a living document of your data flows. This documentation is essential when a compliance officer asks for proof of data minimization.
Managing Data Flows on Mobile
Monitoring your development environment from a mobile device adds another layer to the privacy review. Many remote access solutions require you to open ports on your router or use a third party cloud proxy that might inspect your traffic.
Deska offers a mobile app that uses a secure relay for direct pairing between devices. In this architecture, the data flow is encrypted and the devices pair directly without exposing ports. When mapping this flow, you should document that the relay facilitates the connection but do not assume it has access to the plaintext data. This distinction is vital for maintaining a clean privacy audit.
Privacy Review Checklists
To ensure your mapping is complete, consider the following technical points:
- Review all
GETandPOSTrequests for PII in URL parameters or bodies. - Audit your coding agents and their specific data access permissions.
- Verify that browser widgets used for testing do not leak session cookies to external trackers.
- Check the settings of your IDE to ensure telemetry is disabled or mapped clearly.
- Document how remote access traffic is encrypted and whether any metadata is logged by the relay service.
FAQ
How to map data flows for GDPR compliance?
Start by identifying all PII ingress points and tracing the data through every processing step. Document the technical measures used to protect it, such as encryption at rest and in transit. Use a visual workspace to create a diagram that links your source code to its storage locations.
What is the difference between a data flow and a data lineage?
A data flow describes the movement of data between systems or components at a high level. Data lineage provides a more granular view, showing the origins of the data and how it has been transformed or changed over time. For a privacy review, both are necessary to prove data integrity.
Can AI agents be used for privacy auditing?
Yes, AI agents can assist in identifying patterns of sensitive data within large codebases. However, you must ensure the agent itself is configured correctly so that the data it scans is not sent to a cloud provider for training. Local-first agents are preferred for this type of sensitive work.
Next Steps for Secure Development
Mapping data flows for a privacy review is an ongoing process rather than a one time task. As you add new features or integrate new AI models, your map must evolve. Using a tool that respects your privacy and keeps your data local is the most effective way to simplify this compliance burden.
You can start building your private development workspace by visiting the download page. By choosing a workflow that prioritizes data and storage security on your own machine, you reduce the surface area that needs to be mapped and audited during your next privacy review.