Contents
Whether AI coding tools can be used in a privacy-compliant way depends less on the source code itself than on what data is sent along, where it is processed and what the vendor commits to contractually. For most companies, cloud use with vetted business plans, a data processing agreement and clear rules is possible. For particularly sensitive codebases, there are alternatives up to and including locally hosted models.
Note: This article is a practical overview, not legal advice. For specific decisions, involve your data protection officer or a law firm.
What Data AI Coding Tools Actually Process
Many discussions focus only on "the code". In practice, AI assistants and coding agents may transmit much more, depending on configuration:
- Source code snippets from open files or the whole repository as context
- Prompts and chat histories, into which developers often paste error messages, logs or customer requests
- Configuration files that may contain credentials
- Test data and database dumps that may include real personal data
- Telemetry and usage data about the developers themselves (name, e-mail, usage patterns)
Under the GDPR, what matters primarily is personal data. Pure source code usually isn't personal data – but comments containing names, test data, logs and your developers' accounts are. Independently of the GDPR, source code is often a trade secret. Under the EU trade secrets framework (in Germany the GeschGehG), information is only protected if you take reasonable confidentiality measures. Uncontrolled uploads to arbitrary AI services can weaken that protection.
The Key Questions for Every Vendor
Before approving a tool, get written answers to these questions – ideally from the contract, privacy terms or the vendor's trust center, not from marketing pages:
| Question | Why it matters | Desirable answer |
|---|---|---|
| Are inputs used to train models? | Otherwise your code could influence future model outputs | No training on customer data, contractually guaranteed |
| How long are prompts and responses stored? | The shorter the retention, the smaller the risk | Clear, short periods or a zero-data-retention option |
| Where does processing take place? | Transfers to third countries need additional safeguards | EU processing or a well-documented transfer mechanism |
| Is a data processing agreement available? | Mandatory when personal data is processed | DPA under Art. 28 GDPR available |
| Which sub-processors are involved? | Model providers and hosts are often third parties | Public, up-to-date list with change notifications |
| Can admins enforce policies centrally? | Consistent rules instead of individual choices | Central management, SSO, audit logs, file exclusions |
In practice, free personal plans and business or enterprise plans from the same vendor often differ considerably. Always check the terms of the exact plan your team will use.
Third-Country Transfers: What to Consider with US Vendors
Many well-known AI coding tools come from US companies. If personal data is transferred to the US, you need a legal basis for the transfer – for example the vendor's certification under the EU-US Data Privacy Framework, or standard contractual clauses with a transfer impact assessment. Some vendors now offer data processing within the EU. Read more on hosting location in data storage in the EU: server location and third-country transfers.
Important: even if a transfer is legally covered, your clients may not accept it. Clients in manufacturing, healthcare or the public sector sometimes prohibit in their contracts that their code is sent to external AI services. Review your client contracts and NDAs as well.
Three Operating Models Compared
Depending on your protection needs, different models are available:
- Cloud service with a business contract: Ready to use quickly, access to the most capable models, privacy ensured through contract, DPA and configuration. Appropriate for most projects.
- Models via a cloud platform in the EU: Major cloud providers offer AI models in their own regions. This can embed data handling into your existing cloud governance.
- Local or on-premise models: The code never leaves your infrastructure. In return, you need to plan for hardware, operations and often lower model quality. Details are in our article on local LLMs for software development.
Many companies combine these: cloud tools for most projects, local models or strict exclusions for especially sensitive repositories.
Practical Safeguards for Everyday Work
Even with the right contract, team behaviour makes the difference. These measures work well:
- Keep secrets out of the repository: Credentials belong in a secret manager, not in
.envfiles in the agent's working directory. - Exclude files: Many tools support ignore lists for directories that must never be used as context.
- Use synthetic test data: No real customer data in fixtures, seeds or prompts.
- Anonymize logs: Remove personal data before pasting logs into a chat.
- Allow company accounts only: Private accounts under consumer terms are off-limits for company code.
- Document everything: Record tool, plan, configuration and assessment in your records of processing activities or an internal policy.
Checklist: Approving a Tool in Six Steps
- Define the use case and the repositories involved.
- Classify the protection level of each codebase (public, internal, confidential, strictly confidential).
- Check the vendor terms of the specific plan (training, retention, location, sub-processors).
- Sign a DPA and involve your data protection officer; assess whether a data protection impact assessment is needed.
- Configure technical settings centrally (SSO, exclusions, telemetry, agent permissions).
- Train the team and publish the rules in a short, readable policy.
How these rules fit into a wider framework is explained in our article on AI governance in development teams.
Planning an app? Request a free fixed-price quote in 2 minutesConclusion
In many cases, source code may go to the cloud – but not to every tool and not without preparation. What counts is a business plan without training on your data, transparent retention periods, a DPA, a clarified third-country transfer and a team that doesn't paste secrets or customer data into prompts. For highly sensitive codebases, EU regions or local models are a sensible addition. Once these points are settled properly, you can use AI coding tools with confidence.
Frequently Asked Questions
Is source code personal data under the GDPR?
Usually not. Personal data can, however, appear in comments, test data, logs or configuration, and developer accounts are personal data in themselves.
Do I need a data processing agreement for AI coding tools?
As soon as the vendor processes personal data on your behalf, a DPA under Art. 28 GDPR is required. Reputable vendors provide one for business plans.
Do AI vendors train their models on my code?
It depends on the plan. Business and enterprise offerings often exclude training on customer data contractually; free versions don't always do so.
What is the safest option for strictly confidential code?
Models run locally or in your own infrastructure, so the code never leaves the company. They require hardware and operational effort, and often don't match the quality of the strongest cloud models.