← All news and guides
Security

The Hidden Data Flows in Your AI Coding Assistants

What AI coding assistants send out, who keeps it and who trains on it, with Claude Code, Cursor and Copilot compared, plus the controls that work and fail.

Mono Team ·

A developer's laptop on a desk at night with a single network cable running off the edge of the desk into shadow, a small lamp lighting the keyboard.

Short answer: an AI coding assistant sends your prompts, the code around your cursor, any file it reads and the output of any command it runs to a vendor's servers, and what happens next depends on the plan you are on, not the product you installed. As of 20 November 2026, the vendors we checked say they do not train on business-plan data by default. They also say that personal plans can train on your code unless the user opts out, and that retention runs from zero to five years depending on tier and settings. The leaks that matter most are usually your own: secrets in working directories, production data in test fixtures, and developers on personal accounts. This guide maps each data flow, compares what Claude Code, Cursor and GitHub Copilot say about it, and lists the controls that work and where they stop.

This is an engineering guide, not legal advice. Every vendor statement below carries its source and the date we checked it.

What data actually leaves your machine when a developer uses an AI coding assistant?

A tidy developer's desk at night with a closed laptop, a coiled network cable and a small desk lamp casting warm light, the room behind softly out of focus.

A coding assistant is more than autocomplete. Modern tools read files, run shell commands and call other tools, and each step can put your data into a request. These are the channels to check.

ChannelWhat leaves your machineHow it goes wrong
Prompt and contextWhat leaves your machine: The prompt, open files, selected code, @-mentioned files and other context the tool addsHow it goes wrong: A developer pastes a customer record to explain a bug
Agent file readsWhat leaves your machine: Whole files the agent opens while it worksHow it goes wrong: The agent reads a `.env` file or a config with live credentials
Command outputWhat leaves your machine: Terminal output the agent reads back as contextHow it goes wrong: A failing script prints a database row or a token, and it joins the next request
Codebase indexingWhat leaves your machine: Chunks or embeddings of your repository, for search, in tools that offer itHow it goes wrong: A repository with committed dumps or secrets is indexed whole. Check each vendor's documentation for what it indexes and where it is stored
Vendor backendWhat leaves your machine: Requests routed through the vendor's servers, even when you bring your own model keyHow it goes wrong: Your own API agreement with a model provider does not cover the extra hop
Telemetry and feedbackWhat leaves your machine: Usage metrics, error reports and, in some tools, full transcripts when a user sends feedbackHow it goes wrong: A bug report includes a conversation full of code and data
Local history and cloud agentsWhat leaves your machine: Transcripts stored on the laptop, or a clone of your repository in the vendor's environmentHow it goes wrong: A plaintext history on a lost laptop, or code held on infrastructure you have not assessed
Tools and extensionsWhat leaves your machine: Anything a connected MCP server or plugin receives or can fetchHow it goes wrong: A third-party server gets file contents, or feeds the agent hostile instructions

The agent chooses which files to read, so "what did we paste into the chat?" no longer covers the exposure. Ask what the agent could read.

What do Claude Code, Cursor and GitHub Copilot say about training and retention?

These are the vendors' own statements, checked on 20 November 2026. Treat the table as a snapshot and re-check the source before you rely on it.

ToolBusiness or enterprise tierPersonal tierSource and date
Claude CodeBusiness or enterprise tier: Anthropic says it does not train on code or prompts sent under commercial terms (Team, Enterprise, API) unless the customer chooses to provide data. Standard retention is 30 days. Zero data retention is available per organisation to qualified Enterprise accountsPersonal tier: Free, Pro, Max and Ultra users choose whether their data is used for training. Retention is 5 years if training is allowed and 30 days if notSource and date: code.claude.com/docs/en/data-usage, checked 20 November 2026
CursorBusiness or enterprise tier: With Privacy Mode on, Cursor says customer data will not be used for training by Cursor, and model providers will not store or train on it. Data may be stored for investigation if abuse detectors triggerPersonal tier: With Privacy Mode off, Cursor says it may use and store codebase data, prompts, editor actions and code snippets to improve features and train modelsSource and date: cursor.com/data-use, last updated 3 September 2026
GitHub CopilotBusiness or enterprise tier: GitHub says Copilot Business and Copilot Enterprise users are not affected by the interaction-data changePersonal tier: From 24 April 2026, Free, Pro and Pro+ interaction data (inputs, outputs, code snippets, file names and repository structure) can be used to train models unless the user opts outSource and date: GitHub blog, 25 March 2026
  • Training and retention are separate questions. A vendor can promise not to train on your code and still keep prompts for 30 days. Record both.
  • The tier is the control. The same developer, in the same editor, has a different data position on a personal plan and a company plan.
  • Bringing your own key does not remove the vendor. Cursor's page says that even with your own API key, requests still go through its backend.

