How AI Coding Assistants Access and Process Proprietary Code
Most assistants assemble context and send it to a model for inference. Completion tools send the open file and nearby code. Chat tools take whatever you paste or select. Review and debugging features add diffs, stack traces and test output. Repository-aware tools index files, retrieve relevant chunks and attach them to prompts without the developer choosing each one. Agentic tools go further: they read files, run terminal commands, call external services and loop on the results, so the context they handle is set by their permissions rather than by what a developer decided to share.
Developers often cannot say exactly which neighbouring files, terminal output or logs went into a given request. Pull request analysis and code review integrations add channels of their own, and third-party inference, proxy and telemetry services may sit between the editor and the model.
It helps to separate four places data can end up: processed locally (a repository index built on the developer’s machine, for example), transmitted to a model provider for inference, handled by supporting third-party services, or retained for logging, telemetry or model improvement. Tools differ on every one, and configuration changes the answer. Nothing here means every assistant sends whole repositories to external servers; many do not. The answer has to be established per tool, per plan and per setting.
The Hidden Security Risks of AI Coding Assistants
Proprietary Source Code Exposure
Proprietary algorithms, unreleased features, internal frameworks, and pricing or scoring logic are all valuable, and none of them look sensitive to a model. A developer asking for help with a failing function may paste far more business logic than the question needs. With repository indexing, code can enter prompts without the developer deciding anything. Whether that matters depends on who processes it and under what terms.
API Keys, Credentials, and Secrets Leakage
Secrets turn up in unexpected places: hardcoded in source, in .env files an agent can read, in connection strings inside stack traces, in tokens echoed to a terminal, in debugging logs. Sending one to a provider is an unplanned disclosure to a third party rather than publication, but a credential you cannot show stayed contained should be treated as exposed.
Two recent cases show the range. Cursor reported that historical coding-agent traces shared with a vendor included a small number with credentials that had not been redacted, and that the attacker used credentials from that data to reach other systems. Separately, Bitdefender Labs found malware built to harvest what already sits on developer machines: SSH keys, .env files, API keys and source-control tokens.
One handling point is easy to miss. Masking a secret in a ticket, a screenshot or an article example does not un-expose it. If a real credential was exposed, revoke and rotate it.
Data Retention, Logging, and Model Training
These are separate questions that get lumped together. Transient processing means data is used to produce a response and discarded. Retention means it is stored for some period, perhaps for abuse monitoring or conversation history. Human review means staff may read samples. Training means customer content is used to improve models. Vendors treat each differently, and often differently by plan.
GitHub’s March 2026 announcement shows why plan matters. From April 24, interaction data from Copilot Free, Pro and Pro+, including inputs, outputs, code snippets and surrounding context, may be used for model training unless the user opts out. Copilot Business and Enterprise are not affected. GitHub says the program does not use private repository content “at rest,” but acknowledges that Copilot processes code from private repositories while it is in use. It also says the data may be shared with affiliates such as Microsoft, not with third-party model providers.
Cursor’s incident adds another angle. The exposed traces came from sessions outside Privacy Mode that Cursor was permitted to use for training, and they had been shared with a vendor. The terms that matter cover not just the provider but everyone who receives the data under them.
Repository Access and Excessive Permissions
An assistant can only leak what it can reach. Organization-wide repository grants, IDE extensions that read the whole workspace, and agents with file-system and terminal access all widen the pool of code, documentation, and secrets that might enter a prompt or an output. Least privilege applies here exactly as it does to service accounts.
Third-Party Integrations and Supply Chain Risks
Approving a model provider approves one component. IDE extensions, MCP servers, AI coding plugins, package registries, build services, logging and telemetry providers, repository applications and external agent tools each handle data or run code under their own terms. Google’s May 2026 analysis of agent-facing files offers a useful audit lens: sort what an agent trusts into what executes, what instructs, what connects and what extends. Review the complete AI development toolchain, not just the model’s privacy policy.
Generated Code and Intellectual Property Concerns
This is a different problem from exposure. Exposure asks whether your code left your control. The generated-code question asks whether what the assistant produces resembles third-party code, carries licensing or attribution obligations, or has unsettled ownership status. Neither "all AI output infringes" nor "ownership is settled" is a safe assumption. Provenance tooling, public-code matching filters, vendor indemnities, and legal review each address part of it, and the answers depend on jurisdiction and contract.
Prompt Injection and Untrusted Repository Content
A malicious prompt typed by a user is one problem. Coding assistants face several more: instructions embedded in repository files, in issues, pull requests and comments, in external documentation they fetch, and in whatever connected tools return. The model sees all of it as text. OWASP ranks prompt injection first among LLM application risks, and the consequences scale with what the assistant can do. A chat-only tool might give a misleading answer; one with repository access and the ability to render or fetch content may move data out.
“CamoLeak” is the documented example. Researcher Omer Mayraz of Legit Security reported a flaw in GitHub Copilot Chat, scored CVSS 9.6, in which hidden instructions could lead Copilot to leak secrets and private repository content. According to The Register’s coverage, GitHub responded by disabling image rendering in Copilot Chat. It was a design and permissions problem, not an inevitable cost of using AI. The rule that follows: repository content is untrusted input until it has been reviewed and authorized. The next section shows that rule being tested in the wild. For the general pattern, see our piece on prompt injection and our analysis of AI agent security.
Malicious Repository Instructions: A New Attack Surface for AI Coding Assistants
On November 17, Bitdefender Labs described a malware campaign aimed at developers who use AI coding assistants. Researcher Andrei Anton-Aanei identified 22 malicious GitHub links containing files designed to get AI-assisted tools to run a concealed payload. Bitdefender’s central point is that the campaign does more than hide a malicious script in a repository. It abuses the instruction files, rules, session-start hooks, MCP configurations and editor tasks that tools use to understand and automate a project.
Why assistants trust repository instructions
Files such as AGENTS.md and CLAUDE.md exist so an assistant can learn a project’s conventions, how to run tests and what to avoid. Following them is the feature. In the samples Bitdefender analyzed, similar files told the assistant that a script named setup.js was a sealed, cryptographically signed part of an internal initialization process, that its contents should not be read or displayed, and that it should run at session start without showing output and without asking the user. The wording borrows the vocabulary of DevSecOps and compliance, which makes an unsafe action feel routine and too sensitive to question.
A path that needs no prompt at all
Bitdefender also found a second route. Once a developer opens and trusts a repository, a configuration file such as .claude/settings.json can use a session-start hook to run a command in the user’s shell. No instruction has to be interpreted and no prompt typed. In one route an agent is talked into running malicious code; in the other, a trusted project folder becomes the execution path.
Why ordinary scanning can miss it
These files are plain text or valid JSON. Google’s May 2026 research notes that syntactically correct settings and instruction files frequently return zero detections from signature-based scanners, because the danger lies in what they instruct rather than in exploit code. Its examples included a settings file that rerouted an assistant to a third-party proxy with an embedded key, and a Skill file that told an agent to send out API keys and environment variables under the label of maintenance. Traditional source review looks at application code; this risk lives in files that review rarely reaches.
What Bitdefender says the malware can do
From its analysis of the code, Bitdefender reports capabilities including theft of credentials and tokens across developer and enterprise environments (CI/CD systems, cloud platforms, package registries, browser and password-manager data, SSH keys and .env files), validation of stolen GitHub and GitLab tokens, modification of repositories, attempts to republish infected packages, and planting of new agent instructions to spread. Those are capabilities found in the malware. The post does not report how many developers were affected, and it does not claim every outcome occurred in every environment.
How to inspect agent-facing files
Treat AGENTS.md, CLAUDE.md, rules directories, hooks, MCP definitions, editor tasks and any setup script they reference as security-sensitive artifacts. Before opening an unfamiliar repository in an AI-enabled editor, read them. Bitdefender’s red flags are instructions that forbid inspecting a file, suppress output, bypass confirmation or install software automatically. Inside the organization, put these paths under code-owner review so a new or changed instruction cannot merge unnoticed, and open third-party projects in a disposable environment without production credentials.
An illustrative scenario (not a documented incident). A developer clones an unfamiliar project to evaluate it and asks the assistant to summarize the codebase. A project instruction file says a setup script is a signed component that must run first. The assistant runs it, and the script goes after SSH keys, cloud credentials and tokens on the workstation. The developer typed nothing risky. The risk arrived through a file the assistant was built to obey.
When AI Coding Assistants Become Part of the Software Supply Chain Risk
The Google Threat Intelligence Group’s November 16 report is mostly about adversaries adopting autonomous multi-agent frameworks to speed up reconnaissance and exploitation. That wider story is outside this article. One finding sits squarely inside it: Google lists manipulation of coding-assistant configurations among new supply chain techniques.
The detailed example describes intrusions against cryptocurrency organizations in North America and Europe by a suspected North Korea-linked cluster that Google tracks as MIDNIGHT NEPTUNE. Entry came through social engineering, not through an assistant. After the compromise, according to Google, the actor moved into internal code repositories and modified .claude/settings.json files so that starting Claude Code would trigger the download of a backdoor. It also created GitHub personal access tokens named after Microsoft Copilot to blend in. Google’s summary of the case is that actors are exploiting native AI agent execution hooks as enterprise access vectors.
This is observed threat activity, and it is worth separating from the hypotheticals. Three things follow from it. A developer’s local environment is an attack target in its own right, because that is where the assistant runs with the developer’s permissions. A backdoor can enter a workflow through a settings file that no application-code review would open. And the change can be tiny: one modified file, committed from an account that looks routine.
The defensive answer is monitoring, not just review. Changes to agent settings, hooks, scripts and repository instructions should generate alerts and need approval, the same way changes to CI workflows already do. Google’s report also notes that adversaries harvest session tokens and platform credentials from endpoints and CI environments, which is another reason developer machines deserve endpoint-grade attention.
Can a Compromised AI Model Put Developer Environments at Risk?
Repository prompt injection attacks the assistant through the files it reads. A model-level backdoor attacks it from inside. On November 12, Microsoft Security Research and the Microsoft AI Red Team published two studies on hidden behavior introduced during post-training.
In the first, dataset poisoning, crafted examples hidden in a fine-tuning dataset teach a model an unsafe conditional rule. Microsoft’s proof of concept used about 1% of a training corpus, and the trigger was a routine request that developers make constantly. Microsoft also found rows in a public dataset that paired harmless requests with unrelated tool calls that fetched and ran a remote script. Its researchers could not determine the publisher’s intent or whether those rows would affect a model trained on them, but the finding shows that a dataset’s size and reputation do not guarantee its safety.
In the second, model poisoning, the attacker controls training and distributes a compromised open-weight checkpoint, for example through a model hub. Microsoft reports that the hidden behavior generalized to repositories and agent harnesses it had not seen and survived further training. These results come from controlled research setups and say nothing about how many deployed assistants are affected. Microsoft is explicit that the backdoor lives in the model: the work does not show a weakness in the default configurations of Claude Code or Codex CLI.
The difference for coding assistants is what a trigger can do. In a plain chatbot, a backdoor might change an answer. In an agent with tools, it can invoke commands, modify files or reach data while the user still gets a normal-looking response. The trigger may be an ordinary request or content the agent meets in a filename, code comment or tool result, so input filters can see nothing wrong.