Short answer
Before rolling out AI coding tools, map which data leaves developer machines, check vendor terms on retention and training, and decide which repositories and data classes may be used. Agentic tools add risks beyond data privacy, such as command execution, secrets exposure and prompt injection, so permissions, sandboxing and anonymisation of personal data belong in the rollout plan.
On this page
Two kinds of risk, not one
Security reviews of AI coding tools often focus only on the question "does our code go to the vendor?" That matters, but it is only half of the picture. Modern coding tools are agents: they read files, run shell commands, install packages and call external services. So there are two kinds of risk to assess:
- Data risk: what information leaves your environment, where it is processed and how long it is kept.
- Action risk: what the agent can do on a developer's machine, in CI or on connected systems, and how it could be manipulated.
A good rollout plan addresses both.
Map the data flows first
For each tool, document what is transmitted and where:
| Data type | Examples | Typical exposure |
|---|---|---|
| Source code | Files the agent reads or you paste | Sent to model provider as context |
| Configuration | Environment files, infrastructure code | Often read by agents unless excluded |
| Secrets | API keys, passwords, tokens in files or shell output | Can leak into context and logs |
| Personal data | Test fixtures, database dumps, log files, support tickets | Frequently overlooked, GDPR relevant |
| Telemetry | Usage data, prompts, accepted suggestions | Depends on settings and plan |
The personal data row is where GDPR enters. Developers routinely paste a customer's error log or a database extract into a chat to debug a problem. If that content contains names, email addresses or IDs, you are transferring personal data to a processor and need a legal basis, a data processing agreement and possibly a transfer assessment.
Vendor checks
Ask every vendor, and get the answers in the contract rather than a blog post:
- Is customer data used to train models? Can it be excluded contractually?
- How long are prompts, code and outputs retained, and can retention be reduced?
- Where is data processed, and which sub-processors are involved?
- Is a data processing agreement under Article 28 GDPR available?
- Can traffic be routed through a cloud provider you already have an agreement with, such as an EU region?
- What admin controls exist: SSO, user management, audit logs, model restrictions?
- What certifications and security reports can they provide?
Business and enterprise plans usually differ substantially from consumer plans on these points. A common mistake is approving a tool on the basis of enterprise terms while developers use personal accounts.
Agent-specific risks
Command execution
Agents run commands to build, test and explore. Misconfigured permissions can let them delete files, push code or call production APIs. Use the tool's permission modes, allow-lists and sandboxing; never run agents with credentials that reach production systems from developer machines.
Secrets exposure
Agents read files to understand context, including environment files if not excluded. Keep secrets out of repositories, use secret managers, configure ignore rules for the agent, and enable secret scanning on all repositories.
Prompt injection
Content an agent reads, such as a README in a dependency, a web page, an issue description or a tool result, can contain instructions designed to make the agent do something harmful. Mitigations include restricting network access, requiring approval for sensitive actions, and treating external content as untrusted. The secure agentic coding workshop practises these defences.
Supply chain
Agents may suggest or install packages, including non-existent ones that attackers register later. Require lockfiles, dependency review and registry policies.
MCP and integrations
Each connected MCP server extends what an agent can read and do. Approve servers individually and prefer read-only access. See MCP servers for enterprise integration.
Keeping personal data out of prompts
Policy alone rarely stops developers from pasting real data when they are under pressure to fix a bug. Make the safe path easy:
- Provide realistic synthetic test data and fixtures
- Mask personal data in logs at the source
- Offer a simple anonymisation step before content reaches any AI tool
Textwash Pro is built for that last point. It anonymises text with local AI, fully offline, and can act as a privacy layer in front of ChatGPT and Claude. For engineering teams this means support tickets, log excerpts or customer emails can be cleaned of names, addresses and identifiers on the developer's machine before they are pasted into a coding assistant. Because Textwash Pro runs locally, the original personal data never leaves the device, which simplifies the GDPR assessment considerably. Teams typically pair it with a rule in their AI policy: production data goes through Textwash Pro or it does not go into a prompt.
A pre-rollout checklist
- Data flow map for each tool completed and reviewed by data protection
- Enterprise contract with DPA, retention and training terms signed
- Data classes defined: which repositories and data may be used with which tool
- Permission settings and sandboxing configured centrally where possible
- Secret scanning active and agent ignore rules in place
- Anonymisation path for personal data available to developers
- MCP servers and plugins on an approved list
- Developers trained on risks and the policy
- Incident procedure defined for suspected data leakage via AI tools
Write the outcome into a policy; our guide to writing an AI coding tool policy shows the structure. If you need data sovereignty beyond what vendors offer, consider open-source and self-hosted coding agents.
Beyond engineering
The same questions apply as soon as other departments use AI agents with access to business systems. kalAIDoCreate provides a governed orchestration platform with audit trails, SSO and EU data residency, so controls designed for coding tools can extend to agents across the organisation.
FAQ
Is it legal under GDPR to use AI coding tools?
Yes, if you have a legal basis for any personal data processed, a data processing agreement with the vendor, appropriate safeguards for international transfers and transparency in your records of processing. Keeping personal data out of prompts reduces the effort substantially.
Do AI coding tools train on our code?
It depends on the vendor, product and plan. Business and enterprise offerings commonly exclude customer data from training, but verify this in your contract rather than relying on general statements.
How do we stop developers from pasting customer data into prompts?
Combine a clear policy with practical tools: synthetic test data, masked logs and a local anonymisation step such as Textwash Pro. Training on why it matters helps more than prohibition alone.
Are self-hosted models automatically safer?
They remove the data transfer to a third party, but action risks such as command execution, prompt injection and secrets exposure remain. Self-hosting also adds operational security responsibilities.