We have not stated Copilot retention periods here. Secondary sources disagree, so read GitHub's Copilot Trust Center (copilot.github.trust.page) for current retention before you record a figure.

Does the deployment route change the answer?

Yes. Anthropic's data-usage page says that with Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry or Claude Platform on AWS, Claude Code's error reporting, telemetry and bug reporting are off by default, and that the commercial-terms training policy covers third-party platforms. That changes who your contract is with, where the request is processed and what is kept. It does not by itself keep data in India. Record the route per team. Only a self-hosted model keeps code on your network by design, at its own engineering cost.

Why are personal accounts the biggest risk?

Shadow AI in engineering looks like this: a developer signs in to an assistant with a personal email and opens the company repository. Nothing is bought, so nothing shows in procurement, and the personal tier's training and retention terms apply to your code.

The usual sign is a gap between paid seats and developers contacting AI vendor domains. Our shadow AI audit looks for this kind of gap across the whole company, and developer tools are one of the channels it checks.

Banning the tools rarely works. Provide a sanctioned business-plan tool that is easier to use than the alternative, and block personal sign-in on company devices where you can.

What sensitive data ends up in coding assistants?

Think in categories, then check where each could enter the tool.

  • Secrets: API keys, database passwords and tokens in `.env` files, shell history, CI config and terminal output.
  • Production data: customer rows pasted into prompts, database dumps used as fixtures, and logs with names, phone numbers or account numbers.
  • Confidential material: proprietary code, internal architecture notes, and code or data you hold under a contract that limits where it can go.

Some Indian identifiers are easy to scan for in repositories and fixtures. A PAN is ten alphanumeric characters, a full Aadhaar number is 12 digits, and a UPI ID looks like `username@pspname`. Redaction tools such as Microsoft Presidio ship recognizers for PAN, Aadhaar (with a checksum) and GSTIN. They reduce leakage, but test recall on your own data. Our guide to PII redaction for LLMs covers the setup.

Does the DPDP Act apply to what developers paste into an AI tool?

It can. The DPDP Act applies to digital personal data, and "processing" in Section 2(x) covers collection, storage, sharing and erasure. If a developer pastes a customer's record into a prompt, or an agent reads a fixture that holds real customers' data, that is processing by your company as a Data Fiduciary. The assistant vendor is then usually acting as a Data Processor, which Section 2(k) defines as a person who processes personal data on behalf of a Data Fiduciary.

Three duties follow, and they apply from 13 May 2027.

  • A valid contract with the processor. Section 8(2) requires one. Check that developers use a plan under your business agreement.
  • Responsibility stays with you. Section 8(1) keeps the fiduciary responsible for processing done on its behalf, and Section 8(5) requires reasonable security safeguards to cover personal data a processor handles.
  • Erasure reaches processors. Section 8(7)(b) makes you cause your processor to erase data it was given once the purpose is served, unless a law requires retention. A vendor that keeps prompts for 30 days or longer needs to be in your erasure plan.

The easiest way to meet these duties is to keep personal data out of the tool: use synthetic or masked data in development, and give the agent no access to production. DPDP does not require data to stay in India, and no transfer restriction under Section 16 had been notified as of November 2026. Counsel decides whether your own use is lawful. For the wider question of staff using chat tools, see our guide to ChatGPT and AI tools under DPDP.

Which controls actually stop data leaving, and where do they fail?

A row of plain grey metal filing cabinets in a quiet office, one drawer left slightly open, soft even light, the far end blurred.

Most assistants let you tell the tool which files to avoid. Each vendor says plainly that these controls are not guarantees.

