# Does an AI Coding Agent Share Your Code? Plain Guide

> What happens to your code when an AI coding agent works on it: what leaves your computer, who may train on it, how long it is kept, and what you can switch off.

Canonical: https://bridge-terminal.com/atlas/blog/does-ai-coding-agent-share-your-code-privacy/
Last updated: 2026-11-03

Published 3 November 2026 · Plain English · Explainer · 7 min read

## The short version

- An AI coding agent sends your instructions and the parts of your project it reads to the AI company's servers, so your code does leave your computer.
- Whether Anthropic may train on that material depends on your plan: consumer plans (Free, Pro, Max, Ultra) have a setting you control; commercial plans and the API do not train on it unless the customer opts in.
- How long Anthropic keeps Claude Code data also depends on the plan: for consumer accounts it is 30 days if you do not allow training and 5 years if you do.
- The riskiest data is often not code but passwords, keys and customer records, so keep them out of chat and out of the agent's reach.
- Before you start, check three things: your plan's training setting, the optional feedback and reporting switches, and whether the agent has internet access.

Yes, an AI coding agent sends your code to someone else's computers. The agent itself may run on your machine, but the model that does the "thinking" runs on the AI company's servers, so whatever the agent reads has to travel there. What matters is what is sent, who may use it, how long it is kept, and which switches you control.

This guide covers that in plain English. It uses Claude Code and OpenAI Codex as the examples. It is not legal advice. Rules differ by plan and change over time, so treat the details below as a checklist of what to confirm, not a guarantee. The details here were checked against the vendors' documentation on 3 November 2026.

## What actually leaves your computer?

Think of the agent as a contractor who works in your office but phones a very capable colleague for every decision. Each phone call contains what the contractor can see.

Anthropic's documentation says Claude Code runs locally, but to talk to the model it sends data over the network that includes "all user prompts and model outputs", encrypted in transit. In practice that means:

- Your instructions to the agent.
- The files, error messages and command results it reads while working.
- The agent's replies and the changes it proposes.

If the agent opens a file that holds a customer list, that list is part of the call. If you paste a password into the chat, the password is part of the call. The agent only sends what it reads, but it reads whatever it needs, and you may not see every file it opens.

## Can the AI company train on my code?

This is the question founders ask most, and the answer depends on the plan you pay for.

For Claude Code, Anthropic's data page splits users into two groups:

- **Consumer plans (Free, Pro, Max and Ultra).** You get a choice to allow your data to be used to improve future Claude models. When the setting is on, Anthropic trains new models on data from these accounts, including Claude Code use.
- **Commercial plans (Team and Enterprise plans, the API, third-party platforms and Claude Gov).** Anthropic says it does not train its generative models on code or prompts sent to Claude Code under commercial terms, unless the customer has chosen to provide data for model improvement, for example through its Development Partner Program.

The catch for small teams is that a solo founder on a personal Pro or Max plan is on the consumer side. Open your account's privacy settings and look at that training choice on purpose. Do not assume it is off.

For Codex, OpenAI's security page says nothing about whether your data is used for training, and gives no general retention period. Those rules sit in OpenAI's separate terms and your plan's data controls. Check them for your plan before you put sensitive work through it.

## How long is my data kept?

For Claude Code, Anthropic lists these retention periods:

- Consumer accounts that allow data use for model improvement: 5 years.
- Consumer accounts that do not allow it: 30 days.
- Team, Enterprise and API accounts: 30 days as standard. "Zero data retention", meaning nothing is stored on Anthropic's side, is available to qualified accounts on Claude for Enterprise. It is not part of the standard Enterprise plan and is set up per organisation by the account team.

You can change the privacy setting at any time.

Your own computer keeps a copy too. Claude Code stores session transcripts on your machine in plain text for 30 days by default, so a session can be resumed. Anyone with access to the laptop can read them. If the laptop holds client work, treat it like any other machine with client files on it: lock it, encrypt the disk, and do not leave it logged in.

## What are the extra ways data can leave?

Beyond the main conversation, there are smaller channels worth knowing about. Anthropic documents a setting for each of them.

**Feedback reports.** If someone on your team uses the feedback command in Claude Code, a copy of the conversation history, including code, is sent to Anthropic. The bug and share commands go the same way. Anthropic says these transcripts are kept for 5 years. A setting turns the feedback command off.

**Session surveys.** The "How is Claude doing this session?" rating records only the rating. A separate follow-up asks whether Anthropic may look at the session transcript. Nothing is uploaded unless someone clicks Yes. When they do, known key and token patterns are removed first, but source code and file contents are uploaded as they are. Shared transcripts are kept for up to 6 months. The surveys can be switched off.

**Usage statistics and error reports.** Anthropic says usage metrics never include your code, prompts or file paths. Error reports contain error messages and stack traces from the tool's own internals, with known secret patterns, file paths and email addresses removed first. Error reports are on only for people who sign in with a Pro, Max or Ultra plan, on Claude Code version 2.1.198 or later, connecting directly to Anthropic. Both can be switched off.

