# Which AI coding agents train on your code by default, and the switch that stops each one

> Copilot, Codex, Antigravity and Devin can train on personal-plan sessions unless you opt out. Claude Code asks; Cursor has Privacy Mode. The exact switch for each.

Published 2026-11-30 · https://smarterthanus.ai/coding-agents-train-on-your-code-opt-out/

## TL;DR

- GitHub Copilot Free, Pro and Pro+ have used interaction data, including code snippets, for training since **24 April 2026** unless you opt out.
- OpenAI applies your ChatGPT training setting to Codex, and a **thumbs up or down** can send the whole conversation to training even after you opt out.
- Claude Code keeps consumer data **5 years** with training on and **30 days** with it off; Cursor trains only with Privacy Mode off.
- A training switch doesn't control everything that leaves your machine: telemetry, feedback reports and uploads have their own settings.

On a personal plan, **four of the six coding agents below can use your sessions to train models unless you switch it off**: GitHub Copilot, OpenAI Codex, Google Antigravity, and Cognition's Devin and Windsurf. Claude Code trains only if its model-improvement setting is on, and Cursor only when Privacy Mode is off. Business and enterprise plans are excluded almost everywhere. Every agent still sends the code it reads to a remote model. The switches below only decide what happens to that code afterwards.

We read each vendor's own policy pages on 30 November 2026. Everything below is what the vendors say. We didn't test their traffic ourselves.

## The default for each agent, on individual plans