ToolControlWhat the vendor says about its limits
CursorControl: `.cursorignore` blocks ignored files from Agent and Tab, and from @ mention referencesWhat the vendor says about its limits: The terminal and MCP server tools used by Agent cannot block access to code covered by `.cursorignore`. Cursor also says complete protection is not guaranteed because of LLM unpredictability
Claude CodeControl: `Read` deny rules in settings, such as `Read(./.env)` or `Read(./secrets/)`. A `.claudeignore` file has no effectWhat the vendor says about its limits: Claude makes a best-effort attempt to apply `Read` deny rules to built-in tools that read files. Bash rules match the command text and are not a security boundary. For filesystem and network enforcement, Anthropic points to sandboxing
GitHub CopilotControl: Content exclusion, on Copilot Business and Copilot EnterpriseWhat the vendor says about its limits: GitHub says it is not a filesystem security boundary and cannot guarantee prevention of every form of file access. It is not guaranteed to be respected by third-party MCP servers or clients. Support varies by IDE and by feature. Copilot may still use semantic information from excluded files if the IDE provides it indirectly

The pattern is the same everywhere. Ignore rules cover the tool's own file readers, not a shell command that prints the file or a connected server that opens it. Treat them as a second layer and put the real control in the environment.

What should engineering teams change so the tool never sees the secret?

The strongest controls remove the data from the machine, so no ignore file is needed.

  • Keep secrets out of working directories. Load them from a secret manager at run time. Use short-lived credentials for local development, scoped to a dev environment.
  • No production access from developer laptops. If the agent can run a database client against production, it can read production rows. Give developers a masked or synthetic copy.
  • Synthetic fixtures. Generate test data. Never commit database dumps. Add a pre-commit secret and PII scan, so a leaked token or a PAN in a fixture is caught before the agent indexes it.
  • Run agents in a dev container or sandbox. Limit the files they can see and allow only the network domains the work needs.
  • Keep a human in the loop. The MCP specification recommends there should always be a human able to deny tool invocations. Keep approval prompts on for commands that touch secrets or leave the machine.
  • Redact before you send, where you can. A gateway can strip identifiers and log requests. Test its recall on your data first.

How do MCP servers and plugins change the picture?

An MCP server is code or a service the agent calls as a tool. It can receive file contents and return text the agent treats as instructions, so it is both a data path and an attack path.

The risk is real. CVE-2025-6514 (published 9 July 2025) is a command injection in the mcp-remote client, versions 0.0.5 to 0.1.15, triggered by a malicious server, with a CVSS 3.1 score of 9.6. CVE-2025-49596 (13 June 2025) is an unauthenticated remote code execution flaw in MCP Inspector before 0.14.1, with a CVSS 4.0 score of 9.4. Researchers have also reported prompt-injection attacks that use MCP tools to pull private data. We could not confirm those reports against a primary source.

In the MCP specification, authorization is optional. It recommends that HTTP transports follow it, so whether a server checks who is calling it is a choice its author made. Keep an approved list of servers, pin versions, review what each one can read, and disable the rest. Our MCP server security guide goes through this in more detail.

How do you find out what your developers are already using?

  • Ask first. A short, no-blame survey: which assistants, on which plan, with which repositories?
  • Compare seats with activity. Match paid licences against the extensions and command-line tools on managed devices.
  • Read network logs. Proxy or DNS logs show which AI vendor domains company laptops contact.
  • Check repositories. Assistant settings files, ignore files and MCP configuration committed to repositories show which tools the team treats as normal.

A tech audit can include this inventory, with a review of how secrets, test data and access are handled around the tools.

What should you record for each approved AI coding tool?

One short decision record per tool is enough. It is also the evidence an enterprise buyer's security team may ask for, in a questionnaire section on AI use by your engineers.

FieldWhat to write down
Tool, plan and ownerWhat to write down: The plan name, whether it is business or personal, and a named administrator
Training and retentionWhat to write down: The vendor's statement for your plan, with the source URL and the date you checked
Processing routeWhat to write down: Vendor API, cloud-provider hosted or self-hosted, and any vendor backend in between
Exclusions and telemetryWhat to write down: What is configured, and the vendor's stated limits
Connected toolsWhat to write down: The approved MCP servers and plugins
Review dateWhat to write down: When the terms were last checked, and the next check