**Web look-ups.** Before the agent fetches a web page, it sends the site's hostname, not the full address or the page, to Anthropic to check it against a safety blocklist. There is a setting to turn the check off.

**Codex.** OpenAI's page says Codex runs with network access off by default, and that its sandbox typically limits writing to the current workspace. Its telemetry export is off unless you turn it on. Saved session transcripts can be stored locally, and settings control that. The page does not state the defaults.

## Does internet access make it riskier?

Yes. An agent with no internet can still read and change your project, but it cannot easily send things to a stranger's website. An agent with internet access can also read web pages, and a page can carry hidden instructions meant to trick it. This is called prompt injection. OpenAI's page warns that it can cause the agent to fetch and follow untrusted instructions, and advises treating web results as untrusted.

The sensible default is the one Codex uses: network off unless a task needs it.

## What should I keep away from the agent?

Code is rarely the worst thing to leak. These are:

- **Passwords, API keys and tokens.** Never paste them into a chat. Put them in a proper secrets store and let the software read them there.
- **Real customer data.** Use made-up sample data for building and testing. A database dump with real names and emails does not belong in a coding session.
- **Anything under a contract that bans sharing.** Some client agreements forbid sending their material to third parties. An AI service is a third party.

## A five-minute checklist before you start

1. Find your plan and note which side it falls on: consumer or commercial.
2. Check the training setting for that account and set it on purpose.
3. Ask whoever sets up the tool to switch off the feedback command, surveys and optional reporting if your client work needs it.
4. Keep internet access for the agent off, or limited, unless a task requires it.
5. Agree a rule: no keys, passwords or real customer data in chat, ever.
6. Put the rules in writing for your agency or team, so a new hire does not break them on day one.

## How does Atlas fit in?

[Atlas](https://bridge-terminal.com/atlas/) is a team of AI engineers built on Claude Code, and it runs on your own Claude Pro or Max account. Those are consumer plans, so the training and retention rules above apply to you directly, and you should check them first. Atlas does two things here: a secret pasted into its chat goes to a secret store first, and the transcription of recordings you give it happens on your own machine. Neither replaces the checklist above.

Atlas does not yet give one page that lists everything leaving your machine. That is coming to Atlas, built in, so it needs no setup on your side. Until then, use the checklist above.

## The bottom line

Your code does travel to the AI company when an agent works on it. That is not a reason to avoid agents, but it is a reason to choose your plan with care, set the training choice yourself, close the optional reporting channels, and keep secrets and customer data out of reach. A few minutes of setup now is cheaper than explaining a leak to a client later.

## Questions people ask

### Does Claude Code send my code to Anthropic?

Yes. Claude Code runs on your machine but sends your prompts and model outputs, which include the files and results it reads, to Anthropic's servers, encrypted in transit. Whether Anthropic may train on that depends on your plan and settings.

### Does Anthropic train on my code if I use Claude Pro or Max?

Consumer plans (Free, Pro, Max, Ultra) have a setting that lets you allow or refuse use of your data to improve models. When it is on, Anthropic trains on that data, including Claude Code use, so check the setting in your account's privacy controls.

### How long does Anthropic keep Claude Code data?

For consumer accounts it is 30 days if you do not allow training and 5 years if you do. Team, Enterprise and API accounts have 30 days as standard, and zero data retention is available to qualified accounts on Claude for Enterprise.

### Does Codex have internet access by default?

No. OpenAI's documentation says Codex runs with network access off by default, and its sandbox typically limits writing to the current workspace. You can turn network access on, which adds the risk of prompt injection from untrusted web content.

### What should I never paste into an AI coding agent?

Passwords, API keys, tokens, real customer data and anything a contract says you may not share with third parties. Use a secrets store and made-up sample data instead.

## About Atlas: Where Atlas helps with your data, and what is coming

Atlas runs on your own Claude account, so your plan's training and retention rules apply. A secret pasted into Atlas's chat goes to a secret store first, and recordings are transcribed on your own machine. A single page showing what leaves your machine is coming to Atlas, built in; until then, use the checklist in this article. — https://bridge-terminal.com/atlas/

## Sources

- [Claude Code: Data usage](https://code.claude.com/docs/en/data-usage)
- [Codex: Agent approvals and security](https://learn.chatgpt.com/docs/agent-approvals-security)

_Researched and drafted with Claude, then checked against the sources above. Atlas is an independent product, not affiliated with Anthropic or OpenAI._

## Related

- [How to Brief an AI Coding Agent: A Plain-English Guide](https://bridge-terminal.com/atlas/blog/how-to-brief-ai-coding-agent-plain-english/)
- [How to Report a Bug to an AI Coding Agent](https://bridge-terminal.com/atlas/blog/how-to-report-a-bug-to-ai-coding-agent/)
- [Can an AI Coding Agent Work Overnight? A Plain Guide](https://bridge-terminal.com/atlas/blog/can-ai-coding-agent-work-overnight-unattended/)
