
For most of the last decade, the software supply chain meant the things you installed: npm packages, PyPI wheels, container images, build plugins. Security teams built controls around those artifacts. They pinned versions, scanned lockfiles and watched registries for typosquats.
In 2026 there is a new participant in that chain, and it does not show up in a lockfile. The AI coding assistant reads your repository, runs shell commands, holds credentials, connects to plugins and decides which packages to add. It is a dependency with the permissions of a senior engineer and the skepticism of a very fast intern.
Google Threat Intelligence Group has said AI-assisted development is expanding supply-chain risk, with attackers targeting developers, coding assistants, open-source registries and even AI security scanners. Thoughtworks makes a similar point: coding agents, extensions and MCP servers now sit close to source code, shell access, credentials and external services.
This article takes a different angle from the usual “AI writes insecure code” discussion. The question here is not whether suggestions are buggy. It is what happens when the assistant itself becomes the thing an attacker wants to control, and how to treat it like the supply-chain component it has become.
Why an Assistant Counts as a Supply-Chain Component
A supply-chain component is something outside your direct control that your software or your build process trusts. By that test, a modern coding assistant qualifies several times over.
What it connects to
An agentic assistant typically connects your codebase to a model provider, a set of extensions, one or more MCP servers, package registries, and often the open internet. Each connection is a trust relationship. Each one can be changed by someone other than you through an update, a marketplace listing or a poisoned document.
What it can do
Autocomplete was passive. Agents are not. They clone repos, edit files, install packages, run tests and open pull requests. When an agent acts, it acts with the developer’s identity and tokens.
Why that changes the threat model
With a vulnerable suggestion, a human still reviews the code before it ships. With a compromised agent, the damage can occur before any review exists: a credential read, a package installed, a repository pushed to an attacker’s endpoint. The risk shifts from “bad output” to “bad action.”
Adoption makes this urgent. One 2026 industry summary reports that 67% of organizations have widespread AI coding-assistant use and 90% of security leaders are concerned. It also reports that 60% of teams say assistants increase their use of external packages, and 58% say they ship code faster than security reviews can keep up with. Treat those as survey figures, but the direction is clear.
Slopsquatting: When the Model Invents the Dependency
The most direct link between assistants and the package supply chain is hallucinated dependencies. A model confidently recommends a package that does not exist. If an attacker registers that name first, the next developer who follows the suggestion installs malware. The tactic is called slopsquatting.
What the research found
A USENIX Security 2025 study by Spracklen et al. tested 16 models across 576,000 code samples in Python and JavaScript. About 19.7% of suggested packages were nonexistent. Commercial models averaged 5.2% and open-source models 21.7%. The study counted 205,474 unique invented package names.
The crucial finding for attackers was repeatability: 43% of hallucinated names reportedly recurred in every trial of the same prompt. Predictable mistakes are exploitable mistakes.

Is it getting better?
Partly. An early 2026 preprint, not yet peer-reviewed, replicated the work on 199,845 responses from five frontier models. It found hallucination rates of 4.62% to 6.10%, and the spread between models narrowed from 16.5 points to 1.48. Python hallucinated more than JavaScript.
The same preprint reports that 127 invented names appeared across all five models, and that 53 hallucinated names (41 on PyPI and 12 on npm) still looked available to register in April 2026. Another independent panel reported that nonexistent suggestions rose from 0.17% on routine prompts to 5.83% on fast-moving, emerging-tool prompts.
Why a lower rate still matters
A 5% rate sounds small. Multiply it by the volume of generated code and the number of developers, and it becomes a steady supply of opportunities. Attackers only need a few names to stick. Note also that the risk concentrates where developers most need help: new tools with thin documentation and training data.
Hallucinations are also only one failure mode. A separate 2026 assessment found that only 20% of AI-generated dependency recommendations tested were both valid and free of known vulnerabilities. Connecting models to live registry data cut high- and critical-risk recommendations by roughly 70%. That is a useful hint about the fix: give the model facts instead of asking it to remember them.
From Package Installation to Agent Activation
Classic supply-chain attacks wait for a developer to run an install command. Newer campaigns target the moment a developer opens a project or starts an agent session.
Configuration files as code
Researchers describe recent Shai-Hulud variants that plant malicious settings for Claude Code or VS Code in a repository. When the project opens, the settings trigger execution and credential theft. Agent hooks, tool descriptions and IDE configuration are all places where text becomes behavior.
Prompt injection as the delivery mechanism
If an agent reads untrusted content, such as an issue, a README, a web page or an MCP tool description, that content can contain instructions. The agent cannot reliably separate “data to read” from “commands to follow.” Reports on the newer Shai-Hulud variants describe instructions that direct assistants to access SSH keys, cloud credentials and tokens.
Hijacked sessions
Mandiant reported a case in which attackers took over a live AI coding-assistant session and induced it to install a poisoned PyPI package. The attackers stole GitHub OAuth tokens and spread malware across roughly 100 repositories. The assistant did not need a vulnerability. It did what it was permitted to do, for the wrong party.
MCP Servers: The New Plugin Ecosystem, With Old Problems
The Model Context Protocol gives assistants a standard way to call tools. That is useful, and it also creates a plugin ecosystem that resembles early browser extensions: easy to publish, widely trusted, loosely vetted.

