Client code in Claude Code, Codex or Copilot: which subscription keeps your source code private?
Training, retention, zero data retention, EU processing, admin controls and contract at Anthropic, OpenAI and GitHub, compared per tier. Checked on 27 and 29 November 2026.
It is late in the evening before a delivery. One of your engineers is stuck on a timing problem in a client's firmware. At home, they open Claude Code, Codex or Copilot on a personal subscription, let the agent read through the repository and have a fix within the hour. The next morning the machine runs. But the client's source code has also been processed by a US AI company, under consumer terms and without a data processing agreement.
Whether that is a problem depends largely on the subscription. Below we compare what Anthropic (Claude, Claude Code) and OpenAI (ChatGPT, Codex) offer per tier on training, retention, processing location, admin controls and contract. GitHub Copilot, which passes the code on to models from several vendors, has its own section. We checked the terms and documentation of Anthropic and OpenAI on 27 November 2026 and those of GitHub on 29 November 2026. These pages change often, so check the current version before you decide.
The short answer per tier
Consumer: Claude Free, Pro, Max, Ultra and ChatGPT Free, Plus, Pro
- Anthropic: training only if the user turns on "Model Improvement", Claude Code included. Retention 30 days (off) or up to 5 years (on).
- OpenAI: training is on by default and also covers Codex. Deleted chats are removed within 30 days, with exceptions.
- Both: no zero data retention, no EU processing, no admin controls, no DPA.
- GitHub Copilot Free, Pro, Pro+ and Max: training has been on by default since 24 April 2026; the user has to turn it off. We found no retention period. No admin controls.
Business: Claude Team and ChatGPT Business
- Claude Team: no training (exception: feedback). Claude Code 30 days. No zero data retention, no EU option. Admin: SSO.
- ChatGPT Business: no training. Retention set by the workspace admin. EU storage only for a new workspace, without EU inference. Admin: SAML SSO.
Enterprise: Claude Enterprise and ChatGPT Enterprise/Edu
- Claude Enterprise: no training (exception: feedback). Custom retention, minimum 30 days; local Claude Code transcripts in the Compliance API and the Activity Feed are kept for 6 years by default. Zero data retention for Claude Code on request. No EU option from Anthropic directly. Admin: SSO, SCIM, domain capture, audit logs, Compliance API, IP allowlisting, roles.
- ChatGPT Enterprise/Edu: no training. Custom retention. API zero data retention does not apply here. EU storage and EU inference for new customers. Admin: SSO, SCIM, roles, Enterprise Key Management (EKM), Compliance Platform, Codex policy through
requirements.toml.
GitHub Copilot Business and Enterprise
- Both: no training, and no setting to turn it on. Chat and completions in the editor, the Copilot app and the CLI: inputs and outputs not retained by default. Other use, such as chat on github.com: retained for the life of the account. The code goes to models from, among others, OpenAI, Anthropic, Google and xAI. EU processing only on GitHub Enterprise Cloud with data residency, after a setting that is off by default.
API: Claude Code or Codex with an API key
- Anthropic API: no training unless an admin joins the Development Partner Program. 30 days. Zero data retention through sales. EU only through Amazon Bedrock or Claude on Google Cloud (Google-managed variant).
- OpenAI API: no training unless you opt in. Abuse-monitoring logs up to 30 days. Zero data retention after approval. EU projects through
eu.api.openai.comfor eligible organisations.
Personal subscriptions are the biggest risk
At Anthropic, every existing consumer user had to decide by 8 October 2025 whether their data may be used for training. That choice explicitly covers Claude Code used from those accounts. Turning it off later only stops the use of new data. What is already in a trained model stays there.
At OpenAI, training on Free, Plus and Pro is on by default, and that preference also applies to Codex conversations. The user has to turn it off under Settings, Data controls, "Improve the model for everyone". Codex is included in every ChatGPT plan, Free and Go as well.
Since 24 April 2026 GitHub follows the same line as OpenAI: on Copilot Free, Pro, Pro+ and Max, GitHub may use the interactions for training unless the user turns that off. More on that in the Copilot section below.
In all cases, a single engineer decides with a single setting what happens to your client's code. Business tiers move that decision to the organisation.
No training does not mean no storage
Business tiers still store your code. Claude Code under commercial terms: 30 days. Claude Team keeps saved chats in the product until they are deleted, after which they leave back-end storage within 30 days. Content Anthropic flags under its usage policy is kept for up to 2 years, the classification scores for up to 7 years. On the OpenAI API, abuse-monitoring logs are kept for up to 30 days, longer if the law requires it.
Watch the feedback buttons. At Anthropic, a thumbs up or down, /feedback or /bug stores the entire conversation, code included, for up to 5 years. On commercial tiers too, that feedback may be used for training after it is de-linked from user and customer IDs. At OpenAI, feedback on Business, Enterprise and Edu may not be used for training without a separate agreement. On a personal account, OpenAI may use the conversation behind the feedback even when training is off.
A court can also freeze deletion. In The New York Times copyright case, OpenAI had to preserve output logs of ChatGPT Free, Plus, Pro and Team, and of API use without zero data retention, deleted chats included. Enterprise, Edu and zero-retention API customers were excluded. According to OpenAI, that obligation ended on 26 September 2025, but a limited set of data from April to September 2025 remains under legal hold.
Zero data retention: narrower than the name suggests
Anthropic offers zero data retention for Claude Code in two ways. The first is Claude Code with API keys from a commercial organisation that has a ZDR arrangement through sales. Productivity data is exempt if metrics logging is enabled. The second is a separate option on Claude Enterprise for qualifying accounts. Anthropic enables it itself after an eligibility check; an admin cannot switch it on in the settings.
That Enterprise option covers Claude Code inference only. Chat, Cowork, analytics metadata and third-party MCP servers are outside it. Cloud sessions, Remote Control and the feedback commands are disabled at the backend. Flagged sessions may still be kept for up to 2 years. A number of newer models, which Anthropic calls "Covered Models", require at least 30 days of retention. In a zero data retention organisation these models are blocked unless Anthropic has agreed otherwise. Team and consumer plans have no zero data retention.
OpenAI offers zero data retention and Modified Abuse Monitoring on the API platform, after approval through sales, per organisation or project. According to OpenAI, Codex CLI keeps every request stateless precisely to support zero data retention. For ChatGPT Enterprise, OpenAI writes that the API control does not define retention for ChatGPT Work, and that local computer access through Work Cloud is not strict zero data retention. Whether Codex sessions signed in with an Enterprise login are retained is not stated anywhere. Ask OpenAI in writing.
EU processing: storage is not the same as inference
On ChatGPT Enterprise and Edu, new customers can choose storage in Europe (EEA and Switzerland), plus inference in Europe. Codex is on the list of content stored in-region. Third-party integrations such as MCP and web search, and data on the device itself, are not covered. Whether Codex inference falls under the EU arrangement is not stated explicitly. That, too, is a question for OpenAI.
On ChatGPT Business, you choose the storage region when you buy a new workspace; it cannot be enabled or changed later. Inference is not included, abuse-monitoring logs are stored in the US, and with a non-US region a copy of every prompt and response is kept in the US for a limited time. OpenAI does not say how long.
The OpenAI API offers EU projects through eu.api.openai.com, with storage and processing in Europe for supported modalities. The region is fixed when the project is created. The guide does not mention Codex.
At Anthropic directly, inference is global or us, and storage is us only. There is no EU option. To run Claude in the EU, you use Amazon Bedrock or Claude on Google Cloud in the Google-managed variant, in an EU region. The cloud provider is then the processor and its retention policy applies. In the Anthropic-managed Google Cloud variant, Anthropic remains the processor and the workspace uses us. AWS states that model providers have no access to prompts and completions in Bedrock.
GitHub Copilot: one subscription, several model vendors
Copilot is a different kind of product from Claude Code or Codex. GitHub supplies the assistant, but the model behind it comes from another company, among them OpenAI, Anthropic, Google and xAI. Your code goes to GitHub and from there to the vendor of the chosen model. The questions are the same; the answers differ per plan and per place where the engineer uses Copilot.
Training. Since 24 April 2026, on Copilot Free, Pro, Pro+ and Max, GitHub may use the interactions to train models: inputs, outputs, code snippets and associated context. The user turns that off in the Copilot settings, under "Allow GitHub to use my data for AI model training". On Copilot Business and Enterprise, GitHub does not use customer data for training, and the setting does not exist there.
GitHub's Trust Center names one safety net. It does not train on the contents of repositories of paid organisations, also not when an engineer works in them on a personal plan. And the interactions of an account that is a member of, or an outside collaborator on, a paid organisation are kept out of training. So that safety net depends on the GitHub account and the organisation. For an engineer with a personal account that is linked to no paid organisation, for example because your code is not on GitHub, the text names no exception.
Retention. For Business and Enterprise, retention depends on the place. For chat and completions in the editor, in the Copilot app and in the CLI, inputs and outputs are not retained by default; GitHub may keep them for a limited time to investigate a confirmed violation of its usage rules. For other use, such as chat on github.com, inputs and outputs are retained for the life of the account. Usage data is kept for two years. For the personal plans we found no retention period.
Sessions of the cloud agent, which works on a repository in an environment at GitHub, can be archived but not deleted.
Model vendors. GitHub states that none of the vendors may train on the data, and that it has a zero data retention agreement with OpenAI, Anthropic and xAI. One exception matters: for the Claude Fable models, Anthropic retains inputs and outputs by default, for its safety checks. An admin has to enable those models first. For every model you allow, ask which vendor runs it and what that vendor keeps.
EU processing. This exists only on GitHub Enterprise Cloud with data residency. There too, an admin first has to turn on the policy "Restrict Copilot to data residency compliant models"; it is off by default. After that, according to GitHub, code, prompts and responses stay in the region during inference. Fewer models are available and usage is charged 10% higher.
Admin controls. You keep personal plans out at the network: block *.individual.githubcopilot.com in the firewall and allow only the address of your own plan, *.business.githubcopilot.com or *.enterprise.githubcopilot.com. That works on the company network only, not on the laptop at home.
Local copies. The Copilot CLI and the Copilot app keep the complete record of every session under ~/.copilot/session-state/. By default those sessions are also synced to the user's GitHub account. On Business and Enterprise that happens only if the admin has enabled the policy "Store local sessions in the Cloud".
Contract. Business and Enterprise fall under GitHub's data protection agreement. GitHub announces new sub-processors 30 days in advance, and you may then terminate without penalty. For transfers to the United States, GitHub relies on its own certification under the EU-US Data Privacy Framework and on the standard contractual clauses. The personal plans fall under the general terms of service. GitHub is a US company and part of Microsoft; what is said below about the CLOUD Act applies here too.
What the coding agent sends
Claude Code and Codex CLI run on the engineer's laptop, but the model runs at the vendor. Each request carries prompts, outputs and tool results: the contents of every file the agent reads and the output of every command. Codex also sends AGENTS.md and the full, growing conversation. Running locally does not mean the code stays local.
Cloud agents are a different category. Claude Code on the web and Codex Cloud clone the repository into a vendor-managed virtual machine. Anthropic then stores the session transcript; on Claude Enterprise, cloud sessions are excluded from custom retention. At OpenAI, hosted execution state and snapshots follow their own lifecycle: ending a task or deleting a chat does not immediately purge everything. OpenAI gives no period. Codex Cloud is off by default for Enterprise workspaces.
Both tools also keep full plaintext transcripts locally: Claude Code under ~/.claude/projects/ (30 days by default, adjustable with cleanupPeriodDays), Codex under ~/.codex ([history] persistence = "none" stops history.jsonl; check whether other files under ~/.codex still hold transcripts). Those are copies of client code on laptops.
What an admin can enforce
The first priority is to stop engineers signing in with a personal account. Claude Code has the managed settings forceLoginMethod and forceLoginOrgUUID for this. Codex enforces this through requirements.toml (/etc/codex/requirements.toml) with allowed_login_methods and allowed_chatgpt_workspaces; users cannot override these.
Telemetry and feedback can be switched off too, but check how firmly. Claude Code: DISABLE_TELEMETRY=1, DISABLE_ERROR_REPORTING=1, DISABLE_FEEDBACK_COMMAND=1 and CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, set in managed-settings.json, through MDM or as server-managed settings; only managed settings cannot be overridden by the user. This matters because /feedback uploads the conversation with code and can optionally create a public GitHub issue. Codex: [analytics] enabled = false and [feedback] enabled = false; both are on by default. You can roll these out as managed defaults, but the documentation does not list them as enforceable, so check on the laptops that they stay off.
Contract, sub-processors and the CLOUD Act
EEA customers of both vendors contract with an Irish entity: Anthropic Ireland, Limited and OpenAI Ireland Ltd. Both data processing agreements rely on the EU Standard Contractual Clauses (SCCs). For new sub-processors, Anthropic gives you 15 days to object, followed by good-faith consultation and no termination right. OpenAI gives 30 days, after which either party may terminate. Only OpenAI's agreement promises notice of binding law-enforcement requests, where the law allows. Neither agreement mentions the EU-US Data Privacy Framework; whether the US parent companies participate in it is something to confirm with the vendor.
Both hold SOC 2 Type II and ISO/IEC 27001:2022, and both list ISO/IEC 42001:2023. Check which services each certificate covers.
Both parent companies are American. The CLOUD Act (18 U.S.C. 2713) requires a US provider that receives a valid US warrant or order to preserve or disclose data within its "possession, custody, or control", wherever that data is located. EU storage or EU inference does not by itself remove that. The US Department of Justice lists no concluded CLOUD Act agreement with the EU. Whether the law reaches data held by the Irish subsidiaries is a legal question that vendor documentation does not answer.
5 practical steps
- Take stock of the accounts. Which engineers use which tool, on a personal or company account, with a login or an API key?
- Only business tiers for client code. Sign the DPA, archive the version and record the Irish contracting entity. A data processing agreement covers personal data only; confidentiality of the code is a matter for the contract and the NDA.
- Roll out managed settings centrally: login pinned to the company organisation, telemetry and feedback off (and verify they stay off), a short period for local transcripts, and no cloud agents for repositories under NDA without the client's consent.
- Get zero data retention in writing. If you need it, ask exactly what it covers: the local agent, cloud sessions, feedback, metrics.
- Read the client's NDA. A cloud service from a US group is a third party with a chain of sub-processors. Record the vendor pages and their dates in your supplier register and check them every quarter.
When the code may not leave the building
Sometimes the client simply says no. Then a local language model is the alternative: it runs on your own hardware and nothing goes to an external service. We work that way ourselves: client data does not go to online AI services without written permission. To test it with real questions from your engineers, there is the service knowledge pilot.
General information, not legal advice.
Sources
- Anthropic: Updates to our consumer terms
- Claude Code: Data usage
- Claude Code: Zero data retention
- Anthropic: Is my data used for model training? (consumer)
- Anthropic: How long do you store my data? (consumer)
- Anthropic: Is my data used for model training? (commercial)
- Anthropic: How long do you store my organization's data?
- Anthropic: Custom data retention for Enterprise
- Anthropic: API and data retention
- Anthropic: Data residency
- Anthropic: Regional compliance
- Anthropic: Covered Models
- Anthropic: Pricing
- Anthropic: Commercial terms
- Anthropic: Data processing addendum
- Anthropic: Privacy policy
- Anthropic Trust Center and sub-processors
- AWS: Data protection in Amazon Bedrock
- OpenAI: Data controls in ChatGPT
- OpenAI: How your data is used to improve model performance
- OpenAI: Using Codex with your ChatGPT plan
- OpenAI: Archiving and deleting Codex chats
- OpenAI: Chat and file retention in ChatGPT
- OpenAI: Where your ChatGPT Business content is stored
- OpenAI: Data residency and inference residency for ChatGPT
- OpenAI: Compliance Platform for Enterprise and Edu
- OpenAI: Enterprise privacy
- OpenAI: Business data
- OpenAI: EU privacy policy
- OpenAI: Data processing addendum
- OpenAI: Sub-processor list
- OpenAI Trust Portal
- OpenAI: Response to NYT data demands
- OpenAI API: Your data
- OpenAI API: Data residency
- OpenAI: Unrolling the Codex agent loop
- Codex: Enterprise admin setup
- ChatGPT Work Cloud security
- Codex: Agent approvals and security
- Codex: Advanced configuration
- Codex: Configuration reference
- Codex: Managed configuration
- GitHub Copilot: Managing policies (model training)
- GitHub Copilot: Hosting of models
- GitHub Copilot Trust Center: FAQ
- GitHub Copilot: Session data
- GitHub Copilot: Manage and track agents
- GitHub Enterprise Cloud: Copilot with data residency
- GitHub Copilot: Managing network access
- GitHub: Data Protection Agreement
- GitHub: Terms of Service
- GitHub Copilot: Plans
- 18 U.S.C. 2713 (Cornell LII)
- US DOJ: CLOUD Act resources
Keep code and data in-house?
A working pilot with a local language model inside your network, tested on real questions from your engineers.