| Agent | Trains on your sessions by default? | Where to switch it off | Business plans |
|---|---|---|---|
| GitHub Copilot Free, Pro, Pro+ | Yes, since 24 April 2026 | github.com/settings/copilot, under **Privacy** | Business and Enterprise excluded |
| OpenAI Codex (ChatGPT Free, Plus, Pro) | Yes | ChatGPT Settings > Data controls > **Improve the model for everyone** off | Business, Enterprise, Edu, API: not used by default |
| Claude Code (Free, Pro, Max, Ultra) | Only if the setting is on | claude.ai/settings/data-privacy-controls | Team, Enterprise, API: not trained on |
| Cursor | Only with Privacy Mode off | Settings (Ctrl/Cmd+Shift+J) > General > **Privacy Mode** on | On by default for teams |
| Google Antigravity (consumer) | Yes | Antigravity settings (the terms don't name the toggle) | Workspace and Enterprise have separate terms |
| Devin and Windsurf (Cognition) | Yes | Paid plans: Settings > General > Data controls & privacy > **Disable training** | Teams: admin only; Enterprise: written consent |

## GitHub Copilot: on since April

GitHub's [policy update](https://github.blog/news-insights/company-news/updates-to-github-copilot-interaction-data-usage-policy/) covers Copilot Free, Pro and Pro+. From **24 April 2026**, "inputs, outputs, code snippets, and associated context" are used for training unless you opt out. GitHub's list includes the code around your cursor, your comments, file names, repository structure and how you move around the code.

Private repositories "at rest" are excluded. Code that Copilot processes while you work in a private repo can still be used. The data may go to GitHub affiliates, including Microsoft. If you opted out before the change, GitHub says your choice was kept. To check, open github.com/settings/copilot and look under Privacy.

This matters most if you use Copilot for free. Copilot Free is an individual plan, so the training default applies to it.

## OpenAI Codex: one switch, plus the feedback buttons

OpenAI's [help page](https://help.openai.com/en/articles/5722486-how-your-data-is-used-to-improve-model-performance) says that on personal plans "we may use your content to train our models". It also says "your ChatGPT model-training preference applies to your Codex conversations." You can turn off **Improve the model for everyone** in ChatGPT or choose "Do not train on my content" in OpenAI's Privacy Portal. Either one covers both ChatGPT and Codex.

There is one exception. If you press thumbs up or thumbs down, OpenAI "may use the entire conversation associated with that feedback" for training, even after you opt out. On Business, Enterprise and Edu, feedback doesn't trigger training.

The Codex CLI also has local settings for its own analytics and for `/feedback` uploads. Per the [config reference](https://learn.chatgpt.com/docs/config-file/config-reference), `feedback.enabled` is true by default. To turn both off, add this to `~/.codex/config.toml`:

```toml
[analytics]
enabled = false

[feedback]
enabled = false
```

## Claude Code: you choose, and it decides retention

Anthropic's [Claude Code data page](https://code.claude.com/docs/en/data-usage) says it trains on Free, Pro, Max and Ultra accounts "when this setting is on", and that includes Claude Code. The same setting decides how long your data is kept: **5 years** with training on, **30 days** with it off. Team, Enterprise and API use is not trained on.

Three other channels send data, and each has its own switch:

- **Metrics** (latency, usage) are on by default when you use Anthropic's API. Anthropic says they never include code, prompts or file paths. `DISABLE_TELEMETRY=1` turns them off.
- **Error reports** are on for Pro, Max and Ultra sign-ins on v2.1.198 and later, with secrets and paths redacted. `DISABLE_ERROR_REPORTING=1` turns them off.
- **`/feedback`, `/bug` and `/share`** send your conversation, code included, and Anthropic keeps it for 5 years. `DISABLE_FEEDBACK_COMMAND=1` blocks them. The session survey uploads a transcript only if you answer Yes to its follow-up question.

To switch off all non-essential traffic at once, put this in `~/.claude/settings.json`:

```json
{
  "env": {
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}
```

Anthropic notes that this also turns off feature flags, which can make Remote Control unavailable. It doesn't stop the WebFetch safety check, which sends only the hostname you're fetching. On your own machine, Claude Code keeps transcripts in plain text under `~/.claude/projects/` for 30 days. For what each plan costs, see our [Claude pricing guide](https://smarterthanus.ai/claude-pricing-2026-plans-api-claude-code/).

## Cursor: Privacy Mode, free on every plan

Cursor's [data-use page](https://cursor.com/data-use) says that with Privacy Mode off it "may use and store codebase data, prompts, editor actions, and code snippets" to train its models. With Privacy Mode on, Cursor doesn't train on your data, and its model providers have agreed to keep none of it. Prompts that trip a provider's abuse filter can still be stored for investigation.

Cursor's [security page](https://cursor.com/security) says Privacy Mode is available to anyone, free or Pro. Its [help page](https://cursor.com/help/security-and-privacy/privacy) says it is on by default for teams but doesn't say what the default is for individual accounts, so check the toggle yourself. The no-storage agreements don't cover you when you use your own API key. In that case your model provider's policy applies.

## Google: Gemini CLI is now Antigravity, and the terms are broad

On **18 June 2026**, Gemini CLI was [replaced by Antigravity CLI](https://geminicli.com/docs/resources/tos-privacy) for unpaid and Google One users, and Gemini CLI [stopped serving their requests](https://developers.googleblog.com/an-important-update-transitioning-gemini-cli-to-antigravity-cli). The [Antigravity terms](https://antigravity.google/terms) say Google uses your "Interactions" (your user data, interaction data, metadata and feedback) "to evaluate, develop, and improve Google and Alphabet research, products, services and machine learning technologies". They add that "Google employees and contractors may access, view, review and use" them.

To opt out, the terms tell you to "navigate to settings to change your preference", without naming the setting. They also say Google still uses your data to run the service and handle feedback "even when your Telemetry is toggled off". To delete stored Interactions, email antigravity-support@google.com.

If you still run Gemini CLI with a free Gemini API key, the [API terms](https://aistudio.google.com/docs/terms) say Google uses what you send to improve its products, and human reviewers may read it. This doesn't apply in the EEA, Switzerland and the UK, where the paid terms cover everything.

## Devin and Windsurf: opt-out listed only for paid plans

Cognition's [security page](https://windsurf.com/security) says: "By default, we may use your data for model training purposes to improve and enhance the Services." The windsurf.com/security address now redirects to that Devin security page, which doesn't mention Windsurf by name, so the Windsurf part rests on the redirect. Paid users can switch on **Disable training** under Data controls & privacy, which also stops Cognition's model providers from keeping your data. The page offers this only on paid plans. On Teams, only an admin can switch it on. Enterprise data isn't trained on without written consent.

## A training switch doesn't control uploads

Agreeing to training and sending data off your machine are two separate things. Arize [reports](https://arize.com/blog/ai-coding-agent-privacy/) that in July 2026 a researcher captured the traffic from xAI's Grok Build CLI (v0.2.93). The task needed about 192 KB of traffic, but the CLI also uploaded **5.1 GB** to a storage bucket, including the repository's full git history. Turning off "Improve the model" didn't stop the upload. A later change on xAI's servers did. This is one researcher's capture as reported by Arize, and xAI hasn't published a security advisory about it.

If you need to know what actually leaves your machine, watch the traffic yourself. Our guide to [checking what local AI tools send](https://smarterthanus.ai/local-ai-network-traffic-ollama-lm-studio-llama-cpp/) shows how. Running a model locally is the only setup where your code never goes to a vendor.

## Sources

- [GitHub blog: Updates to GitHub Copilot interaction data usage policy](https://github.blog/news-insights/company-news/updates-to-github-copilot-interaction-data-usage-policy/)
- [OpenAI Help: How your data is used to improve model performance](https://help.openai.com/en/articles/5722486-how-your-data-is-used-to-improve-model-performance)
- [OpenAI Codex configuration reference](https://learn.chatgpt.com/docs/config-file/config-reference)
- [Claude Code docs: Data usage](https://code.claude.com/docs/en/data-usage)
- [Cursor: How your data is used](https://cursor.com/data-use)
- [Cursor Help: Privacy and data](https://cursor.com/help/security-and-privacy/privacy)
- [Cursor: Security](https://cursor.com/security)
- [Google Antigravity Terms of Service](https://antigravity.google/terms)
- [Gemini CLI: License, Terms of Service, and Privacy Notices](https://geminicli.com/docs/resources/tos-privacy)
- [Google Developers Blog: Transitioning Gemini CLI to Antigravity CLI](https://developers.googleblog.com/an-important-update-transitioning-gemini-cli-to-antigravity-cli)
- [Gemini API Additional Terms of Service](https://aistudio.google.com/docs/terms)
- [Gemini Code Assist for individuals privacy notice](https://developers.google.com/gemini-code-assist/resources/privacy-notice-gemini-code-assist-individuals)
- [Security at Cognition (Devin, Windsurf)](https://windsurf.com/security)
- [Arize: Is your coding agent uploading all your code?](https://arize.com/blog/ai-coding-agent-privacy/)