The postmark-mcp lesson
In one reported incident, a malicious update to an MCP-related npm package added a hidden BCC to outbound email, silently copying messages to an attacker-controlled address. Nothing exploited the protocol. The server itself was the backdoor, delivered through a normal update.
Registry-level delivery
Researchers also reported a Shai-Hulud payload delivered through the official MCP Registry, using malicious GitHub repositories to run code when projects opened. Open-source security data points the same way: OSV recorded 240 of 14,481 npm and PyPI malicious-package records in 2026 with AI-tooling names, about 1.7%, rising to at least 3% in several monthly spikes.
Where the flaw actually is
Experts quoted in the research suggest the protocol is not the core problem. The problem is that tool descriptions and configuration can steer an agent, and that servers inherit the developer’s privileges. An untrusted MCP server deserves the same scrutiny as untrusted code, because functionally that is what it is.
The Worm Problem: Shai-Hulud and Self-Propagation
The 2025 Shai-Hulud npm worm showed how credentials can become propagation. Compromised maintainer tokens let attackers publish infected versions, which stole more credentials, which published more infected versions.

The “Mini Shai-Hulud” wave in May 2026 reportedly hit both npm and PyPI. In one account, a single compromised maintainer account published 631 malicious versions across 314 packages in 22 minutes. Payloads included AI-agent session hooks, CI secret theft and GitHub-based exfiltration.
The AI angle is that a developer machine running an agent is a rich environment: many tokens, broad file access and an eager automation layer that will follow instructions. Malware that knows about agent hooks can persist inside the tool the developer trusts most.
The Confused Deputy: Excessive Permissions Inside the Company
Not every risk is an outside package. Mandiant’s testers used role-confusion prompt injection against an internal repository and CI assistant. The agent cloned sensitive repositories and pushed them to an attacker-controlled GitHub endpoint.
This is the classic confused-deputy problem. The assistant had legitimate authority, an attacker supplied the intent, and the system could not tell the difference. The fix is not a smarter prompt. It is less authority.
Questions to ask about every internal agent
- Which repositories can it read, and which can it write to?
- Can it make outbound network requests to arbitrary hosts?
- Does it hold long-lived tokens, or short-lived scoped ones?
- What untrusted text does it ingest: issues, comments, web pages, tickets?
- Who approves actions that change state?
Marketplace Extensions and Trusted Update Channels
Thoughtworks has highlighted a compromised marketplace extension that reportedly exposed thousands of users. This pattern is familiar from browsers. Users trust the marketplace, the extension auto-updates, and a single account takeover reaches everyone.
Google’s reporting on the UNC6780 campaigns adds that attackers have gone after PyPI, npm, Docker Hub, coding assistants and AI security scanners. Targeting scanners is notable: it means the tools meant to catch poisoned packages are themselves in scope, and prompt injection can be used to influence their verdicts.
Verizon’s 2026 DBIR puts third-party involvement in breaches at 48%, and the same research summary notes source code was the data most commonly sent to external generative-AI systems. Both facts point at the same exposure: your perimeter now includes vendors you installed in an afternoon.
Why Traditional Controls Miss This
Software composition analysis checks lockfiles for known bad versions. It does not see an agent hook in a settings file, a tool description that tells a model to read ~/.ssh, or a session that was hijacked after authentication.
- Lockfile scanning sees installed packages, not agent configuration.
- Code review sees the pull request, not the shell commands the agent ran beforehand.
- Secret scanning catches committed keys, not keys read from disk and sent out.
- Vendor assessments cover the model provider, not the dozens of extensions and servers around it.
The speed mismatch compounds this. If 58% of teams ship faster than security can review, adding autonomous actions widens the gap further.
A Practical Control Framework
None of these steps require abandoning assistants. They treat the assistant like any other privileged third-party component.
1. Inventory the assistant estate
List every assistant, extension, MCP server, hook and plugin in use, including those developers installed themselves. You cannot assess what you cannot see. Treat this as an SBOM-style record for the tools, not only the code.
2. Ground dependency suggestions in live data
Given the roughly 70% reduction reported when models consulted live registry data, connect assistants to registry checks. Require that any new package exist, have meaningful history, and pass policy before install. Block names registered very recently, particularly those that match known hallucination patterns.
3. Gate installs through a proxy
Route package installs through an internal registry proxy with allowlists and a cooldown period for brand-new versions. Several of the worm waves relied on malicious versions being installed within minutes of publication; a delay removes much of that advantage.
4. Cut permissions to the minimum
- Run agents in sandboxes or dev containers without access to home-directory credentials.
- Use short-lived, narrowly scoped tokens instead of personal access tokens.
- Restrict outbound network egress to approved hosts.
- Require human approval for installs, network calls and pushes.
5. Treat agent config as code
Review changes to assistant settings, hooks and MCP definitions in pull requests, and be wary of opening unfamiliar repositories with an agent enabled. Add repository rules that flag new files in agent configuration directories.
6. Vet MCP servers like dependencies
Pin versions, read the source, check the maintainer, and review tool descriptions for instructions aimed at the model. Prefer a short approved list over open-ended installation.
7. Harden the pipeline
Because payloads target CI secrets, use OIDC-based short-lived credentials, protect workflow files, and publish packages with provenance and trusted publishing so a stolen token is less useful.
8. Monitor behavior, not just artifacts
Log agent actions: commands run, files read, network destinations. Alert on reads of credential files, unexpected outbound hosts and bulk repository cloning.
What Engineering Leaders Should Decide Now
Three decisions matter more than any single tool purchase.
- Which tasks may run unattended? Draft policy that separates suggestion, local action and anything touching shared systems.
- Who owns the assistant estate? Security, platform engineering or both, but someone must hold the inventory and approve additions.
- What is the incident plan? If a developer session is hijacked, can you revoke tokens, identify affected repositories and roll back published packages quickly?
Run a tabletop exercise built on the Mandiant scenario: an agent installs a poisoned package and a token leaks. The gaps show up fast.
Conclusion: Trust the Productivity, Verify the Permissions
Coding assistants deliver real productivity, and the answer is not to ban them. But the evidence from 2025 and 2026 is consistent: attackers now treat developer tooling as a primary route into software supply chains, through invented package names, poisoned MCP servers, malicious agent configuration and hijacked sessions.
The key takeaways:
- Hallucinated packages have fallen from the 19.7% reported in 2025 to roughly 4.6%–6.1% in an early 2026 preprint, but repeatable names keep slopsquatting viable.
- The larger shift is from bad suggestions to bad actions, because agents carry developer privileges.
- MCP servers, extensions and agent config files deserve the same review as third-party code.
- Grounding in live registry data, scoped short-lived credentials, sandboxing and install delays are practical, available controls.
Start with the inventory. Once you can name every assistant, plugin and server in your environment, the rest of the controls have somewhere to attach.
Note: several figures cited here come from vendor reports, secondary summaries and a not-yet-peer-reviewed preprint. Verify against primary sources before using them in formal risk assessments.

Leave a Reply