The AI toolchain is a supply chain like any other, with two differences. First, its components run with the developer’s full privileges and are designed to act on text: an agent that reads a file will do what the file says. Second, its credentials are unusually valuable, because a stolen model API key is simultaneously loot, free compute and a way to hide the attacker’s own AI use behind someone else’s account. The incidents below show attackers working out both facts within a few months of each other.
Package worms that weaponise installed coding agents
Amazon Q extension, July 2025: the warning shot
A pull request to the open-source Amazon Q Developer extension for VS Code, from an account with no history, was merged and shipped in version 1.84.0. It downloaded a prompt and fed it to the Amazon Q command-line agent with all tool approvals disabled, instructing it to “clean a system to a near-factory state” by deleting files and cloud resources. The payload appears not to have worked. Amazon said no customer resources were affected and shipped 1.85.0 within days. The extension had roughly 950,000 installs. It was the first public case of an attacker using an AI agent as the execution engine for destructive intent. [1][2]
nx and “s1ngularity”, August 2025: the pattern is set
On 26 August 2025 malicious versions of nx, a build tool with about 4.6 million weekly downloads, were published with an npm token stolen through a misconfigured GitHub Actions workflow. The post-install script harvested environment variables, SSH keys, npm and GitHub tokens and cryptocurrency wallets. Then it did something no package malware had done before: it looked for Claude Code, Gemini CLI and Amazon Q on the machine, launched whichever it found with the flags that skip permission prompts, and gave it a prompt asking it to enumerate files likely to contain secrets. The results were pushed to public repositories in the victim’s own GitHub account. Two days later the stolen GitHub tokens were used to flip victims’ private repositories to public. GitGuardian counted 2,349 leaked secrets in the first phase and 10,767 repositories exposing a further 82,901 secrets in the second; Wiz put the exposed repositories at around 5,500 and noted that where an AI CLI was present the AI-driven search succeeded in fewer than a quarter of cases. The agents were, for once, not very good at the job. They would get better. [3][4][5][6]
Shai-Hulud, September and November 2025
The first Shai-Hulud wave began on 15 September 2025 with a popular colour library and spread by using each victim’s stolen npm token to republish trojanised versions of up to twenty of their own packages. CISA counted more than 500 affected packages. The second wave, from 21 November, was larger and nastier: it installed the Bun runtime to evade monitoring aimed at Node, harvested cloud credentials from AWS, GCP and Azure including instance metadata and secret stores, registered a self-hosted GitHub Actions runner as a command channel, republished up to a hundred of each victim’s packages, and wiped the home directory if it found no token to steal. Datadog counted 796 packages and 1,092 versions with more than 20 million combined weekly downloads, data from more than 500 GitHub users and 150 organisations, and over 14,000 exfiltration repositories. [7][8][9][10]
2026: the worm goes open source and the agents become the target
In February 2026 Socket found SANDWORM_MODE, a set of typosquatted packages (including misspellings of Claude Code) that wrote a fake MCP server to disk and registered it in the configuration files of Claude Code, Claude Desktop, Cursor, Continue and Windsurf. Its tool descriptions contained instructions telling the assistant to read SSH keys, cloud credentials and environment files. The agent was not exploited; it was given a new tool and trusted it. [11][12] In March the group tracked as TeamPCP used un-rotated credentials to poison 76 of 77 tags of the trivy-action security scanner (CVE-2026-33634), stole the publishing credentials for Checkmarx and LiteLLM through it, and shipped malicious LiteLLM releases carrying a credential stealer that specifically collected AI-provider API keys; CloudSEK estimated more than 2,500 organisations and about 434,000 CI runs exposed. [13][14][15] In April a compromised GitHub Action put a stealer into Bitwarden’s CLI release for about ninety minutes; Bitwarden said vault data was unaffected. [16][17] In May TeamPCP published the worm’s source code, and copycats followed within days; a June PyPI campaign called Hades stole Claude and MCP configurations alongside cloud tokens. [18][19][20] In July GitHub shipped npm 12 with dependency install scripts disabled by default, the first registry-level change aimed squarely at this family. [21] The ChainDrop worm of August 2026 still reached between 444 and 868 packages through a compromised maintainer account. [22][23]
October to November 2026: the agent’s own files as the weapon
The MALFEX campaign, found on a customer machine by Forever Security and analysed by CloudSEK and Checkmarx, dropped an AGENTS.md file into the Downloads folder from a web page. If a developer later launched a coding agent in that folder, the file, styled as ordinary engineering notes, told the agent to add a server to its own configuration and install a malicious package. OpenAI’s Codex followed the instructions in more than 90% of tests; a CLAUDE.md variant that pointed Claude Code at an attacker-controlled API endpoint succeeded less often. No vendor shipped a patch, because the agents were behaving as designed. [24][25] In November Google’s threat intelligence group reported a North Korea-linked actor, MIDNIGHT NEPTUNE, using modified Claude Code settings files that download a backdoor every time the agent starts: the agent’s hook system as a persistence mechanism. [26]
MCP servers: the first backdoor and the ecosystem’s numbers
The Model Context Protocol gives agents tools, and tools run code. In September 2025 Koi Security found the first malicious MCP server in the wild: an npm package impersonating Postmark’s email server shipped fifteen clean versions and then, in version 1.0.16, added one line that blind-copied every email the agent sent to an attacker’s address. It had about 1,500 weekly downloads. Postmark confirmed the package was not theirs. [27][28]
Two critical flaws in the plumbing came earlier. CVE-2025-6514 in mcp-remote (CVSS 9.6) let a malicious or intercepted MCP server return a crafted OAuth endpoint that was executed as a command when the client opened the browser; about 437,000 downloads were exposed before the fix. CVE-2025-49596 in Anthropic’s own MCP Inspector (CVSS 9.4) had no authentication between its web interface and its proxy, so visiting a web page could execute code on the developer’s machine; it was fixed in version 0.14.1. [29][30][31]
| Measurement | Figure | Source and date |
|---|---|---|
| Public MCP servers | More than 10,000 active (Anthropic, Dec 2025); third-party registry snapshots grew from about 9,650 in May 2026 to about 52,000 in October 2026. Listings are not vetted. | Anthropic; registry censuses [32][33] |
| Popular MCP implementations with command injection, SSRF or path traversal | 43%, 30% and 22% respectively (sample size not disclosed) | Equixly, Mar 2025 [34] |
| Most-starred MCP servers with at least one risk finding | 29% of about 8,000; six allowed unintended remote code execution | Backslash Security, 2025 [35] |
| Internet-exposed MCP servers | 1,862 found; all 119 manually verified exposed tool listings without authentication | Knostic, 2025 [36] |
| Secrets in public MCP configuration files | 24,008, of which 2,117 still valid | GitGuardian, Mar 2026 [37] |
Code execution through the agents themselves
The agents’ vendors spent 2025 and 2026 patching a steady run of flaws with the same shape: content the agent reads, or a file in the repository it opens, causes it to run commands or change its own permissions without the user approving. The configuration file is the recurring target, because an agent that can write its own settings can grant itself anything.
| Product | Flaw | Mechanism | Fixed |
|---|---|---|---|
| Cursor | CurXecute, CVE-2025-54135 (CVSS 8.6); MCPoison, CVE-2025-54136 | A Slack message read via MCP made the agent write the MCP config, which ran before approval; an approved config could be silently edited and re-run | Cursor 1.3, Jul 2025 [38][39] |
| Cursor | CVE-2026-22708, CVE-2026-26268, DuneSlide CVE-2026-50548/50549 (CVSS 9.8) | Allow-list bypass via shell built-ins; git hooks written outside the sandbox; working-directory and symlink sandbox escapes | Cursor 2.3, 2.5 and 3.0, Jan to Jul 2026 [40][41] |
| GitHub Copilot | CVE-2025-53773 (CVSS 7.8) | Injected content made the agent set its own auto-approve flag in the workspace settings, then run commands; wormable through committed settings | Aug 2025 Patch Tuesday [42] |
| Gemini CLI | Tracebit finding | A GEMINI.md file plus an allow-list parsing bug: once grep was approved, a chained command exfiltrated environment variables while the UI showed only grep | v0.1.14, Jul 2025 [43][44] |
| Gemini CLI | CVE-2026-12537 (CVSS 10.0) | Headless mode auto-trusted workspaces and the yolo flag ignored allow-lists, so a public GitHub issue could execute code in CI with write credentials | 0.39.1 and run-gemini-cli 0.1.22, Apr 2026 [45][46] |
| Claude Code | CVE-2025-59536 (CVSS 8.7); CVE-2026-25725 | Project code ran before the trust dialog was accepted; the sandbox did not protect a missing settings file, so sandboxed code could plant hooks that run on the host | 1.0.111, Oct 2025; 2.1.2, Feb 2026 [47][48][49] |
Two of these matter beyond their CVSS scores. The Gemini CLI flaw of April 2026 and the Cline compromise of February 2026 (covered in the prompt-injection report) both show that an agent running in CI with write credentials turns every public issue tracker into an attack surface. And the Copilot and Claude Code findings show the agents’ permission systems being defeated by the agent writing its own permission file, which is a category of flaw that will recur as long as settings live where the agent can reach them.
The other direction: intrusions run by AI
The vendors who run the models have the best view of attackers using them, and their reports between August 2025 and November 2026 trace a steep curve.
- August 2025, Anthropic. A single operator used Claude Code for nearly every stage of a data-extortion campaign against at least seventeen organisations in healthcare, emergency services, government and defence: reconnaissance, credential harvesting, network penetration, choosing what to steal, pricing ransoms from stolen financial data (demands above US$500,000) and writing the ransom notes. Anthropic called it “vibe hacking”. [50]
- November 2025, Google. PROMPTSTEAL, used by the Russian group APT28 against Ukraine, was the first malware observed querying a model (an open-weight Qwen coder via Hugging Face) at runtime to generate the commands it ran. QUIETVAULT, a JavaScript stealer, used locally installed AI CLIs to hunt for additional secrets, the nx pattern adopted by a conventional malware family. [51]
- November 2025, Anthropic, GTG-1002. A Chinese state-sponsored group built an orchestration framework around Claude Code and MCP-connected scanners and password crackers, and ran a campaign against about thirty targets with the AI performing an estimated 80 to 90% of tactical work and humans intervening at four to six decision points. The operators jailbroke the model by splitting the work into innocuous tasks and posing as a penetration-testing firm. Anthropic described it as the first reported AI-orchestrated espionage campaign; independent researchers disputed the autonomy estimate, and the model’s habit of inventing credentials limited its success. [52][53][54]
- 2025 to 2026, OpenAI. Four reports disrupted more than forty networks in total, from Russian-speaking developers refining credential stealers to Chinese accounts building surveillance tooling, and concluded that the models gave actors incremental efficiency rather than new capability. [55][56]
- May to October 2026, Google. The first AI-developed zero-day Google had identified (a two-factor bypass in an open-source administration tool); an Android backdoor driving the device’s interface through a small Gemini model; a Claude Code skill packaged with 85,000 historical vulnerability write-ups; and ARTEX, an open-source offensive framework of six sub-agents used by extortion groups and a China-nexus actor to go from first account to deep access in about four hours. [57][58]
- September 2026, Anthropic. A Russian state-nexus group used Claude Code skills across development, phishing and exfiltration, with agents rewriting their malware when it was flagged, and took 300,000 national identity records from a government authority. A ShinyHunters affiliate ran a pipeline that decompiled 1.8 million Android apps looking for secrets and reused stolen AI API keys for three weeks. Another group attacked about thirty AI companies in four days by injecting instructions into a vendor’s evaluation sandbox to steal production keys. Anthropic’s framing of stolen keys: “loot, compute and cover”. [59][60]
- November 2026, Google. The first observed fully automated vulnerability discovery and exploitation with no human in the loop; zero-days averaging eleven a month in 2026 against eight in 2025; and LLMjacking losses above US$100,000 a day, in the worst cases through a LiteLLM gateway flaw (CVE-2026-40217) that turned a virtual key into administrator access. Google’s assessment was that fully autonomous attacks were three to six months away. [26][61]
What the standards bodies and governments have said
OWASP published its Top 10 for Agentic Applications on 9 December 2025 with more than a hundred contributors. Four of its ten entries describe the incidents above directly: ASI02 Tool Misuse, ASI04 Agentic Supply Chain Vulnerabilities, ASI05 Unexpected Code Execution and ASI06 Memory and Context Poisoning. [62][63] On 30 April 2026 CISA, the NSA, and the cyber-security agencies of the UK, Australia, Canada and New Zealand jointly published “Careful Adoption of Agentic AI Services”, which recommends least privilege for agents, starting with low-risk use cases, and folding agents into existing governance rather than treating them as a new category. [64][65]
The controls that map to each failure
| Failure | Control | Where it lives |
|---|---|---|
| A worm runs the installed agent with permissions disabled | Agents call models only through a gateway that holds the keys; a local process with no provider key cannot exfiltrate through the model, and the gateway logs the attempt | Gateway (architecture) |
| Model API keys on developer machines are stolen and resold | Keys vaulted centrally; developers hold short-lived tokens scoped to a model and a budget; secrets scanning on every repository and MCP config | Gateway (platform) and CI |
| A malicious MCP server or tool description instructs the agent | Allow-list MCP servers by hash and publisher; inspect tool descriptions and tool arguments at the gateway as untrusted input | Gateway (firewall) and policy |
| Agent configuration files are written by the agent or by a package | Keep agent settings under version control with review; deny agents write access to their own settings and hook directories; alert on changes | Endpoint and repository policy |
| Agents in CI act on public issues and comments | No write credentials for agents triggered by untrusted events; OIDC trusted publishing; separate the triage agent from the release pipeline | CI configuration |
| Install scripts run on npm install | npm 12 or later with install scripts disabled; lockfile pinning; a delay before adopting new versions | Developer tooling |