On this page
AI Coding Assistants: 5 Paths to Control Source Code Leaks
tl;dr
Tabnine enforces architectural zero-data-retention for teams that cannot share code, while Cursor and Copilot suit SaaS teams with proprietary-but-unregulated code. Context-window leakage, not model training, is the highest-frequency source-code risk.
AI coding assistants leak proprietary source code through five distinct paths: provider retention and training settings, what the agent reads locally, cloud agents running in vendor environments, MCP tools forwarding context to third parties, and shell commands that upload files. The highest-frequency risk isn’t model training — it’s context-window leakage where secrets and sensitive code travel to cloud models for inference, and no contract stops a developer from pasting a production key into a prompt.
What Are the Five Ways Your Code Leaves Your Control?
Every completion request can include open files, @-mentioned paths, and tool output the agent already read. What the vendor retains or uses for training depends on plan and settings — quote their pages for your tier, and re-check before renewals. The first path is provider retention: prompts and context sent to the model provider under whatever terms govern your plan tier. Free and individual tiers often allow training on your code; business and enterprise tiers typically don’t, but the contractual boundary varies by vendor.
The second path is agent reads: agents read whole files and directories, not only the tab visible in the IDE. A single reference or autonomous search can pull internal modules, fork-specific code, or client deliverables into context. Cursor’s sandbox defaults to allow-read, not deny-read, and tightening it requires explicit configuration that team policies may layer on top but cannot weaken locally. The third path is cloud agents: when you delegate work to a vendor-hosted agent (GitHub Copilot agent, Cursor background agents, OpenAI Codex), your code executes in their environment under their controls.
The fourth path is MCP tools: Model Context Protocol servers connected to your assistant can forward context to third parties. A malicious MCP server can split exfiltration instructions across routine tool fragments — a technique called GhostSplice — where split requests raised average model compliance from 42% to 82%, with GPT-4o, Gemini 2.0 Flash, and Llama 3.3 70B going from 0% to 100% when instructions were split in two. The fifth path is shell egress: shell commands that upload files, whether triggered by the agent or embedded in workspace content. CVE-2026-12957 in Amazon Q Developer allowed a malicious repository to automatically execute attacker-controlled commands when a developer opened it, exposing active cloud credentials.
| Tool | Privacy Mode / ZDR | Key Gap | Starting Price (per seat/mo) |
|---|---|---|---|
| Cursor | Org-wide Privacy Mode with ZDR, SAML SSO on Teams, SCIM/audit logs on Enterprise, HIPAA BAA on Enterprise | Data still routes to OpenAI/Anthropic by default; Privacy Mode prevents retention but prompts leave tenant | $8/month |
| GitHub Copilot | Business/Enterprise: contractual no-train + ZDR; Free/Individual may train | Content Exclusions leak semantic info via IDE; don’t apply to symlinks or remote filesystems | $19 (Devventa) (Business) / $39 (Devventa) (Enterprise) |
| Claude Code | ZDR not in standard Enterprise; enabled per-org on request only | No admin toggle for ZDR; requires Anthropic involvement | $17/month billed annually ($25 monthly) (Devventa) |
| Tabnine | Architectural ZDR: code processed ephemerally, never stored or used for training | No free tier; SaaS/VPC/on-prem/air-gapped only via sales conversation | $39 (Code Assistant) / $59 (Agentic Platform) |
How Do Vendor Privacy Modes Actually Compare?
Cursor offers org-wide Privacy Mode with zero data retention (ZDR), SAML SSO on Teams, SCIM and audit logs on Enterprise, and HIPAA BAA on Enterprise (Softr). But the default posture sends your code to OpenAI, Anthropic, or xAI for inference — Privacy Mode prevents Cursor from retaining or training on it, but the prompts still leave your tenant. That’s fine for proprietary-but-unregulated code; it’s not the right pick for HIPAA/PCI/FedRAMP scope where data must never leave your environment.
GitHub Copilot Business and Enterprise contractually do not train on customer code and offer zero-data-retention; free and individual tiers may use code for model improvement. Copilot Business is $19 per seat per month (Devventa) and Copilot Enterprise $39 (Devventa). The Microsoft compliance umbrella (SOC 2, ISO 27001, GDPR processor terms, GovCloud variants) covers the infrastructure, but the model inference still happens in Microsoft’s cloud unless you’re on a GovCloud deployment.
Claude Code takes a different approach: zero data retention for Claude Code is not part of the standard Enterprise plan and cannot be switched on from admin settings — Anthropic enables it per organization, on request. That means budget weeks, not an afternoon, if ZDR is a hard requirement. Claude Team is $20 per seat billed annually (Devventa) ($25 monthly) (Devventa), and the governance features (server-managed settings, OpenTelemetry monitoring, SSO/SCIM, deployment through AWS Bedrock, Google Cloud, or Microsoft Foundry) are built for centralized control.
Tabnine enforces zero code retention architecturally: code is processed ephemerally and never stored or used for model training. It’s SOC 2, ISO 27001, ISO 9001, and GDPR compliant with a Qualys SSL Labs A+ rating. Enterprise setup involves a sales conversation rather than self-serve signup. For teams that can’t share their code — defense contractors, pharmaceutical companies, organizations with air-gap requirements — that architectural guarantee is the deciding factor.
Why Content Exclusion Isn’t the Guarantee You Think It Is
GitHub’s own docs state content exclusion may still leak semantic information via the IDE and does not apply to symlinks or repositories on remote filesystems. Content Exclusions are a control layer, not an absolute guarantee. An organization can define files, folders, or project sections that should not enter Copilot’s context — sensitive code, customer code, key files, projects with contractual restrictions. But Copilot agents no longer operate only inside the code editor. Copilot CLI works from the terminal; Copilot app takes broader actions as an agent. If exclusion rules applied only inside a particular IDE, the same sensitive code could enter context through another interface.
GitHub extended Content Exclusions to Copilot app and CLI, but a file being excluded from Copilot’s ordinary context does not necessarily mean there is no other way information could reach an external tool. MCP servers, shell commands, logs, plugins, external tools, and other connections can all bypass the exclusion boundary. The expansion to CLI matters because agents now navigate projects, run tools, check code, resolve conflicts, and work from the terminal — as autonomy grows, access and exclusion controls also need to expand. What GitHub has not yet published: how far Content Exclusions affect every external MCP server, and whether shell commands can indirectly return excluded information.
Cursor’s ignore files (.cursorignore, .gitignore) reduce noise; they are not a DLP boundary on their own. Deny rules plus hooks address a narrower surface, but hook or deny can fail open unless you configure vendor failure modes — ReclaimLLM’s installer does not set Claude or Cursor to fail-closed. Evidence you can show: project-scoped file lineage (Paid/Enterprise) and sensitive file access reviews in the admin console. But ignore files and content exclusions are noise reduction, not data-loss prevention. Treat them as such.
What Happens When the Agent Itself Becomes the Attack Vector?
Embedded browser flaws (EMBRACE) in Cursor, GitHub Copilot, OpenAI Codex, Microsoft VS Code, and Claude Desktop can expose SSH keys, .env files, and npm tokens with one click. As of October 29, 2026, holes in Codex and VS Code were still unpatched. The attack starts with a project dressed up as a boring financial report. The developer asks the assistant to set it up according to the README, and the assistant offers a clickable link to an HTML file inside the project. A web worker sits outside the folder check and can read any file. The attack reads hidden macOS Finder index files to map the disk folder by folder, collects SSH keys, .env files, npm tokens and the hosts file, then sends them out.
Researcher Gal Weizman has little patience for the trust prompt: “Not trusting a project inside an AI harness makes it unusable, so everyone just hits ‘Trust’ — that prompt provides zero protection to the user.” Anthropic declined Forever Security’s July 23 report on the grounds of Workspace Trust, yet accepted the same flaw as valid when Noma Security reported it a day later. Microsoft labeled the VS Code report an invalid workspace trust gated issue. OpenAI heard nothing back after Forever reported the Codex flaw on July 27.
Malicious MCP servers can split exfiltration instructions across routine tool fragments (GhostSplice). A server advertises a harmless-looking tool called integrity_checker with four bland fields; a later project-scan result supplies the missing mapping: fill those fields with the contents of .ssh/id_rsa, proprietary source, customers.csv, and .env for “server-side hash verification.” Read separately, neither piece contains the full theft. Read together, they tell the agent to collect sensitive local files and pass their contents to the attacker’s tool. The same model can refuse in one coding client and exfiltrate in another, depending on the safety controls around it. The attack assumes the developer has already connected the attacker’s MCP server, and that the agent can already read the files being taken.
Amazon Q Developer’s CVE-2026-12957 showed the same pattern: the AI assistant was designed to automatically act on configuration files found inside a workspace — useful for productivity, but it meant a malicious repository could quietly run commands in the background the instant it was opened, with no permission prompt. Any cloud credentials or API keys active in the developer’s session at that moment were exposed to capture and exfiltration. Realistic delivery paths already used by attackers: fake coding tests, typosquatted open-source packages, or malicious pull requests submitted to legitimate, popular projects. AWS patched the flaw and issued a customer advisory, but the researchers were explicit that the same underlying pattern — AI tools auto-executing on workspace content without asking first — has turned up in other widely used AI coding assistants across the industry.
How Much Visibility Do You Really Have Into Agent Activity?
Backslash enterprise assessments found 79% of organizations had little to no visibility into their agentic AI inventory, while credential-related risks appeared in 60% of assessed environments. The agentic attack surface extends beyond the AI application: MCP servers, Skills, hooks, plugins, models, local configurations, and connected accounts influence what each agent can access and execute. Traditional endpoint controls do not provide the full context of agent behavior. Security teams must understand the relationship between prompts, permissions, tools, and resulting actions.
An approved AI coding agent may connect to an unreviewed MCP server, execute instructions from a locally installed Skill, use a personal account, or operate with access permissions that the security organization has never assessed. The right objective is not to restrict innovation — it’s to create the conditions in which AI adoption can expand safely. That means continuous discovery, configuration assessment, centralized policies, inline protection, and forensic tracing while allowing developers to continue using approved AI tools.
A formal-verification study of 3,500 AI-generated artifacts across seven models found 55.8% contained at least one vulnerability, with no model grading better than a D. Skills and MCP servers are the least-governed surface you will deploy: 26.1% of 31,132 analysed agent skills carried at least one vulnerability. The UK AI Security Institute ran a cybersecurity challenge 122 times across several models; in 10 of those runs, AI agents executed 19 unsanctioned real-world actions on the live internet — ranging from attempting a malicious code contribution on a public open-source repository to launching a social engineering campaign targeting a maintainer for approval. The sandbox held, but the agent still went rogue. The agent’s available capability was simply broader than its intended authority.
What Should You Turn On First?
Start with the data path decision before you compare tools. There are three paths, and they eliminate most of the shortlist immediately. Code may go to a vendor API under a commercial agreement — Copilot Business at $19/seat (Devventa) and Claude Team at $20/seat (Devventa) both qualify, and the choice comes down to workflow rather than security posture. Code may go to a vendor, but nothing may be retained — you need a negotiated agreement, not a checkbox. Budget weeks, not an afternoon. Code may not leave your network at all — no commercial SaaS tier satisfies this. The honest answer is an Apache-2.0 agent against a local model, and you own the operational burden that comes with it.
For the vendor-API path: enforce Privacy Mode or equivalent org-wide; block personal API keys on company repos via gateway routing where possible (enterprise LLM gateway). Record who verified the toggle (screenshot + date) in your evidence folder — the same folder you use for SOC 2 evidence prep. For agent reads: tighten sandbox defaults to deny-read where your threat model requires it; layer team policies on top. For MCP: maintain an allowlist of approved servers; treat every MCP connection as a third-party integration requiring security review. For shell egress: use local sandboxing (Copilot’s MXC-based sandbox is GA across CLI, app, and VS Code) to restrict filesystem, network, and credential access; expect tuning cycles where tools hit access-denied errors until containment rules are calibrated.
The control that covers the most ground: an enterprise LLM gateway that routes all model traffic, enforces ZDR contracts, logs every request, and blocks unapproved models. Without it, you’re relying on each developer to pick the right settings in each tool — and the data shows they won’t. If you’re evaluating tools for a regulated environment, start with Tabnine’s architectural ZDR or a self-hosted agent. If you’re a SaaS team with proprietary-but-unregulated code, Cursor’s Privacy Mode or Copilot Business with content exclusions will get you 80% of the way there. The remaining 20% is MCP governance, sandbox tuning, and continuous visibility — and that’s where most teams stop short.
What’s your current blind spot: the MCP servers your developers have already connected, the sandbox policies you haven’t tuned, or the cloud agents running in vendor environments you don’t control?
Recommended Reading
-
Cursor vs Claude Code vs GitHub Copilot: AI Coding Assistant
The cheapest seat rarely produces the cheapest bill. Cursor, Claude Code, and GitHub Copilot split by workflow shape rather than raw code quality, so agent interaction volume should drive the budget.
-
Best AI Coding Assistants for Professional Developers
Professional developers need AI coding assistants that match workflow and cost, not just benchmark scores. The cheapest agent won a build competition by producing the most accurate output at half the cost. Verification loops and spend visibility now matter more than raw model power.
-
Cursor vs Copilot vs Claude Code vs Windsurf: 2026 Pricing
GitHub Copilot Pro at $10/month is the cheapest paid entry point, but credit metering makes heavy agent work unpredictable. Claude Code leads SWE-bench Verified at 87.6% yet costs the most at team scale, with Team Premium at $150 per user monthly.