Who decides to install a package now?
Control of the software supply chain has always rested on a deliberate act: a developer selects a package, checks its origin, compares it and adds it to the project. Allowlists and dependency reviews all assume that human decision. The coding agent short-circuits that step. It writes a function, notices a library is missing, infers the name, runs the install and executes the tests. Often, the developer only reads the final diff, after the install command has already run.
Yet this agent operates at the heart of what an attacker wants: secrets (API keys, repository access tokens, cloud credentials), write access to the source code and access to the continuous integration pipelines that build the company's deliverables. At the same time, it continuously ingests text written outside the company: incident tickets on public repositories, README files of third-party libraries, technical documentation pages.
A coding agent combines the right to install packages, access to local secrets and the reading of content written by strangers. That combination creates a supply chain driven without human validation.
In its April 2026 bulletin on automation agents on workstations, CERT-FR describes this mechanism precisely:
Their use significantly widens the software supply chain and its attack surface: plugins can be loaded dynamically and, depending on the integration model, executed as trusted code, with the same privileges as the application.CERT-FR (France's national CERT), CERTFR-2026-ACT-016, April 13, 2026 · our translation
The agent, its extensions, its tool servers (see our analysis of MCP) and the libraries it downloads form one and the same execution chain, carrying the privileges of the workstation or account that hosts it.
What does an agent do with a package that does not exist?
A language model assembles plausible identifiers. Sometimes that plausible name matches no real project. In 2024, six researchers (Spracklen, Wijewickrama, Sakib, Maiti, Viswanath and Jadliwala) quantified this phenomenon in the study We Have a Package for You!. Using 576,000 code samples generated in two languages by 16 models, they found an average hallucinated-package rate of at least 5.2% for commercial models and 21.7% for open models, for a total of 205,474 distinct invented package names.
Every hallucinated name is a name available for registration. An attacker who reserves it on a public registry only has to wait for an agent to recommend it, then install it unprompted. On March 28, 2024, The Register reported the experiment run by Bar Lanyado, a researcher at Lasso Security: noticing that a model repeatedly suggested a nonexistent package named huggingface-cli, he registered that name on PyPI in December for measurement purposes. According to his figures, the dummy package gathered more than 15,000 legitimate downloads in three months. The article also says that Alibaba even mentioned this package in the installation instructions of the README of its GraphTranslator project.
This second part shows how a hallucination hardens. The error does not stay confined to the model's outputs: it passes into documentation written by developers. Once a real project cites it, the invented package takes on every appearance of a legitimate dependency.
The usual defense, checking the dependency file during code review, comes too late when the agent triggers the install on its own in the middle of a session to get a test to pass. By the time the developer examines the merge request, the package's install script has already run on the workstation.
The agent's tools serve whoever hijacks the workstation
On August 26, 2025, compromised versions of several Nx packages were pushed to the npm registry. According to the incident report published by the Nx team, the attackers exploited an injection flaw in a GitHub Actions workflow to steal the project's npm publishing token, then distributed the booby-trapped versions for four hours. That token gave them the means to publish without going through the usual validation chains.
One element sets this compromise apart from a simple credential theft. According to Nx's analysis, the post-install script combed the workstation for sensitive files, tried to invoke the AI agents installed locally (such as Claude and Gemini), then exfiltrated its haul to a public GitHub repository through the GitHub command-line client. The malicious payload did not rely on its own routines alone: it tried to hijack the AI tools already present on the victim's machine.
The lesson goes beyond this one incident. A coding agent installed on a development workstation has, by construction, broad read rights, local indexing tools and authenticated sessions. Any code that manages to run on the machine inherits that arsenal. The capabilities given to the agent then turn to the intruder's benefit.
The reverse holds on the side of state operations. On November 13, 2025, Anthropic documented a campaign detected in mid-September 2025 and attributed with high confidence to a group linked to the Chinese state, which had hijacked Claude Code as an intrusion vector against about thirty organizations. According to that report, the model handled 80 to 90% of the operations, with the human operator intervening only sporadically (perhaps 4-6 critical decision points per hacking campaign). On the offensive side too, the coding agent acts as an operator in its own right.
The public repository is a write surface for strangers
A coding agent reads tickets, merge requests and comment threads. On an open repository, any third party can drop text into them. On May 26, 2025, Invariant Labs detailed an attack on the official MCP server for GitHub: an attacker opens a booby-trapped ticket on the target's public repository; when the developer later asks their agent to process the pending tickets, the agent reads the hidden instruction, extracts data from private repositories it has access to, then opens a merge request on the public repository by itself, copying that information into it. In their demonstration, the researchers exfiltrated personal data from their test account this way, including compensation details.
Invariant Labs stresses that the flaw is not an implementation bug in the MCP server but an architectural flaw inherent in how the agent is coupled: GitHub cannot fix this behavior on its own, server-side. The risk arises as soon as one agent combines reading public sources, access to private repositories and the ability to write outward. The authors recommend restricting the agent's rights to only the repositories required for the current task and enforcing runtime controls. They also note that many developers enable an "always allow" confirmation policy and stop validating each tool call. The question of sorting what may pass on its own from what requires a human decision is covered in our article on human oversight.
This attack combines indirect prompt injection and data exfiltration by the agent. It falls squarely under supply chain risk: the repository is the agent's raw material, and the texts found there dictate what it generates, what it installs and what it publishes.
CI is where the agent's rights become releases
On July 23, 2025, AWS published security bulletin AWS-2025-015 (CVE-2025-8217) after malicious code was found in version 1.84.0 of the Amazon Q Developer extension for Visual Studio Code. AWS's investigation established that the extension's CodeBuild environment exposed an inappropriately scoped GitHub token. A third party used it to push an unauthorized change into the extension's open-source repository, and that change ended up bundled in the published release. AWS states that a syntax error prevented the payload from executing and that no customer environment was compromised. Version 1.84.0 was withdrawn, the secrets were revoked and version 1.85.0 was deployed right after.
The incident's origin does not implicate an agent's autonomy: an overly permissive token is what allowed a coding assistant to be poisoned. But the episode recalls a structural reality: the coding assistant deployed in a company is itself a software component, assembled by a continuous integration chain and signed through tokens. If a single link in that chain gives way, the altered code goes straight down to the workstations of every development team. Cerberus holds the door: keys for the length of one act, signed tools, and nothing leaves except through it.
The parallel with the Nx incident is plain: in both cases, an insufficiently partitioned pipeline exposed a publishing token, and that one secret was enough to compromise distribution. Coding agents amplify this risk in two ways. First, they generate and modify the pipeline configuration files that CI then runs with its privileges. Second, they are often handed repository access tokens whose scope far exceeds the immediate need. The sizing of these accesses is detailed in our article on agent identities.
Five surfaces, one common rule
| Surface | What the agent decides alone | Public case |
|---|---|---|
| Dependencies | Which package to download and from which public registry. | Hallucinated packages (Spracklen et al., 2024); huggingface-cli (Lanyado, 2024). |
| Workstation secrets | Which local files to inspect and where to send the result. | Nx, August 26, 2025: local AI tools hijacked by the malicious script. |
| Repository read | Which instructions to execute after reading a ticket. | GitHub MCP server (Invariant Labs). |
| CI and publishing | Which workflow files to modify and which tokens to use. | Amazon Q Developer 1.84.0 (AWS-2025-015); Nx publishing token theft. |
| Agent extensions and tools | Which third-party plugins and connectors to load into memory. | CERT-FR, ACT-016: plugins executed with the host application's privileges. |
One thread links these five vectors: taken in isolation, none of the agent's technical gestures looks abnormal. Installing a library, reading an environment file or opening a merge request is part of its daily work. The risk arises from their sequence and from the source that triggered the action. A security mechanism that inspects the tool call without knowing what motivated it stays blind. To decide, the action must be tied to its origin.
What the texts say
The NIS2 directive explicitly lists control of the supply chain among the minimum requirements of its Article 21(2):
supply chain security, including security-related aspects concerning the relationships between each entity and its direct suppliers or service providersDirective (EU) 2022/2555, Article 21(2)(d)
The next point adds "security in network and information systems acquisition, development and maintenance". That is precisely a coding agent's field of action: it imports software building blocks, writes code and maintains what exists. When it installs on its own a package with a hallucinated name, it introduces into the information system a third-party supplier that no one in charge has listed.
In its bulletin on office-automation agents, CERT-FR sets out recommendations that transfer directly to development environments: limit actions and tools to what is strictly necessary, require prior human validation before any system command or action with side effects, confine execution in a dedicated sandbox, and filter by allowlist both the channels and the authorized counterparts. Applied to a coding agent, this means treating every package installation, every script execution and every CI pipeline change as a sensitive operation subject to control.
SentinelOS sits between your AI agents and the resources they call on. It evaluates every action before it runs, including when the request stems from external content the agent ingested, such as an incident ticket or a README file.
Before the agent's next installation: what teams that are ahead do
- They force traffic through an internal mirror repository. The agent can only fetch libraries from a company registry restricted to previously vetted packages. Any request for an unknown name fails outright instead of bouncing to the public registries.
- They disable install scripts by default. The hooks that run automatically when packages are installed are turned off, except for a named, restricted list of known dependencies.
- They remove secrets from the agent's environment. No local file keeps production keys and no broadly privileged token lives on the workstation. The agent only receives ephemeral tokens, scoped to the one repository concerned.
- They partition the execution environment. The agent runs in a dedicated container or virtual machine, with no view of the developer's home directory or of command-line utilities foreign to its task.
- They separate public-reading sessions from private access. An agent that processes tickets or code from a public repository has no read right on internal repositories during the same session.
- They lock the CI pipeline files. Any change touching integration or publishing workflows requires the explicit approval of a human peer and can never be merged by the agent.
- They observe flows before freezing the rules. A few weeks of dry-run logging are enough to map the packages, file paths and tools the agents actually call on, so the filtering policy can be adjusted to observed usage.
SentinelOS judges every action of your agents before it leaves, holds the ones that matter for a person, and signs every decision. Installed on your premises.
Discover SentinelOSSources
- J. Spracklen, R. Wijewickrama, A. H. M. N. Sakib, A. Maiti, B. Viswanath, M. Jadliwala, "We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs", arXiv:2406.10279, June 2024 (v3, March 2025). arxiv.org
- Thomas Claburn, "AI bots hallucinate software packages and devs download them", The Register, March 28, 2024. theregister.com
- Juri Strumpflohner, "S1ngularity - What Happened, How We Responded, What We Learned", Nx Blog, September 5, 2025. nx.dev
- AWS, "Security Update for Amazon Q Developer Extension for Visual Studio Code (Version #1.84)", bulletin AWS-2025-015 (CVE-2025-8217), July 23, 2025. aws.amazon.com
- Invariant Labs, "GitHub MCP Exploited: Accessing private repositories via MCP", May 26, 2025. invariantlabs.ai
- Anthropic, "Disrupting an AI-orchestrated cyber espionage campaign", November 13, 2025. anthropic.com
- CERT-FR, "Vulnérabilités et risques des produits d'automatisation par IA agentique sur les postes de travail" (vulnerabilities and risks of agentic AI automation products on workstations), CERTFR-2026-ACT-016, April 13, 2026. cert.cyber.gouv.fr
- Directive (EU) 2022/2555 (NIS2), Article 21. eur-lex.europa.eu