Telemetry needs a line of its own. Claude Code documents environment variables that turn off telemetry (`DISABLE_TELEMETRY`), error reporting (`DISABLE_ERROR_REPORTING`), the `/feedback` command (`DISABLE_FEEDBACK_COMMAND`) and all non-essential traffic (`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`). Anthropic says its metrics never include your code, prompts or file paths, but `/feedback` sends a copy of the conversation, including code, and those transcripts are retained for 5 years.

A checklist for the next 30 days

  • List every AI coding tool in use and the plan each person is on, and move personal-plan users to a company plan.
  • Record training and retention for each tool, with source and date.
  • Remove secrets from working directories, block production access from laptops, and use synthetic fixtures with a pre-commit scan.
  • Configure file exclusions and test them with a decoy file: put a fake secret in an excluded file and ask the agent to find it by a direct read, a search and a shell command. The result shows what the control really covers.
  • Set telemetry and feedback switches centrally, and approve MCP servers by name and version.
  • Add the tools to your vendor list and DPDP processor register, with a review date.

Sources: Anthropic, Claude Code documentation, Data usage, Permissions and Settings (code.claude.com/docs). Cursor, Data Use and Privacy Overview (cursor.com/data-use, last updated 3 September 2026) and Ignore files (cursor.com/docs/context/ignore-files). GitHub, Updates to GitHub Copilot interaction data usage policy (25 March 2026) and Content exclusion for GitHub Copilot (docs.github.com). GitHub Copilot Trust Center (copilot.github.trust.page). Model Context Protocol specification, Authorization and Tools (modelcontextprotocol.io). CVE records CVE-2025-6514 and CVE-2025-49596 (cveawg.mitre.org). Microsoft Presidio, supported entities (presidio.dataprivacystack.org). Income Tax Department, FAQs on PAN. UIDAI, Masked Aadhaar. NPCI, UPI Consolidated Circular. Digital Personal Data Protection Act, 2023, Sections 2(k), 2(x), 8 and 16. Last reviewed 20 November 2026.

FAQ

Do AI coding assistants train on your code?

It depends on the plan. As of 20 November 2026, Anthropic says it does not train on code or prompts sent to Claude Code under commercial terms unless the customer opts in, Cursor says its Privacy Mode keeps customer data out of training, and GitHub says Copilot Business and Enterprise users are not affected by its April 2026 policy change. Personal plans can differ. Check the vendor's page for the plan each developer actually uses.

How long do AI coding tools keep your prompts and code?

It varies by vendor and plan. Anthropic's documentation says Claude Code commercial plans have standard retention of 30 days, with zero data retention available to qualified Enterprise accounts. Its consumer plans keep data for 5 years if training is allowed and 30 days if not. For Copilot, read GitHub's Copilot Trust Center for current retention. Record the figure, the source and the date you checked.

Is it safe to use Cursor, Claude Code or Copilot on a company codebase?

It can be, on a business plan, with settings you have checked and with secrets and production data kept out of the working environment. The tool's own safeguards are not enough, because the vendors say that ignore and exclusion rules are not guarantees. Add controls in your environment, such as a secret manager, synthetic test data, a sandbox and approved MCP servers.

Does the DPDP Act apply when developers paste customer data into an AI tool?

Yes, it can. Pasting personal data into a prompt is processing by your company as a Data Fiduciary, and the vendor is usually a Data Processor. From 13 May 2027 you need a valid contract with the processor under Section 8(2), and you stay responsible under Section 8(1). The simplest fix is to keep personal data out of the tool by using synthetic or masked data. Counsel decides how the Act applies to your facts.

Do ignore files like .cursorignore stop an AI agent reading secrets?

Not reliably. Cursor says .cursorignore blocks ignored files from Agent and Tab, but the terminal and MCP tools used by Agent cannot block access to that code, and complete protection is not guaranteed. Claude Code and GitHub Copilot give similar warnings for their own controls. Keep secrets out of the working directory and run agents in a sandbox, and use ignore files as a second layer.

How can I find which AI coding tools my developers use?

Combine four sources: a short no-blame survey, a comparison of paid seats with installed extensions and command-line tools, proxy or DNS logs showing AI vendor domains, and the assistant settings files committed to repositories. For each tool you find, record the plan, the administrator and the vendor's training and retention terms.

Find out what your developers' AI tools can see.