Typosquatting relies on typos and mix-ups: a missing letter, an uppercase I instead of a lowercase l, one hyphen too few. The pattern is old — crossenv stole environment variables in 2017, jeIlyfish stole SSH and GPG keys in 2019 — but it is now run at industrial scale: Check Point counted more than 500 malicious PyPI packages in two waves in 2024, and on 28 May 2026 Microsoft documented 14 npm packages from one actor within four hours that targeted AWS credentials, Vault tokens, the GitHub Actions context and npm tokens.
Slopsquatting & coding agents: securing the AI software supply chain
AI models suggest packages that do not exist — and attackers can register exactly those names. Coding agents with terminal access install whatever they consider right. This deep dive connects typosquatting and slopsquatting in npm and PyPI with a security model for coding agents and their harness: attack chain, five protection layers, obligations under the CRA, NIS2 and DORA, a self-assessment and a CISO whitepaper (in German).
Last updated: October 2026 · Valeri Milke, ISO 27001 & ISO 42001 Lead Auditor
You will receive the download link immediately on the page and by email.
agent · ~/customer-portal — dependency gate active
PromptDownload the model from Hugging Face via the command line.
AgentTo do that, I’ll install the matching CLI package:
$pip install huggingface-cli
Dependency gate · policy
- ✕Vendor docsOfficial installation: huggingface_hub[cli] — name differs
- ✕KnownRepeatedly hallucinated name — experiment by Bar Lanyado (Lasso Security)
- ✕AllowlistNot approved
BLOCKED · Deviates from vendor docs — approval ticket sent to AppSec
Recreated from the documented experiment by Bar Lanyado (Lasso Security, 2024).
PromptSet the environment variables in the npm scripts in a cross-platform way.
AgentI’ll add the matching dependency:
$npm install crossenv
Dependency gate · policy
- ✕NameSeparator variant of cross-env
- ✕HistoryKnown typosquat: removed in 2017, stole environment variables
- ✓Install scriptsDisabled in the build — no code runs at installation
- ✕AllowlistNot approved
BLOCKED · Suspected typosquat — cross-env was intended
Historical case from the npm ecosystem (2017).
PromptValidate the form inputs with a schema.
AgentI’ll use the approved library at a pinned version:
$npm install zod --save-exact
Dependency gate · policy
- ✓AllowlistApproved, owner: platform team
- ✓Release ageVersion older than the 7-day cooldown
- ✓Install scriptsDisabled (allowScripts)
- ✓LockfileVersion pinned, integrity hash verified
ALLOWED · Change appears in the pull request for approval
- 19.7% invented package references in 16 code models
- 30,000+ downloads of an empty placeholder (according to Lasso)
- 237+ repositories with a hallucinated npx command
19.7%of the package references from 16 code models were invented — 440,445 out of 2.23 million (USENIX Security 2025)
43%of the invented names came back every time across ten repetitions — predictable means registrable
24 CVEsin AI IDEs and coding agents from a single research series (IDEsaster, December 2025)
11 Sep 2026The CRA reporting obligations have applied since this day — due diligence for components lies with the integrating manufacturer
In June 2024, researchers led by Joseph Spracklen (University of Texas at San Antonio) showed that 16 code models invented 19.7% of their package references across 576,000 code samples — 205,474 unique names that did not exist in npm or PyPI. 43% of them reappeared every single time across ten repetitions. Anyone who registers such names no longer needs a typo: since 2025, this has been called slopsquatting. At the same time, the tooling landscape has shifted — from the assistant that suggests to the agent that installs in the terminal, calls MCP servers and loads skills. HiddenLayer therefore describes the harness, not the model, as the actual attack surface and organizes the defense into five layers: visibility, control, validation, monitoring and governance. ThreatLocker adds the package side: check names, govern dependencies through allowlists, disable install scripts, keep secrets out of build paths, Zero Trust at runtime. A hands-on test from October 2026 shows that today’s tools still invent packages — rarely, but reproducibly. This page turns that into a program: the attack chain shows where your controls take effect. The harness map locates ten trust relationships of a coding agent, with documented cases. The package name check verifies suggestions locally in your browser. The obligations matrix maps the CRA, NIS2, DORA, the AI Act and product liability. The self-assessment measures your maturity — and the CISO whitepaper provides a roadmap, configuration baseline, policy template and audit catalog.
From typo to invented package
Milestones of typosquatting, package hallucinations and attacks on coding agents — up to the obligations that apply today.
1 August 2017
crossenv: typosquatting in npm
A package named crossenv imitates cross-env and sends environment variables to a third-party server. npm removes around 40 packages from the same actor.
1 December 2019
jeIlyfish on PyPI
An uppercase I instead of a lowercase l: the copy of jellyfish has been stealing SSH and GPG keys since December 2018 before it is reported and removed.
28 March 2024
huggingface-cli and 500+ typosquats
Bar Lanyado (Lasso Security) publishes his experiment with an empty package under a hallucinated name — according to Lasso, more than 30,000 downloads in three months. On the same day, Check Point reports more than 500 malicious typosquats on PyPI.
12 June 2024
The hallucination study
Spracklen et al. publish their analysis: 16 code models, 576,000 code samples, 19.7% hallucinated package references. The paper appears at USENIX Security in 2025.
8 April 2025
The term slopsquatting
Andrew Nesbitt defines slopsquatting as the AI variant of typosquatting and attributes the term to Seth Larson of the Python Software Foundation.
26 August 2025
s1ngularity: AI CLIs as a tool
Compromised Nx versions call locally installed AI command-line tools to search for secrets. GitGuardian counts 2,349 leaked secrets.
15 September 2025
Shai-Hulud
A self-replicating npm worm compromises more than 500 packages via stolen tokens. A second wave follows in November.
21 January 2026
react-codeshift
Aikido finds a hallucinated npx command in AI-generated agent skills, spread across more than 237 repositories, and registers the name defensively.
10 March 2026
ENISA names slopsquatting
The Technical Advisory for Secure Use of Package Managers explicitly lists slopsquatting as a new attack vector in AI-assisted development.
28 July 2026
Five layers for the harness
HiddenLayer publishes its security model for coding agents: visibility, control, validation, monitoring, governance. One day earlier, the Commission clarified in its CRA guidelines that due diligence lies with the integrating manufacturer.
11 September 2026
CRA reporting obligations apply
Manufacturers report actively exploited vulnerabilities via ENISA’s Single Reporting Platform: early warning within 24 hours, notification within 72 hours, final report no later than 14 days after a corrective measure becomes available.
6 October 2026
Hands-on test with three tools
A developer tests 30 npm tasks with three AI coding tools: six invented package names, two of them across several tools. A small sample — but a clear signal.
Nine key takeaways on slopsquatting and coding agents
Summary for each key takeaway — expand for details, figures and sources.
In slopsquatting, a language model invents a package name and an attacker registers it. Imitating a real package is no longer necessary. Most invented names are not typos: in the study by Spracklen et al., only 13.4% of the hallucinated Python names were within two characters of a real package — which is why classic typo detection does not catch them. The term is attributed to Seth Larson (Python Software Foundation); Andrew Nesbitt popularized it on 8 April 2025.
Hallucinations are not noise: across ten repetitions of the same prompt, 43% of the invented names came back every time, and 58% more than once. Admittedly, 81% of the names came from only one model — but a 2026 preprint (not peer-reviewed) found 127 names that five current models invented identically; 53 of them were still available for registration. Anyone who collects these names knows the targets before a victim types them in.
OWASP LLM09: Unsafe Code Generation →To date, there is no publicly documented case in which an attacker maliciously registered a demonstrably hallucinated name and victims installed it because of an AI suggestion. What is documented is that such names do get installed: according to Lasso Security, an empty placeholder package under the hallucinated name huggingface-cli received more than 30,000 downloads in three months; in 2026, a hallucinated npx command in AI-generated agent skills spread to more than 237 repositories. This is not an all-clear, but a window of opportunity.
A wrong name only becomes dangerous once code runs. npm lifecycle scripts, the build code of Python source packages and .pth files execute code, often without anyone watching. In 2025, the npm worm Shai-Hulud spread across more than 500 packages because stolen tokens allowed new releases to be published. Since 8 July 2026, npm v12 disables install scripts of dependencies by default — import-time code is not affected.
A coding agent consists of a model and a harness: rules files, inputs, terminal, MCP servers, skills, package managers, secrets, repository and network. Documented attacks almost always hit the harness — hidden Unicode characters in rules files, poisoned tool descriptions, swapped MCP configurations, an injection that switches on auto-approve mode (CVE-2025-53773). The IDEsaster research series found more than 30 vulnerabilities with 24 CVEs in AI IDEs.
MCP security in detail →HiddenLayer organizes the defense into five layers: visibility across every trust relationship, control over permissions and approvals, validation before trust, monitoring outside the model, and governance with owners and incident response. The core point: language models follow instructions — they do not enforce a security policy. Rules in the prompt reduce the risk, but they do not replace a control.
Runtime control with the Agent Control Standard →Reviews, scans and agent rules are hurdles: they only work if someone notices the mistake. Break points interrupt the attack regardless — a registry proxy with an allowlist, disabled install scripts, agents without access to host secrets, egress control. A cooldown of a few days catches freshly registered packages, but not names an attacker has been squatting on for a long time. The goal is at least three independent break points.
Under Art. 13(5) CRA, manufacturers must exercise due diligence when integrating third-party components — expressly including open source; the obligation applies from 11 December 2027, while the reporting obligations under Art. 14 have applied since 11 September 2026. According to the Commission guidelines of 27 July 2026, package repositories and individual developers have no CRA obligations. NIS2 (Section 30 BSIG) requires security of the supply chain and of development; DORA requires the analysis and testing of open-source code before production use, where feasible.
Go to the CRA deep dive →Interactive · Attack chain
Where does your chain break? Seven stages from invented package name to spread
A slopsquatting or typosquatting attack needs every stage. Switch on controls and see at which stage the attack stops — and whether you have only one break point or defense in depth. The mapping of controls to stages is VamiSec’s classification based on the cited sources.
Starting point
Hurdles onlyHurdles yes, break point no
Your controls impede individual stages but do not reliably stop the attack. Reviews, scans and rules in the prompt depend on a human or a model noticing the mistake.
- Break points
- 0 / 7
- First break point
- —
- Stages with hurdles only
- 3
- Active controls
- 3 / 16
Switch on controls
Visibility
Control
Validation
Monitoring
Governance
interrupts the stage impedes the stage
Stage 01 / 07
A model suggests a package name that does not exist — or a human makes a typo
Code models add dependencies that sound plausible but were never published. Typosquatting, by contrast, relies on typos and mix-ups of well-known names. Both begin before a package manager even runs.
EvidenceIn the study by Spracklen et al. (USENIX Security 2025), 19.7% of the packages suggested by 16 code models did not exist.
What works at this stage — click to toggle
Instructions in AGENTS.md or rules files reduce the error rate, but they are not a control: the model can ignore them, and attackers can manipulate them.
OpenSSF guide for code assistants (08/2025)Measures how often your tools invent packages or suggest insecure commands in your stack — and whether your controls take effect.
HiddenLayer · Validation
An attacker registers the name in npm or PyPI
Recurring hallucinations are predictable. Anyone who collects them can squat on exactly these names — with a plausible description, a copied README and an install script. For typosquatting, variants of popular names are enough.
EvidenceIn late 2023, Bar Lanyado uploaded an empty test package under a repeatedly hallucinated name — according to Lasso Security, it was downloaded more than 30,000 times in three months.
What works at this stage — click to toggle
You have no influence on this stage: a name is registered in the public registry. That makes the stages before and after it all the more important.
The name makes its way into code, a manifest or an install command
Via copied code, autocomplete, an agent that installs a missing module on its own, or documentation that passes on the wrong name. At this point at the latest, a second pair of eyes helps.
EvidenceThe study found hallucinated names that kept reappearing across repeated prompts — so they end up in code not by chance, but reproducibly.
What works at this stage — click to toggle
Without an inventory, you do not know which agents work in which repositories with which permissions — and no other control can then be enforced across the board.
HiddenLayer · VisibilityInstructions in AGENTS.md or rules files reduce the error rate, but they are not a control: the model can ignore them, and attackers can manipulate them.
OpenSSF guide for code assistants (08/2025)Measures how often your tools invent packages or suggest insecure commands in your stack — and whether your controls take effect.
HiddenLayer · ValidationThe agent may suggest packages but not install them itself. This only works if the approving person actually checks the name.
HiddenLayer · ControlNew packages and lockfile changes become visible and need a named approval before they are merged.
ThreatLocker 2026; Art. 21(2)(e) NIS2
The package manager resolves the name and downloads the package
Without an allowlist, an internal proxy or a minimum release age, npm or pip fetches whatever is in the registry — including a package that was created two days ago. The strongest break point against slopsquatting is here.
EvidenceA proxy with an allowlist simply does not know an invented name — the installation fails.
What works at this stage — click to toggle
Builds and agents download only through a proxy that serves approved packages exclusively. An invented name does not exist there.
Art. 21(2)(d) NIS2New packages and lockfile changes become visible and need a named approval before they are merged.
ThreatLocker 2026; Art. 21(2)(e) NIS2Freshly registered squats are often discovered and removed within a few days. A cooldown catches them — but not names an attacker has been squatting on for longer.
Package manager feature, e.g., pnpm minimumReleaseAgenpm ci, --frozen-lockfile or --require-hashes prevent a build from silently resolving different packages. New dependencies, however, are still added deliberately.
ThreatLocker 2026Detects known malicious packages and suspicious patterns such as install scripts with network access — but not new, unknown squats reliably.
ThreatLocker 2026
Install scripts or import code run with the privileges of the developer, agent or build
npm lifecycle scripts (preinstall, install, postinstall) and the build code of Python source packages run automatically during installation. With coding agents that have terminal access, often nobody is watching.
EvidenceAccording to Microsoft, a single actor published 14 malicious npm packages within four hours in 2026; their install hooks ran automatically.
What works at this stage — click to toggle
Interrupts the most common execution path of malicious npm packages. Code that only runs on import remains — so isolate as well.
npm ignore-scripts; ThreatLocker 2026Detects known malicious packages and suspicious patterns such as install scripts with network access — but not new, unknown squats reliably.
ThreatLocker 2026Prevents install scripts from launching unknown programs and limits what package managers and runtimes are allowed to access.
ThreatLocker 2026 · Zero Trust at runtimeContainer, dev container or VM without mounted credentials: even if malicious code runs, it finds nothing worth stealing.
HiddenLayer · Control; OWASP ASI05Detects access to credential files, unexpected processes and unusual network destinations — outside the model, which does not enforce a security policy itself.
HiddenLayer · Monitoring
The malicious code accesses secrets
Cloud credentials, Vault tokens, npm publish tokens, SSH keys, the context of CI jobs — anything reachable on the machine, in the container or in the build.
EvidenceThe packages described by Microsoft targeted AWS credentials, HashiCorp Vault tokens, the GitHub Actions context and npm publish tokens.
What works at this stage — click to toggle
Container, dev container or VM without mounted credentials: even if malicious code runs, it finds nothing worth stealing.
HiddenLayer · Control; OWASP ASI05Prevents install scripts from launching unknown programs and limits what package managers and runtimes are allowed to access.
ThreatLocker 2026 · Zero Trust at runtimeStolen tokens expire quickly and allow little. For publishing your own packages: Trusted Publishing instead of stored tokens.
ThreatLocker 2026; npm Trusted PublishingDetects access to credential files, unexpected processes and unusual network destinations — outside the model, which does not enforce a security policy itself.
HiddenLayer · Monitoring
Data is exfiltrated, stolen tokens carry the attack further
Exfiltration over the network; with stolen publish tokens, the attacker tampers with further packages. This is how a single slip becomes a supply chain attack on your customers.
EvidenceIn 2025, the npm worm Shai-Hulud spread autonomously to further packages via stolen tokens.
What works at this stage — click to toggle
Without an outbound connection, the loot stays in the container — and the build reaches registries only through the proxy.
HiddenLayer · ControlPrevents install scripts from launching unknown programs and limits what package managers and runtimes are allowed to access.
ThreatLocker 2026 · Zero Trust at runtimeStolen tokens expire quickly and allow little. For publishing your own packages: Trusted Publishing instead of stored tokens.
ThreatLocker 2026; npm Trusted PublishingDetects access to credential files, unexpected processes and unusual network destinations — outside the model, which does not enforce a security policy itself.
HiddenLayer · MonitoringShortens the time to containment: who rotates which tokens, who blocks what, who reports to whom — and within what deadline.
HiddenLayer · Governance; Art. 14 CRA
Simplified model. Real attacks skip stages: if a legitimate package is compromised, as with chalk and debug in 2025, the chain begins at stage 4 — and only the controls from there onward take effect.
Interactive · Harness map
The harness is the attack surface: ten building blocks a coding agent trusts
A coding agent is more than a model. Rules files, inputs, terminal, MCP servers, skills, package managers, secrets, repository, network and model provider make up its harness — and each of these building blocks is a trust relationship that an attacker can exploit. Select a building block or a documented attack path.
Attack path
Coding agentModel + harness
Rules files, context files & system prompt
AGENTS.md, CLAUDE.md, .cursor/rules, copilot-instructions.md, project documentation and everything that ends up in the context window.
ASI01ASI06LLM01
Threats & documented cases- Rules File Backdoor
Invisible Unicode characters (zero-width joiners, bidi markers) hide instructions in Cursor and GitHub Copilot rules files. Humans do not see them in review, but the model follows them — across sessions and in forks as well.
Pillar Security, 18 March 2025 — classified by Cursor and GitHub as user responsibility, no CVE - CopyPasta
A prompt injection disguised as a license notice in a hidden Markdown comment in a README causes the agent to copy the payload into every file it edits — the injection spreads itself across codebases.
HiddenLayer, 4 September 2025 — demonstrated on Cursor, also Windsurf, Kiro and Aider
- ValidationTreat rules and context files like code: review, CODEOWNERS, automated checks for invisible characters.
- ControlClassify repository content as untrusted input — do not let instructions from comments or files be executed.
- MonitoringAlert on changes to agent configurations and rules files.
Prompts & external content
Issues, pull requests, tickets, chat messages, web pages, documentation and tool outputs that the agent reads.
ASI01LLM01
Threats & documented cases- Spoofed user instruction
A hidden HTML comment in a README used Cursor’s internal control tags (<user_query>) so that injected text was treated as a user instruction. An API key was exfiltrated via curl — even though curl was on the denylist.
HiddenLayer, 31 July 2025 — fixed in Cursor 1.3 - Toxic Agent Flow
A crafted issue in a public repository caused an agent using the official GitHub MCP server to write data from private repositories into a public pull request.
Invariant Labs, 26 May 2025 — architectural, not a bug in the MCP server
- ControlRestrict agents to one repository and minimal data sources per task (least agency).
- ValidationCheck planned actions before execution — not just the prompt.
- MonitoringDetect and block data flows between private and public destinations.
Terminal, file system & tool calls
Shell commands, file write permissions, IDE settings, command allowlists and auto-approve mode.
ASI02ASI05LLM06
Threats & documented cases- Auto-approve via injection
A prompt injection made GitHub Copilot in agent mode write “chat.tools.autoApprove” into the VS Code settings. After that, terminal commands ran without confirmation — remote code execution.
CVE-2025-53773, CVSS 3.1: 7.8 — August 2025 - Bypassing command approvals
Approved commands such as grep or echo were combined with appended commands to bypass confirmations and exfiltrate environment variables.
Gemini CLI (Tracebit, 07/2025, fixed in 0.1.14); Claude Code CVE-2025-54795 (CVSS 4.0: 8.7)
- ControlProhibit auto-approve modes; installation, push, deletion and cloud changes only with human approval.
- ControlRun agents in a container, dev container or VM — without access to the host.
- MonitoringLog every executed command with context (who, which prompt, which repository).
MCP servers & tool descriptions
Local and remote MCP servers, their tool descriptions, parameters and configuration files such as mcp.json.
ASI04ASI02MCP Top 10
Threats & documented cases- Tool Poisoning & Rug Pull
Hidden instructions in tool descriptions land in the context with system-level authority. A server can swap its description after approval — in the experiment, this leaked a WhatsApp chat history.
Invariant Labs, 1 April and 7 April 2025 - MCPoison
Cursor approved MCP entries by name only. Anyone with write access to the repository swapped the command and arguments after approval — silent, persistent code execution.
CVE-2025-54136, CVSS 3.1: 7.2 — fixed in Cursor 1.3
- VisibilityRecord all MCP servers per agent — with source, version and permissions.
- ValidationCheck tool descriptions and hidden metadata before approval; re-approve after every change.
- ControlAllow only approved MCP servers at pinned versions, not “latest”.
Skills, plugins & marketplaces
Agent skills with YAML front matter, plugins, extensions and the marketplaces they come from.
ASI04
Threats & documented cases- Malicious skills
Metadata in the YAML front matter is loaded into the system prompt before any code runs. Hidden permissions or triggers change the behavior without standing out in marketplace views.
HiddenLayer, 28 July 2026 - ToxicSkills
Snyk examined 3,984 skills: 534 (13.4%) had at least one critical finding, 76 were confirmed malicious.
Snyk, 5 February 2026
- ValidationCheck skills, including their front matter, before approval; verify origin and author.
- ControlAllow only curated skills from an internal catalog.
- VisibilityInventory installed skills per workstation.
Package managers & registries
npm, pnpm, Yarn, pip, uv, Poetry — and the public registries npm and PyPI from which they download.
ASI04ASI05LLM09LLM03
Threats & documented cases- Slopsquatting
The model suggests a package that does not exist. Recurring hallucinations are predictable — an attacker registers exactly these names.
Spracklen et al., USENIX Security 2025: 19.7% hallucinated packages - Typosquatting & install scripts
Similar names catch typos; lifecycle scripts execute code immediately during installation — with the agent’s privileges.
OWASP ASI05: unverified package installations
- ControlObtain packages only through an internal proxy with an allowlist; minimum release age.
- ControlDisable install scripts by default, enforce lockfiles.
- ValidationCheck every new dependency against vendor docs, age, maintainers and repository.
Secrets, tokens & identities
Cloud credentials, API keys, npm and PyPI tokens, SSH keys, Git credentials, the identity under which the agent acts.
ASI03
Threats & documented cases- Secret hunting via AI CLI
In August 2025, compromised Nx versions called locally installed AI command-line tools — according to Wiz, with flags that skip confirmation prompts — to search for secrets. The agent became the attacker’s tool; according to GitGuardian, this succeeded on 95 of 366 attacked systems.
s1ngularity / Nx, 26 August 2025 - API key before the trust dialog
A repository setting redirected API requests to a third-party endpoint before the user trusted the project — the API key could be exfiltrated.
Claude Code CVE-2026-21852, CVSS 4.0: 5.3 — fixed in 2.0.65
- ControlShort-lived, narrowly scoped credentials (OIDC) instead of long-lived tokens; no production secrets on agent systems.
- ControlGive agents their own identity with minimal permissions — not the developer’s.
- MonitoringDetect access to credential files and unusual token usage.
Repository, pipelines & release
Branches, pull requests, CI workflows, build configuration, release pipelines and publish permissions.
ASI04ASI08
Threats & documented cases- Compromised extension in a release
An overly broad GitHub token in the build configuration made it possible to commit code to the Amazon Q extension; version 1.84.0 contained a wipe instruction to the agent. It did not run because of a syntax error.
AWS-2025-015 / CVE-2025-8217 — fixed in 1.85.0 - Configuration from the repository
Project files started MCP servers or code before the user trusted the project.
Codex CLI CVE-2025-61260; Claude Code CVE-2025-59536 (CVSS 4.0: 8.7)
- ControlBranch protection and mandatory review for agent commits too; agents must not merge on their own.
- ControlGive tokens in pipelines minimal permissions; Trusted Publishing instead of stored publish tokens.
- GovernanceInclude agent identities in the authorization concept and recertify them regularly.
Network & egress
Outbound connections from agents, package managers and build jobs — including allowed domains that can serve as an exfiltration channel.
ASI02
Threats & documented cases- Exfiltration via allowed destinations
Secrets are exfiltrated via HTTP requests, DNS or commits to public repositories — often via destinations that are approved for work.
e.g., s1ngularity 2025, Tracebit 2025
- ControlRestrict outbound traffic from agents and builds to approved destinations (deny by default).
- MonitoringAlert on unusual destinations, data volumes and upload patterns.
Model, provider & shadow AI
The models in use, their providers, data processing, and tools that employees use without approval.
LLM09ASI10
Threats & documented cases- Hallucination & non-determinism
The same model suggests different packages and commands for the same task — security cannot be delegated to the model.
OWASP LLM09: Unsafe Code Generation - Shadow AI
Private accounts and extensions bypass inventory, approvals and logging.
HiddenLayer: Visibility & Monitoring
- GovernanceDefine approved tools, models and data classes in a policy.
- VisibilityUncover shadow AI using identity, license and endpoint data.
- MonitoringMonitor API usage and conspicuous compute consumption.
Cases with a CVE number have been fixed; the respective advisory names the fixed versions. CVSS scores are given with their version (3.1 or 4.0) and are not directly comparable. The mapping of controls to the five layers follows HiddenLayer’s model (28 July 2026) and is VamiSec’s classification.
Interactive · Package name check
Plausible package name or trap? Check a suggestion
Enter a package name suggested to you by an assistant, an agent or a README. The check compares it locally against widely used npm and PyPI packages, detects typical typosquatting and combosquatting patterns, and flags plausible-sounding made-up names. Only the registry can show whether a name is invented — the check supplies the matching verification commands.
npm install
Examples
The check runs entirely in your browser: nothing is sent or stored, and nothing is fetched from npm or PyPI.
No name entered yet
Type in a package name — for example from an AI suggestion, a README or an agent log.
The 5-minute check before every new dependency
- Compare against the vendor docsNot against the AI answer, but against the project’s documentation or repository. Is the name an exact match?
- Age, maintainers, downloadsNewly created, hardly any downloads, a maintainer change shortly before the release: stop and ask.
- Look at install scriptspreinstall, postinstall or build code that downloads more code or opens connections is a warning sign.
- Repository and provenanceIs a repository linked, does the code match the description, is there build provenance?
- Approve and pinAdd only via the allowlist, pin the version, check the lockfile diff in the pull request.
Interactive · Obligations matrix
Which rule applies where? Eight control areas, five legal frameworks plus guidance
There is no dedicated law for AI-suggested dependencies and coding agents — but the CRA, NIS2 with the BSIG, DORA, the AI Act and product liability apply at specific points. Select your role to highlight the relevant frameworks, and a cell to see the legal reference and classification. Only the legal text is binding; guidance documents are non-binding orientation on the state of the art.
Your role
| Control area × framework | CRAArt. 14 since 11 September 2026, Art. 13 and Annex I from 11 December 20275 | NIS2 / BSIGapplies8 | DORAapplies since 17 January 20257 | AI Actphased from 20252 | Product liabilityfor products placed on the market after 9 December 2026; via national law1 | GuidanceOrientation7 |
|---|---|---|---|---|---|---|
| Selection & provenance of components | — | — | ||||
| Inventory & SBOM | — | — | ||||
| Secure development & testing, including for AI code | — | — | ||||
| Changes & approvals | — | — | — | |||
| Integrity & protection against malware | — | — | — | |||
| Vulnerabilities in components & reporting | — | — | ||||
| Management responsibility & competence | — | — | ||||
| Classification, liability & penalties | — | — |
Select a cell to see the legal reference and classification. Use the role filter to hide frameworks that are not relevant to your profile.
Cyber Resilience Act, Regulation (EU) 2024/2847Art. 14 since 11 September 2026, Art. 13 and Annex I from 11 December 2027
- Selection & provenance of componentsArt. 13(5)
Manufacturers must exercise due diligence when integrating third-party components — expressly including free and open-source software; the scope depends on the risk (Recital 34). The obligation applies from 11 December 2027. According to the non-binding Commission guidelines C(2026) 5252 (Example 34), package repositories and individual developers have no CRA obligations — due diligence lies with the integrating manufacturer.
- Inventory & SBOMAnnex I Part II(1)
Identify and document components, among other things with an SBOM in a commonly used, machine-readable format that covers at least the top-level dependencies. The CRA does not currently prescribe a format; the Commission’s implementation page does not list an implementing act under Art. 13(24) (an optional provision) (as of 27 July 2026). Applies from 11 December 2027.
- Secure development & testing, including for AI codeAnnex I Part I(2)(a), (b), (j) · Part II(3)
On the basis of the risk assessment and where applicable: make products available without known exploitable vulnerabilities, with a secure by default configuration, limit attack surfaces, and test security effectively and regularly. Applies from 11 December 2027.
- Vulnerabilities in components & reportingArt. 13(6) · Art. 14
From 11 December 2027: report vulnerabilities in integrated components to their manufacturer or maintainer (Art. 13(6)). Since 11 September 2026: report actively exploited vulnerabilities simultaneously to the coordinating CSIRT and ENISA via the Single Reporting Platform: early warning within 24 hours, notification within 72 hours, final report no later than 14 days after a corrective measure becomes available.
- Classification, liability & penaltiesArt. 64(2), (10)
Infringements of Annex I, Art. 13 and Art. 14 can be penalized with up to EUR 15 million or 2.5% of total worldwide annual turnover, whichever is higher. No fines against open-source software stewards; micro and small enterprises are exempt for missing the 24-hour early warning deadline.
NIS2 Directive (EU) 2022/2555 and BSIG (German BSI Act, in force since 6 December 2025)applies
- Selection & provenance of componentsArt. 21(2)(d), (3) · Section 30(2) sentence 2 no. 4 BSIG
Risk management measures include supply chain security. Under Art. 21(3) NIS2, the choice of supply chain measures must take into account the specific vulnerabilities of each direct supplier, the overall quality of their products and their cybersecurity practices, including secure development procedures — not adopted verbatim in the BSIG, but applicable through interpretation in conformity with the directive.
- Inventory & SBOMImplementing Regulation 2024/2690, Annex 6.1.2(c)
When acquiring ICT products, request information about the hardware and software components used. Binding only for the types of digital entities named in the implementing regulation, such as cloud providers and managed service providers.
- Secure development & testing, including for AI codeArt. 21(2)(e) · Section 30(2) sentence 2 no. 5 BSIG
Security measures in the acquisition, development and maintenance of IT systems, components and processes, including vulnerability handling and disclosure.
- Changes & approvalsImplementing Regulation 2024/2690, Annex 6.2
Rules for secure development across all phases, including security requirements for development environments — binding for the listed types of digital entities, good orientation for others.
- Integrity & protection against malwareImplementing Regulation 2024/2690, Annex 6.6.1(c), 6.9
Patches only from trusted sources and with integrity checks; protection against malicious and unauthorized software with detection and prevention measures.
- Vulnerabilities in components & reportingSection 30(2) sentence 2 no. 5 BSIG
Vulnerability handling and disclosure are part of the minimum measures — in VamiSec’s classification, this includes detecting and handling compromised dependencies quickly.
- Management responsibility & competenceArt. 20 NIS2 · Section 38 BSIG
The management body implements the measures, oversees them, is liable under company law for culpable breaches of duty, and regularly attends training.
- Classification, liability & penaltiesSection 65(2), (5)–(7) BSIG
Fines if measures under Section 30(1) are not taken or not documented: up to EUR 10 million for particularly important entities and EUR 7 million for important entities; with total turnover above EUR 500 million, up to 2% or 1.4% of total turnover respectively.
DORA, Regulation (EU) 2022/2554, and RTS (EU) 2024/1774applies since 17 January 2025
- Selection & provenance of componentsRTS Art. 16(8)
Source code from ICT third-party service providers and from open-source projects must be analyzed and tested before production use — where feasible. Applies to financial entities under the full ICT risk management framework (Title II).
- Inventory & SBOMRTS Art. 10(2)(d)
Track the use of third-party and open-source libraries by ICT services supporting critical or important functions — including versions and updates.
- Secure development & testing, including for AI codeRTS Art. 16(3) and (4)
Source code reviews with static and dynamic testing as well as security testing of software packages at the latest in the integration phase — regardless of whether a human or an agent wrote the code.
- Changes & approvalsArt. 9(4)(e) · RTS Art. 17(1)
All changes to ICT systems are recorded, tested, assessed, approved, implemented and verified; approval and implementation are functionally separated. If an agent suggests a new dependency, VamiSec classifies this as a change — requiring approval by an independent function.
- Integrity & protection against malwareRTS Art. 16(7)
Provide controls to protect the integrity of source code — in VamiSec’s classification, this also covers what an agent is allowed to write to the repository and configuration.
- Vulnerabilities in components & reportingRTS Art. 10(2)(d)
Monitor versions and updates of the libraries in use — a prerequisite for responding quickly to a compromised package.
- Management responsibility & competenceArt. 28(1)
Financial entities remain fully responsible at all times when using ICT services — in VamiSec’s classification, this also applies to externally sourced coding agent services (SaaS), which are likely to qualify as ICT services.
AI Act, Regulation (EU) 2024/1689 as amended by Regulation (EU) 2026/1744phased from 2025
- Management responsibility & competenceArt. 4 as amended by Regulation (EU) 2026/1744
Providers and deployers of AI systems take measures to support AI literacy. Since the Digital Omnibus (in force 27 July 2026), no specific level of literacy of individual persons has to be guaranteed.
- Classification, liability & penaltiesArt. 6(2) · Annex III
Software development is not listed in Annex III — an AI coding assistant is typically not high-risk AI. Obligations under Art. 53 and 55 fall on the providers of the GPAI models, not on the companies that use coding agents.
Product Liability Directive (EU) 2024/2853for products placed on the market after 9 December 2026; via national law
- Classification, liability & penaltiesArt. 4(1) · Art. 8(1) · Art. 11(2)
Software is a product. The manufacturer’s liability also covers damage caused by defective components integrated under its control; missing software updates necessary for safety do not exonerate it. Applies to products placed on the market after 9 December 2026, and only to damage suffered by natural persons. The directive takes effect via national law; as of 8 October 2026, the German government draft (BT-Drs. 21/4297) has not been verified as promulgated.
BSI, ANSSI, ENISA, OWASP, HiddenLayer — non-binding orientationOrientation
- Selection & provenance of componentsENISA 03/2026 · BSI CON.8.A6 · Grundschutz++ DEV.4.2
ENISA explicitly names slopsquatting and recommends visibility of all AI-selected packages. The BSI’s IT-Grundschutz provides for obtaining libraries from trustworthy sources (CON.8.A6); Grundschutz++, as a SHOULD requirement, for prohibiting artifacts from unreliable or unknown sources (DEV.4.2) — expressly including packages and models.
- Inventory & SBOMBSI TR-03183-2 v2.1.0 · Grundschutz++ DEV.4.3
SBOM with recursive dependency resolution, at least down to the first component outside the scope of delivery, in CycloneDX 1.6 or later or SPDX 3.0.1 or later — deeper than the CRA minimum.
- Secure development & testing, including for AI codeBSI/ANSSI 2024 · OWASP LLM09
AI coding assistants do not replace experienced developers; review generated code and let quality assurance grow along with productivity. OWASP lists invented libraries under LLM09 as Unsafe Code Generation.
- Changes & approvalsHiddenLayer · Control
Human approval for high-impact actions, least privilege as the default, and a review of system prompts and default configurations before deployment.
- Integrity & protection against malwareBSI CON.8.A20 · Grundschutz++ DEV.4.4
Check unknown external components without established reviews for vulnerabilities; ensure integrity by checksum or cryptographic certificate.
- Vulnerabilities in components & reportingENISA 03/2026
Cheat sheets for selection, integration with lockfiles and hash verification, monitoring and remediation; strengthened vulnerability management for AI-selected packages.
- Management responsibility & competenceHiddenLayer · Governance
An owner for every production agent, include coding agents in threat models and AI governance, agent-specific incident response, regular review of permissions and trusted integrations.
- Binding obligation
- Binding for certain addressees or indirectly
- Guidance, non-binding
As of 8 October 2026. The mapping to control areas is VamiSec’s classification and does not constitute legal advice. Quotations from EU legal acts are based on the English original versions; Commission guidelines and ENISA, BSI and OWASP documents are non-binding.
Full text
Slopsquatting and coding agents in detail: 13 chapters from the threat landscape to the 90-day plan
The chapters lead from the current situation through the mechanics of the attacks to the five protective layers, dependency hygiene, the obligations under the CRA, NIS2, DORA and the AI Act, and the implementation plan. Every figure is sourced; obligation, practice and VamiSec recommendation are labeled separately.
From suggestion to execution
AI coding tools are part of everyday development. Now that agents install packages and call tools on their own, the risk is shifting from the flawed suggestion to unsupervised execution.
In a short time, AI tools have gone from experiment to standard equipment in software development. In the Stack Overflow Developer Survey 2025, 84% of respondents said they use or plan to use AI tools in their development process (2024: 76%). They were actually in use among 78.5%, and daily among 47.1%. In 2025, only just under a third used AI agents at work (about 31%); 37.9% had no plans to do so.
84%use AI tools or plan to (Stack Overflow 2025)
73%use coding assistants and agents daily (Stack Overflow 2026)
> 1 millionpull requests by the Copilot coding agent, May to September 2025 (Octoverse)
+178%growth in public repositories using an LLM SDK, to more than 1.1 million (Octoverse 2025)
A year later, the focus has shifted. In the 2026 survey (30,903 valid responses from 169 countries), coding assistants and agents are the most important AI use case at 66%, ahead of general-purpose chatbots (63%). Stack Overflow sums it up: the “overwhelming majority” now use coding assistants and agents daily (73%) – the figure covers both together, not agents alone. GitHub’s Octoverse 2025 points in the same direction: more than 180 million developers, around 36 million of them new, and almost 80% of newcomers already use Copilot in their first week. GitHub does not give an acceptance rate for the coding agent’s pull requests.
Assistants suggest, agents execute
For security, what matters is less how much code a model writes than what it is allowed to do itself. An assistant makes a suggestion that a human reads, accepts or discards. An agent works in the terminal, runs npm install or pip install, integrates MCP servers (Model Context Protocol, the interface to external tools and data sources) and skills (reusable instruction packages for agents), and reads repository content, issues and documentation as context. HiddenLayer points out that agents may adopt typosquatted packages with less human review and that remote MCP servers can change without the organization noticing (HiddenLayer, 16 July 2026).
| Dimension | Assistant (suggestion) | Agent (execution) |
|---|---|---|
| Package name | appears in the chat or code; a human decides whether to install it | is installed directly in the terminal |
| Context | the developer’s prompt | README, issues, rules files, tool descriptions, web pages – each source a potential entry point for prompt injection, i.e. instructions hidden in data |
| Permissions | none of its own | those of the session: file system, network, tokens, cloud profiles |
| Extensions | hardly any | MCP servers, skills, hooks, plugins |
| Control point | review before the commit | approval dialog – unless auto-approved |
Simplified comparison; VamiSec assessment.
That agents execute installation instructions without verifying ownership has been observed: researchers found 8,265 llms.txt or llms-full.txt files on 6,214 domains; 120 of them referenced unregistered packages or domains. After the researchers claimed some of these names with beacon packages, a Fortune 500 company checked in within an hour; the process chains pointed to Claude, OpenAI Codex and Nous Research Hermes (according to Schneier, citing Ars Technica, September 2026). This is not a hallucination – the names came from vendor documentation – but it follows the same logic: whoever claims a free name first determines what the agent installs. Versions are unreliable too: in around 37,000 analyzed AI upgrade recommendations, GPT-5 hallucinated 27.8% of component versions, according to Sonatype.
Three source articles and how to read them
ThreatLocker, 15 September 2026
Vendor blog on typosquatting and slopsquatting in npm and PyPI. Cites Spracklen et al. and recommends package vetting, approved dependency lists or an internal registry or proxy, pinning with lockfiles, software composition analysis (SCA), disabled lifecycle scripts and isolated builds with short-lived credentials. Assessment: both incidents cited there (Microsoft 2026, Check Point 2024) are classic typosquatting.
HiddenLayer, 28 July 2026
Framework for coding agents and their harness – the execution environment of prompts, tools, skills and MCP servers around the model. Five layers: Visibility, Control, Validation, Monitoring, Governance. Conceptual, without statistics of its own.
Harsh, dev.to, 6 October 2026
Self-test with 30 everyday npm prompts against three coding tools; each suggested at least one nonexistent package name. A sample, not a study: each prompt ran once, so no rate can be calculated. By the author’s own account, the result is “a signal, not a verdict”.
The guiding idea of this deep dive: today, the software supply chain begins in the prompt. A package name that a model suggests or an agent picks up from a skill file is the first link in a chain that runs through registration, resolution and execution all the way to stolen tokens and spread. Anyone who evaluates only the model overlooks the stages at which an attack can actually be stopped.
Typosquatting: old, but industrialized
Registering confusable package names is an old pattern. What is new is the speed, the automation and the targets, which now include the AI tools themselves.
In typosquatting, an attacker registers a name that is confusingly similar to a popular package and bets on typos, careless copying or automated tools. Public registries assign names on a first-come, first-served basis; a new account is all it takes. The patterns are limited in number:
| Pattern | Principle | Documented example |
|---|---|---|
| Omission | Characters are missing | “suport-color”, clearly modeled on supports-color (SANDWORM_MODE, Socket 2026) |
| Insertion, substitution, transposition | A character is added, replaced or swapped | “reqjuests” (requests), “tensoflom” (tensorflow) – Check Point 2024 |
| Homoglyphs | Visually similar characters, such as rn instead of m or a digit instead of a letter | “jeIlyfish” with a capital I instead of l (PyPI, reported 1 December 2019, online since 11 December 2018; stole SSH and GPG keys) |
| Separators | Hyphen, underscore or period varied | “crossenv” instead of cross-env (npm, 1 August 2017; exfiltrated environment variables; around 40 packages of the hacktask account removed) |
| Prefix, suffix, brand | Known name plus an addition such as -setup, -helper or -utility | Imitations of OpenSearch and Elasticsearch tools, some with a fake repository URL (Microsoft 2026); Claude Code imitations (Socket 2026) |
| Scope confusion | A scoped package (@name/…) imitates an unscoped one – or vice versa | not individually documented in the cases analyzed; in the Microsoft case, packages appeared both with and without their own scope (@vpmdhaj) |
Example names from Check Point (28 March 2024), Microsoft (28 May 2026), Socket (20 February 2026) and the historical cases crossenv (npm, 2017) and jeIlyfish (PyPI, 2019). Do not install.
From lone actors to assembly-line work
Check Point, March 2024 (PyPI)
More than 500 malicious packages in two waves (around 200, then more than 300), each from its own maintainer account: the accounts were created on 26 March, and the uploads followed the next day. On Windows, setup.py fetched a second stage that stole passwords and files and replaced crypto wallet software. PyPI removed the packages shortly after they were reported.
Microsoft, 28 May 2026 (npm)
A newly created account published 14 packages within four hours that imitated OpenSearch, Elasticsearch, DevOps and configuration tools. Install hooks harvested AWS credentials (IMDSv2, ECS task roles, STS, Secrets Manager in at least 16 regions), HashiCorp Vault tokens, GitHub Actions tokens including context, and npm tokens with publishing rights.
21,764malicious open-source packages in the first quarter of 2026 (Sonatype)
46 per daynew malicious npm packages on average – 75% of all new cases (Sonatype, Q1 2026)
+73%increase in detections of malicious open-source packages in 2025; almost 90% were on npm (ReversingLabs)
Neither Check Point nor Microsoft links these campaigns to AI; they are about typosquatting and brand impersonation. What stands out is the target profile: the attackers are after build environments, cloud roles and publishing tokens – exactly the permissions coding agents work with. Sonatype names the abuse of trust in well-known names, tools and release workflows as the most successful attack vector in the first quarter of 2026.
SANDWORM_MODE: typosquatting targets the agent
The transition is marked by a campaign described by Socket on 20 February 2026: at least 19 typosquatted npm packages, three of them Claude Code imitations, stole npm, GitHub, CI and crypto credentials as well as LLM API keys from nine providers. They also registered their own MCP server in the configuration of Claude Code, Claude Desktop, Cursor, VS Code Continue and Windsurf. Its tools, with innocuous names such as index_project or lint_check, contained a prompt injection: the assistant was to read SSH keys, AWS credentials, .npmrc and .env and conceal this step from the user. To spread further, the malware used stolen npm tokens, injected pull_request_target workflows and SSH as a fallback.
VamiSec assessment: here, the package is merely the door opener. The actual payload is a persistent change to the agent’s environment that takes effect in every future session with the developer’s permissions.
What the registries do – and where it ends
- Typosquatting check: PyPI says it automatically detects and flags potential typosquatting when a project is created; PyPI does not give thresholds or figures (2025 year in review).
- Quarantine: administrators can remove projects from the index without deleting them. Since August 2024, this has affected around 140 projects, only one of which was released again (PyPI, 30 December 2024). In March 2026, quarantine via trusted reporters was already being triggered automatically.
- Status marker: via PEP 792, the index APIs signal the status “quarantined”; installers are expected to warn about it.
- Response time: in 2025, PyPI handled more than 2,000 malware reports, 66% within four hours and 92% within 24 hours.
The limits are structural. All of these measures kick in after the upload; the window until removal remains. npm, too, responded to Shai-Hulud by blocking uploads that contained known indicators – likewise reactive. And a similarity check only detects what resembles an existing name. That is exactly where it fails with names a language model makes up from scratch.
Slopsquatting: when the model invents the name
Language models invent package names – reproducibly and rarely recognizable as typos. Whoever registers such a name first determines what gets installed.
The term slopsquatting is attributed to Seth Larson (Python Software Foundation); Andrew Nesbitt popularized it on 8 April 2025. It describes the following: a language model hallucinates a nonexistent package name, and an attacker registers it with malicious code. The authoritative measurement comes from Spracklen et al. (USENIX Security 2025, Distinguished Paper Award), who do not use the term themselves.
19.7%of the 2.23 million package references hallucinated (440,445)
205,474unique made-up package names
43%of hallucinations recurred in all ten repetitions (sample: 500 prompts)
48.6%of made-up Python names: six or more character edits away from real packages
The researchers had 16 code models generate 576,000 code samples in Python and JavaScript. A package counted as hallucinated if it did not exist on PyPI or npm on 10 January 2024 – a lower bound. The 19.7% refers to package references, not to code samples.
| Finding | Result (Spracklen et al.) | Consequence for defense |
|---|---|---|
| Model type | Commercial 5.2% on average, open source 21.7% (only three commercial models, all from OpenAI) | Choice of model reduces the risk but does not eliminate it |
| Temperature | Higher temperature, more hallucinations (maximum: GPT-4 8.9%, GPT-3.5 31.8%); other decoding parameters did not help | Even conservative settings produce made-up packages |
| Repeatability | 500 prompts, ten times each: 43% in all runs, 58% more than once, 39% never again | Many made-up names are predictable – and therefore registrable |
| Model specificity | 81% of names came from only one of the 16 models | Small overlap; the risk depends on the model |
| Name distance | Of 76,489 Python names: 13.4% Levenshtein distance 1–2, 37.9% 3–5, 48.6% 6 or more | Mostly not typos – classic typo detection does not catch them |
| Language confusion | 8.7% of made-up Python names are real npm packages | An existing name is not automatically the right one |
| Countermeasures at the model | RAG (retrieval-augmented generation), self-refinement and fine-tuning help; fine-tuning reduced the rate for DeepSeek by 83%, but HumanEval performance from 51.4% to 25.3% | Correcting the model costs quality – controls also belong outside the model |
Spracklen et al., USENIX Security 2025 (arXiv:2406.10279 v3). Levenshtein distance = number of single-character edits between two names. Repeatability was examined on four models and Python.
Evidence from research and practice, 2023 to 2026
In 2023, Bar Lanyado showed at Vulcan Cyber that ChatGPT 3.5 recommended unpublished packages for more than 40 of 201 Node.js questions and more than 80 of 227 Python questions. For his follow-up study published at Lasso Security in 2024, he uploaded an empty package under the repeatedly hallucinated name huggingface-cli (real: huggingface_hub[cli]) – according to Lasso, it received more than 30,000 authentic downloads in three months. Alibaba listed pip install huggingface-cli in the first README commit of its GraphTranslator repository (26 February 2024).
Frontier models 2026 (preprint)
In 2026, Aleksandr Churilov repeated the methodology with five current models: rates from 4.62% to 6.10%. All five invented 127 names identically; after coordinated disclosure, 53 remained registrable (as of April 2026). Not peer-reviewed; regex extraction and reference lists from 2024 may skew the values.
Agents (Trend Micro, 2025)
Coding agents with reasoning invented about half as many package names as base models, but not zero – not even Cursor with live validation via MCP servers.
dev.to sample (6 October 2026)
In the self-test described at the beginning, Claude Haiku 4.5 invented two package names, GitHub Copilot one and ChatGPT/Codex three; two appeared with several tools, and they were deliberately not published. Not a measurement, but an indication that the problem persists.
react-codeshift (Aikido, 21 January 2026)
A never-published npm name, blended from jscodeshift and react-codemod, appeared as an npx command in AI-generated agent skills and made its way into at least 237 repositories. Aikido registered it as a harmless placeholder and attributes the subsequent downloads to agents following the skills.
HalluSquatting (Spira et al., 2026)
Repositories and skills are hallucinated too – in the test scenarios up to 85% and 100%, respectively. Pre-registered resources worked against all six coding assistants tested in 20 to 65% of attempts. With a prior web search, Cursor CLI cloned correctly 93.4% of the time; without a search, 0.9%. Preprint; no real-world infections known.
No documented attack so far
As of 8 October 2026, there is no publicly documented case in which an attacker maliciously registered a demonstrably hallucinated name and victims installed it because of an AI suggestion. The claim that PhantomRaven (2025), for example, exploits slopsquatting is an assessment by Koi without published evidence. For the 53 Churilov names, too, Socket and InfoWorld see no malicious registrations.
VamiSec assessment: this is no all-clear. The preconditions are documented: hallucinations repeat, a small overlap spans models, and harmless placeholders received real installations, most recently apparently by agents. At the same time, a hit remains hard to detect: the name usually does not look like a typo, and Seth Larson considers it difficult, probably impossible, to quantify attempted installations of hallucinated packages (The Register, 12 April 2025). The absence of documented cases therefore does not prove that the risk is low.
The trigger: install scripts, import code and tokens
A wrong package name only becomes dangerous once code runs. The 2025/2026 incidents show how short the path is from installation to stolen tokens and self-propagation.
Between the name suggestion and the damage lies execution. Package managers offer several trigger points for this, and not all of them can be switched off with a single setting. The common advice to disable lifecycle scripts (ignore-scripts) is correct but incomplete.
| Trigger point | When code runs | Documented case | Does npm ignore-scripts stop it? |
|---|---|---|---|
| npm lifecycle scripts (preinstall, install, postinstall) | during installation | Microsoft case 05/2026; Shai-Hulud 09 and 11/2025 | yes |
| Python source distribution (setup.py) | during installation from the source distribution | Check Point 2024 | not applicable (pip) |
| .pth file | every time the Python interpreter starts, without an import | litellm 1.82.8 (24 March 2026): the file was listed in RECORD; hash checks did not trigger | no – not a lifecycle script |
| Import-time code | on the first import or require | named by OWASP under ASI05 | no |
| Git dependency | during installation: a bundled .npmrc can override the path to the git program | reason for --allow-git=none (GitHub, 18 February 2026) | no |
| URL dependency | payload is loaded from an HTTP address during installation, invisible in the registry tarball | PhantomRaven (according to Koi, 10/2025) | not the download itself; use --allow-remote=none for that |
Sources: Microsoft 28 May 2026; Check Point 28 March 2024; Snyk 24 March 2026; GitHub Changelog 18 February 2026; The Register 30 October 2025; OWASP Top 10 for Agentic Applications 2026.
Six incidents, one pattern
- 1AI CLIs as the attacker’s tools1ngularity/Nx – 26 August 2025
Via a pull_request_target workflow with shell injection, attackers obtained the npm token and published malicious Nx versions for around four hours. According to Wiz, the payload searched for locally installed AI CLIs and launched them with --dangerously-skip-permissions, --yolo or --trust-all-tools to inventory secrets. According to GitGuardian, this succeeded on only 95 of 366 target systems (around 26%); in total, 2,349 unique secrets were made public.
- 2Phishing, crypto clipperchalk/debug – 8 September 2025
A maintainer fell for a phishing email from support@npmjs[.]help; the domain had been registered on 5 September 2025. Malicious versions of 18 popular packages (Aikido; Socket counts 19 versions) with more than 2 billion weekly downloads according to Aikido swapped wallet addresses in the browser by intercepting fetch, XMLHttpRequest and window.ethereum.
- 3Worm via stolen tokensShai-Hulud – September 2025
A self-replicating worm injected post-install scripts, searched for secrets using TruffleHog, environment variables and cloud metadata, and published further packages with captured npm tokens. GitHub removed more than 500 compromised packages; Wiz traces the campaign back to credentials from s1ngularity.
- 4preinstall and runner backdoorShai-Hulud 2.0 – from 24 November 2025
The second wave triggered as early as the preinstall phase, disguised as a Bun installer, registered infected hosts as self-hosted GitHub runners and, according to Wiz, created more than 25,000 malicious repositories. If it could neither steal credentials nor exfiltrate data, it attempted to destroy the home directory, according to Unit 42.
- 5Compromised maintainer machineaxios – 31 March 2026
After social engineering and the infection of his machine with a RAT (remote access trojan), axios 1.14.1 and 0.30.4 were published via the lead maintainer’s personal account with an additional dependency that downloaded further malware, including a RAT, in multiple stages – for around three hours. In its alert of 20 April 2026, CISA explicitly recommended ignore-scripts=true and min-release-age=7 (days) in .npmrc, as well as phishing-resistant MFA.
- 6Valid provenance, agent as persistence locationTanStack / Mini Shai-Hulud – 11 May 2026
Via a pull_request_target workflow and a poisoned Actions cache, attackers read the OIDC token for trusted publishing from runner memory and published 84 malicious versions of 42 @tanstack packages – with valid SLSA Build Level 3 provenance (StepSecurity). For persistence, the malware wrote a SessionStart hook into .claude/settings.json that runs node .vscode/setup.mjs every time Claude Code starts, plus a VS Code task with runOn: folderOpen.
Two lessons
First: provenance – the signed attestation of which repository and build a package comes from – proves origin, not harmlessness. To paraphrase StepSecurity, SLSA provenance confirms which pipeline produced an artifact – not whether it behaved as intended. In the Red Hat “Miasma” case, 32 tampered packages likewise carried valid signatures because the attackers used the legitimate OIDC publishing path (Microsoft, 2 June 2026). The npm documentation itself states that provenance does not guarantee content free of malicious code.
Second: tokens are the currency of spread. Most of these payloads looked for npm, GitHub, cloud or LLM API credentials and used publishing rights for the next wave. VamiSec assessment: every agent session in which plaintext tokens, cloud profiles or write access to a registry are within reach is a potential starting point for such a wave. Mini Shai-Hulud also shows that the agent’s own configuration becomes a persistence location.
The harness is the attack surface
The attacks on coding agents documented here do not break any model. They exploit trust – in context files, tool descriptions, configurations and approval logic.
In its framework of 28 July 2026, HiddenLayer puts one thesis at the center: the essential attack surface of a coding agent is not the model but its harness – prompts, tools, skills, MCP servers and the orchestration logic around the model. HiddenLayer sees the root of the attacks in misplaced trust. As early as 16 July 2026, the company had classified every source an agent reads as a potential entry point for indirect prompt injection.
> 30vulnerabilities in AI IDEs, 24 of them with a CVE (IDEsaster, 6 December 2025)
13.4%534 of 3,984 agent skills reviewed with at least one critical finding (Snyk)
76confirmed malicious skills or payloads (Snyk, 5 February 2026)
Attack classes with evidence
| Attack (source, date) | Harness component exploited | OWASP mapping |
|---|---|---|
| Hidden prompt injection in Cursor (HiddenLayer, 31 July 2025) | A hidden HTML comment in a README uses the system prompt’s control tokens to pass as a user instruction; denylist bypass via $(), SSH key exfiltration through tools that need no permission. Fixed in Cursor 1.3 | LLM01, ASI01, ASI02 |
| CopyPasta (HiddenLayer, 4 September 2025) | Prompt injection in a hidden README comment, disguised as a license; the agent copies it into every file it edits (Cursor, also Windsurf, Kiro, Aider) | LLM01, ASI01, ASI06 |
| Rules File Backdoor (Pillar Security, 18 March 2025) | Cursor and GitHub Copilot rules files with invisible Unicode characters; no CVE, classified by both vendors as the user’s responsibility | LLM01, ASI01, ASI06 |
| Tool poisoning, rug pull (Invariant Labs, 04/2025) | Hidden instructions in MCP tool descriptions; a rug pull changes the description after approval. Demo: the agent read out ~/.cursor/mcp.json and ~/.ssh/id_rsa | ASI02, ASI04 |
| Toxic Agent Flow (Invariant Labs, 26 May 2025) | A malicious issue in a public repo makes the agent write private content into a public PR via the official GitHub MCP server – an architecture flaw, not a server bug | ASI01, ASI02; OWASP scenario under ASI04 |
| Auto-approve RCE, CVE-2025-53773 (GitHub Copilot in VS Code/Visual Studio; CVSS 3.1: 7.8) | Prompt injection writes chat.tools.autoApprove: true into .vscode/settings.json; confirmations are skipped, terminal commands run | LLM01, ASI05 |
| MCPoison, CVE-2025-54136 (Cursor; CVSS 3.1: 7.2) | MCP entries were approved by key name only; a subsequent commit swaps the command. Fixed in Cursor 1.3 | ASI04, ASI05 |
| CurXecute, CVE-2025-54135 (Cursor; CVSS 3.1: 8.6) | A Slack message read via MCP makes the agent write an mcp.json entry that starts without approval – even if the change is rejected. Fix in 1.3.9 according to the CVE entry, in 1.3 according to the discoverers | LLM01, ASI01, ASI05 |
| Project files in Claude Code and Codex CLI (2025/2026) | CVE-2025-59536: project code ran before the trust dialog (CVSS 4.0: 8.7). CVE-2026-21852: a repository setting could send the API key to a third-party endpoint before the dialog (CVSS 4.0: 5.3). CVE-2025-61260: project configuration launched MCP commands without approval (CVSS 3.1: 9.8, CISA ADP score) | ASI04, ASI05 |
| ToxicSkills (Snyk, 5 February 2026) | Skills from ClawHub and skills.sh: prompt injection in 91% of the 76 confirmed malicious skills, malicious code in all of them | ASI01, ASI04 |
| Amazon Q for VS Code 1.84.0 (AWS-2025-015, CVE-2025-8217) | An overly privileged GitHub token in CodeBuild allowed code to be injected; according to The Register, the prompt was meant to delete files and cloud resources. According to AWS, it did not run because of a syntax error; nothing was deleted | ASI01, ASI02, ASI04 |
LLM01 Prompt Injection, LLM09 Misinformation (OWASP Top 10 for LLM Applications 2025); ASI01 Agent Goal Hijack, ASI02 Tool Misuse and Exploitation, ASI04 Agentic Supply Chain Vulnerabilities, ASI05 Unexpected Code Execution (RCE), ASI06 Memory & Context Poisoning (OWASP Top 10 for Agentic Applications 2026). Mapping: VamiSec assessment; Amazon Q and Toxic Agent Flow per OWASP. CVSS 4.0 and 3.1 are not directly comparable.
OWASP classifies package hallucinations themselves under LLM09 Misinformation (“Unsafe Code Generation”), not under LLM03 Supply Chain. In the agentic list, ASI05 covers the case in which packages installed without review execute malicious code at installation or import; ASI04 recommends, among other things, checking for typosquats.
IDEsaster (Ari Marzouk) describes a new chain for Copilot, Cursor, Windsurf, Claude Code and other AI IDEs: prompt injection → tools → basic IDE features, such as remote JSON schemas or overwritten workspace settings. On top of that come flaws in the approval and sandbox logic of the agent CLIs, such as a bypassable confirmation dialog in Claude Code (CVE-2025-54795, CVSS 4.0: 8.7) or a sandbox escape via a working directory specified by the model in Codex CLI (CVE-2025-59532, CVSS 4.0: 8.6).
Guiding principle: security outside the model
Most cases share a structure: the model did what its context suggested. Where vendors made fixes, they did so not in the model but in the harness – by requiring re-approval of changed MCP configurations, a trust dialog before any execution, canonical path checks or tighter allowlists. Accordingly, HiddenLayer titles its monitoring layer: security must exist outside the model. VamiSec assessment: treat rules files, MCP configurations, hooks and skills like executable code – with review, versioning and approval – and every source the agent reads as untrusted input.
Visibility: know every trust relationship
You can only secure what you know about. The first layer captures agents, models, harness components, permissions and dependencies – including the tools nobody has registered.
What HiddenLayer recommends (practice)
HiddenLayer titles the first layer of its framework of 28 July 2026 “Understand Every Trust Relationship”. It covers four subjects:
- All agents, models, harnesses, tools, MCP servers and skills in use – explicitly including shadow AI.
- The permissions of each agent and the systems it can reach.
- The origin and integrity of tools, skills and external services.
- The runtime interactions between agents, tools, repositories and external systems.
Origin and integrity are not a formality: remote MCP servers can change without the organization noticing (HiddenLayer, 16 July 2026). An inventory that contains only names therefore goes stale silently. To counter shadow AI, BSI and ANSSI recommend controlled company accounts instead of private access and clear rules on which tools may be used with which data. In its legally non-binding package manager recommendation of 10 March 2026, ENISA also advises visibility across all packages that AI tools select.
Implementation: agent bill of materials and SBOM (VamiSec recommendation)
We recommend maintaining the inventory as an agent bill of materials (AI-BOM): a machine-readable register that records for each agent the tool and version, model and provider, operating mode, connected MCP servers and skills with version or hash, rules files and the identity used. Alongside it sits the SBOM (software bill of materials, a list of all software components) for each release. In an emergency, both answer the same question: where is the affected component?
| What to capture | Data source | Responsible |
|---|---|---|
| Agents and harness: tool, version, mode | Software distribution, endpoint inventory, IDE extension lists | Platform team |
| Models and providers | Contracts, procurement, AI gateway or proxy logs | Procurement with AppSec |
| MCP servers, skills, rules files | Configuration files in repositories and home directories, e.g. mcp.json, settings.json, AGENTS.md | Repository owners |
| Agent identities and permissions | Identity provider, token management of the registry, Git platform and cloud | IAM |
| Dependencies | SBOM generation in the CI pipeline, lockfiles | Product team |
| Shadow AI | DNS and proxy logs compared against the allowlist | Information security |
| Runtime interactions | Agent hook telemetry, audit logs, EDR | SOC |
VamiSec recommendation. Adapt the roles to your organization – what matters is a named owner for each row.
When it comes to SBOM depth, precision pays off. In Annex I Part II(1), the CRA requires an SBOM in a commonly used, machine-readable format covering at the very least the top-level dependencies – applicable from 11 December 2027; it does not currently prescribe a specific format. BSI TR-03183-2 (version 2.1.0), by contrast, requires recursive resolution for TR-compliant SBOMs and names CycloneDX 1.6 or later or SPDX 3.0.1 or later. Malicious code can arrive via transitive dependencies: the malicious version axios 1.14.1 added the dependency plain-crypto-js, which downloaded further malicious stages (CISA, 20 April 2026). We therefore recommend the recursive SBOM as a working standard – as best practice, not as a CRA obligation. According to ENISA (SBOM Adoption State of Play, June 2026), 24% of respondents need a full-depth analysis, but only 14% receive one.
Link to the attack chain
Visibility is not a break point, but it is the prerequisite for all the others. It makes stage 03 (Adoption) harder because new packages, MCP servers and skills stand out. Without an inventory, allowlists, isolation and monitoring cannot be enforced across the board. After an incident, it limits stage 07 (Spread): affected repositories, hosts and tokens can be named immediately instead of having to be tracked down first.
Evidence: agent bill of materials
Versioned inventory with an as-of date, a responsible person for each entry and regular reconciliation against actual usage.
Evidence: configuration baseline
Approved MCP servers and skills per agent with version or hash; deviations are documented.
Evidence: SBOM per release
Format, depth and time of generation traceable, filed with the technical documentation.
Evidence: shadow AI reconciliation
Periodic analysis of proxy or DNS data against the allowlist, with the measures taken.
Regulatory anchor: financial entities under the full DORA framework must, under Art. 10(2)(d) of Delegated Regulation (EU) 2024/1774 (RTS on ICT risk management), track which third-party and open-source libraries are used by ICT services supporting critical or important functions – including versions and updates. The BSI’s Grundschutz++ includes, as a SHOULD requirement, documenting components via an SBOM before release (DEV.4.3, with reference to TR-03183-2).
Control: limiting the damage of a compromise
Sooner or later, an agent will read a manipulated instruction or suggest a wrong package. The second layer ensures that it is then allowed to do little, can reach little and finds nothing of value.
What HiddenLayer recommends (practice)
Under “Limit the Impact of Compromise”, HiddenLayer lists five measures: least privilege by default, human approval for consequential actions, access only to approved tools, MCP servers and skills, restricting unnecessary outbound network connections, and reviewing system prompts and default configurations before deployment. The OWASP Top 10 for Agentic Applications 2026 extend least privilege to “least agency”: no autonomy where it is not needed. The guidance from CISA, NSA and Five Eyes partner agencies of 1 May 2026 likewise advises against giving agents broad access to sensitive data and critical systems.
Documented vulnerabilities show that defaults are not automatically secure: before version 1.0.4, Claude Code contained an overly broad list of “safe” commands through which file contents could be exfiltrated without a prompt (CVE-2025-55284, CVSS 4.0: 7.1). In GitHub Copilot (VS Code/Visual Studio), the confirmation requirement could be switched off entirely via prompt injection (CVE-2025-53773, see chapter 5).
Implementation in six steps (VamiSec recommendation)
- 1Execution environmentIsolate
Agents with terminal access and builds run in containers, devcontainers or VMs – without mounted host credentials, SSH agent or cloud profiles. If malicious code runs, it finds as little as possible that is worth stealing.
- 2IdentityAssign a dedicated identity
The agent does not work with the developer’s personal tokens but with its own narrowly scoped identity: only the repositories and scopes the task requires, no publish rights.
- 3TokensShort-lived credentials
Publish your own packages via trusted publishing (OIDC) instead of with stored tokens – generally available on npm since 31 July 2025, from npm CLI 11.5.1. Where tokens remain, choose the shortest practicable lifetime.
- 4Tools, MCP, skillsEnforce allowlists
Only approved tools, MCP servers and skills can be loaded; packages come exclusively via the internal proxy (see dependency hygiene).
- 5NetworkRestrict egress
Outbound traffic only to approved destinations. Even harmless tools transport data: in 2025, HiddenLayer showed how an SSH key was exfiltrated via the image URL of a diagram.
- 6ConfigurationEnforce settings centrally
Auto-approve off; approval required for installations, network commands and write access to agent configuration. Block flags such as --dangerously-skip-permissions, --yolo or --trust-all-tools – according to Wiz, the s1ngularity malware invoked local AI CLIs with exactly these. Where the tool supports centrally managed policies, these should take precedence over settings from the repository.
7 daysDefault expiry of new granular npm tokens with write access (since mid-October 2025)
90 daysMaximum lifetime of these tokens
2 hrsLifetime of session tokens after npm login
9 Dec 2025Classic npm tokens permanently revoked
Human approval only works if the person can see what they are approving. In the Invariant Labs tool poisoning demo, the confirmation dialog did not display the full inputs. The BSI explicitly recommends confirmation by the user before an LLM executes functions (Evasion Attacks on LLMs, 6 November 2025). We recommend dialogs that show the command, package name and destination in full – and a few approvals that are taken seriously rather than constant confirmations.
Link to the attack chain
This layer provides the most break points: isolation without host secrets stops stage 06 (Access), egress control stage 07 (Spread), and the allowlist in the proxy stage 04 (Resolution). Human approval makes stage 03 (Adoption) harder. Short-lived, narrowly scoped tokens limit how far stolen credentials can reach.
Evidence for auditors
- Central configuration baseline per agent (auto-approve, approval requirements, blocked flags) with change history.
- Image or devcontainer definition without mounted credentials, plus the egress rules.
- Token inventory with identity, scope and expiry date; trusted publishing for your own packages.
- Samples from approval logs.
Regulatory anchor: for essential and important entities, Art. 21(2)(e) NIS2 and Section 30(2) sentence 2 no. 5 BSIG (German BSI Act) require security measures in acquisition, development and maintenance. Implementing Regulation (EU) 2024/2690 requires, for the types of entities named there, such as cloud and managed service providers, security requirements for development environments (Annex, point 6.2). Financial entities under the full DORA framework must separate the approval of changes from their request and implementation (Art. 17(1) RTS 2024/1774 on Art. 9(4)(e) DORA) – an agent that approves its own changes is hardly compatible with this (VamiSec assessment).
Validation: verify components instead of trusting assumptions
Whatever an agent loads, executes or writes must be verified before it takes effect – MCP servers and skills as well as packages and the generated code.
What HiddenLayer recommends (practice)
- Test agents with adversarial inputs before deployment (red teaming).
- Review proposed actions before execution.
- Vet third-party tools and skills – including hidden metadata.
- Approve specific versions instead of trusting “latest” indefinitely.
The last point targets the rug pull: an MCP server changes its tool description after it has been approved (Invariant Labs, 1 April 2025). MCPoison showed the same pattern in configuration: after the initial approval, a single commit was enough to swap the command of an MCP entry without a new prompt (CVE-2025-54136, see chapter 5). According to The Register, the unofficial npm package postmark-mcp shipped 15 inconspicuous versions before version 1.0.16 sent every outgoing email as a blind copy to a third-party address.
Hidden metadata is the second focus. Instructions in tool descriptions are invisible to users, but the model reads them (Invariant Labs); rules files can carry instructions in invisible Unicode characters (Pillar Security, 18 March 2025). Of 3,984 agent skills reviewed by Snyk, 76 were demonstrably malicious (5 February 2026, details in chapter 5).
Implementation: approval per component (VamiSec recommendation)
| Component | What to check | Approval artifact |
|---|---|---|
| MCP servers | Origin, source code or image, full tool descriptions, requested permissions and network destinations | Entry in the allowlist with version and hash; every change requires new approval |
| Skills and rules files | Plain text of the instructions, invisible characters, embedded installation commands, external references | Review like code, CODEOWNERS, pinned commit |
| Packages | Existence, age, adoption, maintainers, install scripts | Dependency review in the pull request, entry in the proxy |
| Agent configuration | Auto-approve, hooks, MCP entries, model endpoint | Reconciliation with the central baseline before rollout |
| AI-generated code | The same checks as for human-written code: review, SAST, DAST, tests | Mandatory checks in the pipeline, no exception for agent PRs |
Pinning by hash and commit ID is also recommended by the OWASP Top 10 for Agentic Applications 2026 (ASI04).
There is no special path for AI code. BSI and ANSSI state that AI coding assistants do not replace experienced developers and that productivity gains must be offset by more quality assurance (4 October 2024). Instruction files such as AGENTS.md help, but they are not a control. The OpenSSF guide for code assistants (1 August 2025) recommends instructing them not to add dependencies that could be malicious or hallucinated. This can reduce the risk – but the model can ignore the rule, and harmless-sounding skill instructions can even amplify package hallucinations (Hsu et al., accepted for EMNLP 2026).
Red teaming before rollout
- 1Define scenarios
Tasks that provoke package suggestions; prepared READMEs, issues and tool descriptions with hidden instructions; attempts to change agent settings or read credential files.
- 2Run in the target configuration
With exactly the model, harness, MCP servers and skills that are to be rolled out – in an isolated environment.
- 3Measure
How often does the agent invent packages? Does it follow injected instructions? Do the approval, proxy and isolation from layer 2 take effect?
- 4Repeat
With every change of model, tool version or integration, and as a regression test after incidents.
Link to the attack chain: validation makes stages 01 (Invention) and 03 (Adoption) harder because made-up names stand out in testing and review. Version approval prevents a silently changed component from being pulled in at stage 04 (Resolution). Evidence for auditors: red team report per agent configuration, allowlist with versions and hashes, review records for new dependencies, test evidence for AI-generated code.
Regulatory anchor: for financial entities under the full DORA framework, Art. 16 RTS 2024/1774 requires source code reviews with static and dynamic testing (para. 3), security testing of software packages no later than the integration phase (para. 4) and – where feasible – analysis and testing of open-source code before production use (para. 8). From 11 December 2027, the CRA requires manufacturers to carry out effective and regular security tests and reviews (Annex I Part II(3)).
Monitoring: security does not belong in the model
A model does not enforce a security policy. The fourth layer therefore observes from the outside what agents, package managers and builds actually do.
HiddenLayer justifies the fourth layer succinctly: language models are designed to follow instructions – not to enforce security policies (paraphrased). A control that exists only in the prompt falls with the first successful prompt injection. Monitoring therefore starts at the operating system, network, pipeline and harness. The OWASP Top 10 for Agentic Applications call strong observability “non-negotiable”.
What HiddenLayer wants to observe (practice)
- Movements of sensitive data
- Tool usage and file operations
- Privilege escalation attempts
- Shadow AI activity
- API usage and unusual compute consumption
Detection ideas from real incidents (VamiSec recommendation)
The campaigns of recent months provide concrete patterns. According to StepSecurity, the Mini Shai-Hulud wave around TanStack gained a foothold via a Claude Code SessionStart hook and a VS Code task (details in chapter 4). According to Socket, SANDWORM_MODE registered its own MCP server in the configuration of Claude Code, Cursor and other tools. According to Microsoft, Miasma kept a dormant exfiltration channel via api.anthropic.com ready; according to Snyk, the exfiltration domain of the litellm releases had been registered one day earlier. Several waves launched Bun as the runtime – a way around Node-centric monitoring.
| Signal | Source | Response |
|---|---|---|
| node, python or bun reads credential files such as ~/.npmrc, ~/.aws/credentials, ~/.ssh/, ~/.claude.json or .env during an installation | EDR, file access auditing on workstations and runners | Stop the process, isolate the host, rotate reachable tokens |
| New or changed hooks, MCP entries, auto-approve values or tasks with runOn: folderOpen | File integrity monitoring, diff in the pull request, hook telemetry | Revert the change, clarify its origin, check the host |
| Connections from a build or agent to newly registered or unknown domains | DNS and proxy logs | Block and assess the destination, review the session |
| Privilege escalation: new sudo rule, modified /etc/hosts, newly registered self-hosted runner | EDR, audit log of the Git platform | Isolate the host, remove the runner, review workflows |
| Unexpected runtime such as Bun in the pipeline or new .pth files in site-packages | Process telemetry, CI logs, file integrity monitoring | Abort the job, identify the triggering package |
| Sudden spike in usage of a model API key or access to non-approved AI services | Billing, AI gateway, proxy | Revoke the key, clarify the usage |
Patterns from StepSecurity (11 May 2026), Socket (20 February 2026), Microsoft (2 June 2026), Snyk (24 March 2026) and Wiz (24 November 2025, self-hosted runners in Shai-Hulud 2.0). Mapping and responses: VamiSec recommendation.
Telemetry via agent hooks
Several coding agents offer hook interfaces that launch custom programs on tool calls. We recommend using them to log tool calls, shell commands and file access centrally and to check risky calls before execution. The same interface, however, is a persistence path, as the TanStack wave shows; in Claude Code, hooks from project files at times ran without consent (Check Point, fixed on 26 August 2025). Hooks therefore belong in the centrally managed configuration – any change to them is itself an alarm signal.
Link to the attack chain: monitoring does not reliably stop any stage, but it shortens the time during which stages 05 (Execution), 06 (Access) and 07 (Spread) go unnoticed. The incidents show how short the windows are: the malicious TanStack versions were marked as deprecated after around 1.7 hours, and the axios versions were removed after about three hours. Our conclusion: your own detection must respond in hours, not days.
Regulatory anchor: for the types of entities named there, Implementing Regulation (EU) 2024/2690 requires protection against malicious and unauthorized software, including detection measures (Annex, point 6.9); for other NIS2 entities, it serves as guidance. The Five Eyes guidance on agentic AI (1 May 2026) explicitly calls for continuous monitoring.
Evidence: logging concept
Which agent, build and endpoint data is collected, with retention and access rules.
Evidence: detection rules
Documented rules with test evidence, such as a simulated access to a decoy credential file.
Evidence: alert records
Samples with response time, assessment and outcome.
Governance: security needs owners
Technical controls erode when nobody is responsible for them. The fifth layer anchors coding agents in responsibilities, policies and emergency processes.
What HiddenLayer recommends (practice)
Under “Security Requires Ownership”, HiddenLayer lists four points: a responsible person (owner) for every agent in production use, the inclusion of coding agents in existing threat models and AI governance programs, incident response procedures specifically for agentic AI, and regular review of permissions and trusted integrations. The Five Eyes guidance of 1 May 2026 likewise recommends integrating agentic AI risks into existing frameworks and performing threat modeling.
For NIS2 entities, this is a management responsibility. Management bodies must approve the risk management measures, oversee their implementation and can be held liable (Art. 20(1) and (2) NIS2). In Germany, Section 38 BSIG obliges the management bodies of essential and important entities to implement, oversee and undergo regular training; liability is governed by company law. A policy for AI coding tools should therefore be approved by management.
Building blocks of a policy for AI coding tools (VamiSec recommendation)
- Permitted tools, models and operating modes; use only via company accounts.
- Data classes: which information may go into which tool.
- Autonomy levels: what an agent may do on its own, what requires approval, what is prohibited.
- Package rules: sourcing only via the internal proxy, cooldown, no install scripts without approval.
- Approval process for MCP servers, skills and rules files, tied to a version or hash.
- Four-eyes principle for merges – including pull requests from agents.
- Logging, exception procedure and recertification of permissions and integrations, for example every six months.
- Training: since the Digital Omnibus (Regulation (EU) 2026/1744, in force since 27 July 2026), Art. 4 AI Act requires providers and deployers to take measures to support AI literacy, but not to guarantee a specific level.
In the threat model, the agent appears as an actor in its own right with permissions; rules files, skills, MCP servers and package sources are trust boundaries. ENISA’s draft on AI-assisted software development (v0.4, September 2026) describes STRIDE threats for this, such as slipping in malicious packages, skills or instruction files.
Incident response playbook: malicious package installed or agent compromised
- 1ContainIsolate
Take affected hosts, containers and runners off the network, terminate running agent sessions, halt pipelines that use the package. Preserve evidence before rebuilding.
- 2ContainRotate credentials
All reachable secrets: registry tokens, Git platform tokens, cloud and Vault access, model API keys. After Shai-Hulud, CISA explicitly advised rotation. Without the token inventory from layers 1 and 2, this step remains incomplete.
- 3Clean upCheck lockfiles and caches
Which repositories, lockfiles, package caches and CI caches contain the affected versions? In the TanStack case, the attack ran through a poisoned GitHub Actions cache – caches are part of the cleanup.
- 4Clean upLook for persistence in the agent configuration
Hooks and MCP entries in user and project configurations, VS Code tasks with runOn: folderOpen, new self-hosted runners and workflows, .pth files. When in doubt, rebuild rather than clean.
- 5ReportCheck reporting obligations
Since 11 September 2026, CRA manufacturers have been reporting actively exploited vulnerabilities in their products via the Single Reporting Platform simultaneously to the coordinating CSIRT and ENISA: early warning within 24 hours, notification within 72 hours, final report no later than 14 days after a corrective measure becomes available. Relevant if malicious code may have made its way into a shipped product (VamiSec assessment; obtain a legal review in each individual case). NIS2 and DORA entities check their own reporting channels in parallel.
- 6LearnFollow up
Document the cause, the stage reached and the missing break points, recertify permissions and integrations, inform registry operators and maintainers.
Link to the attack chain: governance makes stage 07 (Spread) harder because it is clarified in advance who rotates which tokens, who blocks what and who reports to whom. At the same time, it keeps the other layers up to date – without recertification, permissions and integrations creep upward.
Evidence: register of owners
Every production agent with responsible person, purpose, permissions and next review date.
Evidence: approved policy
Management resolution with version and scope, plus training records.
Evidence: recertification
Records of reviews of permissions and integrations, including revoked access.
Evidence: exercised playbook
Tabletop or technical exercise with date, participants and resulting improvements.
Dependency hygiene: what npm, pnpm, Yarn, Bun, pip and uv can do today
Package managers caught up significantly in 2025 and 2026: waiting periods for new versions and blocked install scripts. Much of this, however, is not enabled by default – you have to switch it on.
When sourcing packages, the cooldown – a minimum age for new versions before installation – and blocking install scripts carry most of the load. Pay attention to the units.
| Tool | Cooldown (from version) | Default 10/2026 | Install scripts |
|---|---|---|---|
| npm | min-release-age in days (11.10.0) | none | from v12 (8 July 2026), allowScripts off: dependency scripts only after approval via npm approve-scripts; --allow-git=none and --allow-remote=none set by default |
| pnpm | minimumReleaseAge in minutes (10.16) | 1 day (1440) from pnpm 11 | from v10, no dependency scripts; pnpm 11: strictDepBuilds, approval via allowBuilds |
| Yarn | npmMinimalAgeGate (4.10), now as a duration such as 1d | 1d from 4.15 according to the changelog; docs state 1w | from 4.14, enableScripts: false |
| Bun | minimumReleaseAge in seconds (1.3) | none | only curated default list and trustedDependencies |
| uv | exclude-newer as a relative duration (0.9.17) | none | installation and import code possible – plan for isolation |
| pip | --uploaded-prior-to: date (26.0), duration in days (26.1) | none | installation and import code possible – plan for isolation |
| Renovate | Presets security:minimumReleaseAgeNpm and …Pypi | 3 days if the preset is active | – |
| Dependabot | cooldown in days in dependabot.yml (GA 1 July 2025) | 3 days since 14 July 2026, version updates only | – |
Status: release notes and documentation, checked on 8 October 2026. In Python, code in setup.py can run during installation (Check Point, 2024), and code in .pth files every time the interpreter starts (litellm 1.82.8).
Two limitations come with this. First, a cooldown catches malicious versions, which according to pnpm are usually discovered and removed within an hour – but not a hallucinated name that an attacker claims early and then waits. Second, ignore-scripts is incomplete: Git dependencies can execute code via their own .npmrc (countered by --allow-git=none from npm 11.10.0), URL dependencies such as those in PhantomRaven require --allow-remote=none (from 11.15.0), and no script block covers import code.
Configuration for builds and agents (VamiSec recommendation)
# CI builds and agents: only via the internal proxy (placeholder)
registry=https://registry.intern.example/
# no lifecycle scripts
ignore-scripts=true
# only versions older than 7 days (from npm 11.10.0)
min-release-age=7
CISA recommended both values in its axios alert of 20 April 2026; in its Nx Console alert of 28 May 2026, CISA specified at least three hours. With ignore-scripts, your own pre and post scripts are skipped as well; npm test and other explicitly invoked commands continue to run.
# pyproject.toml: only versions older than 7 days (from uv 0.9.17)
[tool.uv]
exclude-newer = "7 days"
# per-package exceptions: exclude-newer-package
# pip from 26.1: duration in days, plus mandatory hashes
pip install --require-hashes --uploaded-prior-to P7D -r requirements.txt
uv accepts values such as “7 days” or ISO 8601 durations, but not months or years. pip 26.0 only supports points in time; the option only takes effect if the index provides upload times.
Exempt security updates: a cooldown must not delay fixes. Dependabot and Renovate bypass it for security updates by default, and the package managers support exclusion lists (min-release-age-exclude, minimumReleaseAgeExclude, minimumReleaseAgeExcludes, exclude-newer-package). PyPI advises coupling cooldowns with vulnerability scans.
Lockfiles, review, proxy, provenance
In CI and agent environments, install only reproducibly: npm ci, pnpm install --frozen-lockfile, pip with --require-hashes. In the LiteLLM case, according to PyPI, around 40 to 50% of installations during the attack window were unpinned. OWASP describes the case in which an agent regenerates a lockfile from unpinned specifications and pulls in a compromised minor version – every new dependency and lockfile change therefore needs a named approval in the dependency review. Technically, an internal registry proxy with an allowlist enforces this; BSI and ANSSI recommend allowlisting permitted packages. A mere existence check is not enough: the attacker may have registered the name beforehand (Spracklen et al.).
npm audit signatures verifies registry signatures and provenance attestations (from npm 9.5.0); since 14 November 2024, PyPI has supported attestations under PEP 740, which according to Trail of Bits pip and uv do not verify automatically. Both prove origin, not harmlessness: the malicious TanStack and Miasma packages also carried valid provenance or signatures (see chapter 4). As an additional check, this is useful; as the sole approval criterion, it is unsuitable.
Regulatory anchor: ENISA’s legally non-binding recommendation on package managers (10 March 2026) advises using official, verifiable registries, lockfiles and integrity checks in CI/CD. Grundschutz++ includes, as SHOULD requirements, prohibiting external artifacts from unknown sources, testing their integrity and checking them for security updates (DEV.4.2, DEV.4.4, DEV.4.5); the 2023 Compendium requires trusted sources and the review of unknown components (CON.8.A6, CON.8.A20). Art. 21(2)(d) NIS2 and Section 30(2) sentence 2 no. 4 BSIG require supply chain security; from 11 December 2027, CRA manufacturers are subject to the due diligence obligation for third-party components under Art. 13(5) CRA – explicitly including open source.
What the CRA, NIS2, DORA and the AI Act require
Who is responsible when an AI agent installs a malicious package? Primarily the company that integrates or operates the component, not the registry. What of this is mandatory today, what only applies from 11 December 2027 and what is merely guidance.
The CRA, NIS2 and DORA take a similar approach: responsibility lies with whoever integrates the component or operates the system (VamiSec assessment). For the Cyber Resilience Act (CRA), this is illustrated by example 34 of the Commission guidelines C(2026) 5252 of 27 July 2026: an individual developer who publishes a free open-source library in a public package repository, and the repository itself, have no CRA obligations. From 11 December 2027, the due diligence obligation under Art. 13(5) CRA lies with the integrating manufacturer, on a risk basis in accordance with recital 34. The guidelines are non-binding. Whether a human or an agent chose the package makes no difference (VamiSec assessment).
Cyber Resilience Act: reporting obligation since 2026, due diligence from 2027
- Obligation since 11 September 2026 (Art. 14(1)–(2) CRA): report actively exploited vulnerabilities to the CSIRT and ENISA via the Single Reporting Platform (SRP) — early warning within 24 h, notification within 72 h, final report no later than 14 days after a corrective measure becomes available; also applies to existing products.
- Obligation from 11 December 2027: due diligence for third-party components, including free and open-source software (Art. 13(5) CRA), reporting vulnerabilities in components to their manufacturer or maintainer (Art. 13(6)), no shipping with known exploitable vulnerabilities (Annex I Part I(2)(a)).
- SBOM: Annex I Part II(1) requires at least the top-level dependencies; recursive resolution is only required by BSI TR-03183-2 v2.1.0 — good practice, not a CRA obligation. The CRA does not prescribe a format such as CycloneDX or SPDX; the Commission does not list an implementing act on this (Art. 13(24), an optional provision) (as of 27 July 2026).
- Fines (Art. 64(2) CRA): for infringements of Annex I, Art. 13 or Art. 14, up to EUR 15 million or 2.5% of worldwide annual turnover, whichever is higher.
NIS2 and BSIG: supply chain and development as minimum measures
NIS2 requires supply chain security (Art. 21(2)(d)) as well as security in acquisition, development and maintenance (point (e)). Art. 21(3), under which entities must also take into account the secure development procedures of their direct suppliers when choosing supply chain measures, is not reproduced verbatim in the BSIG; it can be applied via interpretation in conformity with the directive. In Germany, Section 30(2) sentence 2 nos. 4 and 5 of the BSIG (German BSI Act) has applied since 6 December 2025; the management body implements, oversees and is liable for culpable breaches of duty under company law (Section 38 BSIG, Art. 20 NIS2). For missing or undocumented measures, Section 65 BSIG provides for fines of up to EUR 10 million (essential entities) or EUR 7 million (important entities), and for entities with total turnover above EUR 500 million, up to 2% or 1.4% of total turnover. Implementing Regulation (EU) 2024/2690 is binding only for the types of entities listed in Art. 1, such as cloud, data center and managed service providers; for all others, it serves as guidance.
DORA: the precise anchors are in the RTS
Since 17 January 2025, DORA has required that changes to ICT systems be recorded, tested, assessed, approved, implemented and verified (Art. 9(4)(e) DORA), and it leaves financial entities fully responsible for ICT services (Art. 28(1) DORA). For freely sourced libraries, RTS 2024/1774 is more precise (full framework, Title II): track libraries used for critical or important functions (Art. 10(2)(d)), code reviews with static and dynamic testing (Art. 16(3)), test software packages no later than integration (Art. 16(4)), protect source code integrity (Art. 16(7)), review open-source code before production use where feasible (Art. 16(8)), separate the approval and implementation of changes (Art. 17(1)). An agent that merges its own pull requests does not fit with this (VamiSec assessment).
AI Act and product liability
Under the AI Act, a coding assistant is typically not a high-risk system, because software development is not listed in Annex III. For deploying companies, Art. 4 remains: since the Digital Omnibus (Regulation (EU) 2026/1744, in force since 27 July 2026), they must take measures to support AI literacy without guaranteeing a specific level. GPAI obligations apply to the model providers, not to the users. Under the Product Liability Directive (EU) 2024/2853, software is a product; for products placed on the market after 9 December 2026, the manufacturer is liable to natural persons also for defective components integrated under its control, and missing security updates do not exonerate it. The directive takes effect via national law; as of 8 October 2026, the German government draft (Bundestag printed paper 21/4297) has not been verified as promulgated.
| Framework | Reference | What it means for AI-selected dependencies | Applies from |
|---|---|---|---|
| CRA · obligation | Art. 14(1)–(2) | Report actively exploited vulnerabilities via the SRP on time | 11 September 2026 |
| CRA · obligation | Art. 13(5); Annex I Part II(1) | Risk-based due diligence for every integrated third-party component; SBOM at least top-level | 11 December 2027 |
| NIS2 / BSIG · obligation | Art. 21(2)(d), (e); Section 30(2) sentence 2 nos. 4, 5 BSIG | Supply chain and development as documented minimum measures | 6 December 2025 |
| Implementing Regulation 2024/2690 · obligation for listed entities | Annex, points 5.1.2(a), 6.1.2(c), 6.2, 6.6.1(c), 6.9 | Secure development environment, integrity checks, protection against malware | in force since 2024 |
| DORA · obligation | Art. 9(4)(e), Art. 28(1); RTS 2024/1774 Art. 10(2)(d), Art. 16, Art. 17(1) (Title II) | New dependency as a tested change with separate approval | 17 January 2025 |
| AI Act · obligation | Art. 4 as amended by Regulation (EU) 2026/1744 | Promote AI literacy, without a guaranteed level | 2 February 2025; amended version since 27 July 2026 |
| Product liability · after transposition | Directive (EU) 2024/2853 Art. 8(1), Art. 11(2) | Liability to natural persons, including for integrated components | Products after 9 December 2026 |
Column 3: VamiSec assessment. Only the legal texts are binding; Commission guidelines and ENISA and BSI documents are non-binding. Status: 8 October 2026.
Guidance: non-binding orientation
- ENISA, Secure Use of Package Managers (10 March 2026): explicitly names slopsquatting and recommends making AI-selected packages visible and checking them automatically in CI/CD.
- ENISA, AI-assisted software development (draft v0.4, September 2026): hallucinated packages, planted skills and instruction files — not yet final.
- BSI and ANSSI, AI Coding Assistants (4 October 2024): package hallucinations as a path to “package confusion”; plausibility checks, allowlisting, sandboxing.
- BSI Grundschutz++ DEV.4.2 to DEV.4.5 (SHOULD requirements): prohibit artifacts from unreliable or unknown sources, including packages and models; SBOM, integrity tests. 2023 Compendium: CON.8.A6, CON.8.A20.
The 90-day plan and the metrics
Three phases of 30 days each: first gain visibility, then put break points in place, then enforce and measure. Plus ten metrics with target values as a VamiSec recommendation, and evidence you can present to auditors.
The plan is a VamiSec recommendation and follows the attack chain: first you create visibility and close obvious gaps, then you put break points in place at stages 04 Resolution and 05 Execution, and finally you make the rules binding and measurable. The starting point is an honest stocktake, for example with the self-assessment on this page. Regulated companies start with what already applies: CRA reporting obligations since 11 September 2026, BSIG measures since 6 December 2025, DORA since 17 January 2025.
| Phase | Measures | Owner | Outcome |
|---|---|---|---|
| Days 1–30: visibility & immediate measures | Inventory of all AI coding tools, agents, MCP servers and skills with their permissions; switch off auto-approve modes centrally; disable install scripts in CI and agent environments (npm: ignore-scripts, --allow-git=none, --allow-remote=none); set a cooldown in package managers and update bots; record and rotate long-lived tokens | CISO with AppSec lead; platform team | Inventory with owners, baseline values for the metrics, versioned immediate configuration |
| Days 31–60: put break points in place | Registry proxy with allowlist, direct registry access from builds and agents blocked; installation only from the lockfile; dependency review with named approval of new packages; agents in isolated environments with an egress allowlist; MCP servers and skills only when approved and pinned; publishing via trusted publishing | Platform and DevOps team; AppSec lead | Break points at Resolution and Execution, reference architecture for the agent sandbox |
| Days 61–90: enforce & measure | Adopt a policy for AI coding tools; checks as mandatory status checks in branch protection; log agent actions centrally; red teaming with prompt injection and prepared rules files; incident exercise with token rotation and the CRA reporting channel; first KPI report | Head of Engineering with CISO; management body approves | Approved policy, exercise record, KPI report to the management body |
Phases, owners and sequence are a VamiSec recommendation. npm: --allow-git from 11.10.0, --allow-remote from 11.15.0; in npm v12 (8 July 2026), both default to none, and dependency install scripts only run after approval.
Ten metrics with target values
Measure what actually breaks the chain, not the number of training sessions. The target values are VamiSec recommendations, not regulatory thresholds; most can be collected automatically from proxy logs, CI configuration and central agent configuration. s1ngularity shows how risky modes without confirmation are: according to Wiz, the malware invoked locally installed AI CLIs with flags such as --dangerously-skip-permissions and --yolo to inventory secrets. Report quarterly to the management body; in NIS2 entities, it must oversee the implementation of the measures under Section 38 BSIG anyway.
| Metric | Measurement source | Target value (VamiSec recommendation) |
|---|---|---|
| Share of builds that source packages only via the registry proxy | Proxy and firewall logs | Day 90: ≥ 95%, thereafter 100% |
| Share of repositories with an active cooldown | Scan of package manager and update bot configuration | ≥ 90%, minimum age ≥ 3 days, security updates exempted |
| Share of CI jobs that install only from the lockfile | CI configuration (npm ci, --frozen-lockfile, --require-hashes) | 100% |
| Share of builds and agent environments in which install scripts run only after approval | Package manager configuration, allowlist | 100% |
| Share of new dependencies with documented approval | Pull request history, dependency review | 100% |
| Agents with auto-approve or YOLO mode | Central agent configuration, endpoint scan | 0 |
| Share of agents in an isolated environment with an egress allowlist | Inventory, network policies | 100% in CI, ≥ 80% on workstations |
| Share of pinned, approved agent extensions (MCP servers, skills, plugins) | AI-BOM, allowlist | 100% |
| Median time to rotation of affected tokens after a compromise report | Incident tickets, secrets manager | ≤ 24 h |
| Long-lived publish and CI tokens | Token inventory for npm, PyPI and CI | 0, publishing only via trusted publishing |
On minimum age: after the axios incident, CISA recommended min-release-age=7 (days), after the Nx Console incident at least three hours; since 14 July 2026, Dependabot waits 3 days by default for version updates, pnpm 11 one day by default — recommendations and defaults are not harmonized. Trusted publishing replaces long-lived tokens but does not prove benign code (TanStack and Miasma 2026).
Evidence for auditors
- Inventory of AI coding tools, agents, MCP servers and skills with owner, version and permissions (AI-BOM)
- Policy for AI coding tools, approved by the management body (Art. 20(1) NIS2; implementation and oversight under Section 38 BSIG)
- Versioned configuration of proxy, package managers, update bots and egress rules — Section 30(1) BSIG requires documenting compliance with the measures
- Approval records for new dependencies and agent extensions from the pull request history, with human approval of agent changes (for DORA financial entities: segregation of duties under Art. 17(1) RTS 2024/1774)
- SBOM per release: at least top-level dependencies (Annex I Part II(1) CRA, from 11 December 2027), preferably recursive in accordance with BSI TR-03183-2 v2.1.0
- Test evidence for software packages no later than the integration phase (Art. 16(4) RTS 2024/1774) and red teaming report on the agents
- Incident playbook with token rotation list and reporting channels under Art. 14 CRA (24 h / 72 h / 14 days), including exercise record
- Quarterly KPI report to the management body
Self-assessment · approx. 10 minutes
Coding Agent & Supply Chain Readiness Check
29 questions in six dimensions: the five layers for coding agents plus dependency hygiene. Your profile determines the target level and the relevant frameworks. The result shows at which stage your controls interrupt the attack chain, your biggest gaps with a roadmap, and the evidence auditors expect.
0 / 29 questions answered
Your result
Not all questions answered yet — the evaluation is provisional.
Attack chain coverage
- 01Invention
- 02Registration
- 03Adoption
- 04Resolution
- 05Execution
- 06Access
- 07Spread
None of your answers reaches the “defined & implemented” level at a break point — today, an invented package name runs all the way through to spread.
Controls at level 2 or higher that interrupt a chain stage are counted: dependency review or mandatory approval (Adoption), proxy with an allowlist (Resolution), disabled install scripts (Execution), agent sandbox (Access) and egress control (Spread).
Your five biggest gaps
Not all questions answered yet — the evaluation is provisional.
You will receive the CISO whitepaper with a roadmap, templates and an audit catalog. The result is only sent along if you explicitly tick the box in the form.
The evaluation runs entirely in your browser. Nothing is stored or transmitted unless you send it yourself via the form.
Free whitepaper
Slopsquatting & coding agents for CISOs — securing the AI software supply chain
The whitepaper (in German) translates the situation around typosquatting and slopsquatting and the five-layer model for coding agents into a program for CISOs, AppSec and platform teams: from the situation report through harness controls and the configuration baseline to obligations, roadmap and audit catalog.

48 pagesPDF, free of chargeGermanAs of 10/2026
- Management summary, board page and ten key takeaways — obligation, practice and recommendation clearly separated
- Attack chain in seven stages, harness map with documented cases and CVEs, five layers with evidence
- Configuration baseline for npm, pnpm, Yarn, Bun, pip and uv, plus an obligations matrix for the CRA, NIS2/BSIG, DORA and the AI Act
- 90-day plan, KPI set, RACI, policy template for coding agents, AGENTS.md security module and 30 audit questions
What the whitepaper “Slopsquatting & coding agents for CISOs” contains
Situation report and attack chain
Management summary with ten key takeaways, an honest assessment of the research on package hallucinations, case files from crossenv to Mini Shai-Hulud, and the attack chain in seven stages with all break points.
Five layers for the harness
Visibility, control, validation, monitoring and governance, each with control objectives, implementation steps, evidence and references to the OWASP Agentic Top 10, the LLM Top 10 and the documented CVEs.
Configuration baseline
Cooldown, install scripts, lockfile and proxy for npm, pnpm, Yarn, Bun, pip and uv — with default values as of October 2026 and configuration examples ready to adopt.
Obligations, plan and templates
Obligations matrix for the CRA, NIS2/BSIG, DORA, the AI Act and product liability, 90-day plan, KPI set, RACI, policy template for coding agents, security module for AGENTS.md and 30 audit questions for internal audit and external audits.
Further reading
Control at runtime: how the Agent Control Standard checks tool calls before they run
Monitoring outside the model is the core of the fourth layer — and that is exactly where the OWASP Agent Control Standard comes in: a guardian agent is presented with every step of an agent via hooks before it is executed, and decides with one of five dispositions. This turns an allowlist for packages into a rule that even an agent cannot bypass. Our ACS deep dive explains hooks, dispositions and failure posture; the HiddenLayer framework leads to the primary source of the five layers.
19 hooks16 lifecycle hooks and 3 skill hooks in the ACS
5 dispositionsallow, deny, modify, ask, defer
5 layersVisibility to governance, according to HiddenLayer
- An agent’s package installations can be intercepted as tool calls and checked against the allowlist.
- If the guardian’s decision is missing, the failure posture determines whether the agent is blocked or continues.
- Every decision is logged — evidence for auditors and a basis for monitoring.
The Agent Control Standard is an early-stage OWASP project (specification v0.1.0, release 0.1.2); the reference implementation is a proof of concept.
Glossary
Terms related to slopsquatting and coding agents
24 terms from agent harness to typosquatting, explained briefly and close to the sources.
terms found
- Slopsquatting
- Registering a package name that AI models invent in order to capture installations by developers or coding agents. The term is attributed to Seth Larson (Python Software Foundation) and was popularized by Andrew Nesbitt in April 2025.
- Typosquatting
- Registering package names that differ from popular packages only by typos or confusable characters, such as reqjuests or tensoflom from a PyPI campaign with more than 500 packages (Check Point 2024).
- Combosquatting
- A technique related to typosquatting: a well-known name is combined, without typos, with additions such as ‘setup’, ‘helper’ or ‘utils’ so that the package looks like an official add-on tool. Names such as opensearch-setup or elastic-opensearch-helper from the case described by Microsoft in May 2026 follow this pattern; Microsoft itself speaks of typosquatting.
- Package hallucinationhallucinated package
- A language model suggests a dependency that does not exist in the registry. In Spracklen et al., this affected 19.7% of 2.23 million package references; OWASP lists the risk under LLM09 Misinformation.
- Package confusion
- Umbrella term for attacks that trick users into installing the wrong package, for example via similar names as in typosquatting. Following Spracklen et al., BSI and ANSSI (2024) describe how package hallucinations can lead to such attacks if attackers register packages under hallucinated names. This variant is now usually called slopsquatting.
- Dependency confusion
- Instead of an internal package, a package manager downloads a public package of the same name that an attacker has published. Countermeasures are fixed registry mappings for internal namespaces and a registry proxy.
- Agent harnessHarness
- The execution layer around the model: system prompt, rules files, tools, skills, MCP servers and orchestration logic. According to HiddenLayer, it is the actual attack surface of coding agents.
- Coding agentAI coding agent
- An AI tool that not only suggests code but autonomously modifies files, runs terminal commands, installs packages and creates pull requests, such as Claude Code, Cursor or GitHub Copilot in agent mode.
- MCP serverModel Context Protocol
- A service that provides an agent with tools and data sources via the Model Context Protocol. Every MCP server is a supply chain component: according to Koi Security (reported by The Register), from version 1.0.16 the unofficial npm package postmark-mcp added an attacker’s address as a blind copy to every outgoing email.
- Tool poisoning
- Hidden instructions in the description of an MCP tool that users do not see but the model follows. In 2025, Invariant Labs showed how a harmless-looking tool made the agent read out and pass on SSH keys and configuration files.
- Rug pull
- An already approved MCP server or approved configuration changes after the fact, for example the tool description or the command launched. Countermeasure: pin versions and require new approval for every change, as implemented in Cursor after CVE-2025-54136 (MCPoison).
- Agent skillSkill
- A package of instructions and, where applicable, scripts that adds a capability to an agent and is obtained from marketplaces or repositories. In 2026, Snyk found at least one critical issue in 534 of 3,984 skills examined (13.4%).
- Rules File Backdoor
- A technique described by Pillar Security in 2025 in which invisible Unicode characters hide instructions in Cursor or GitHub Copilot rules files. Humans do not see them during review; the model follows them.
- Prompt injectionLLM01
- Injected instructions that a model treats as commands rather than data. With coding agents, often indirect: via README files, issues, tool outputs or web pages that the agent reads.
- Lifecycle scriptpreinstall, install, postinstall
- A script in package.json that npm runs automatically during installation. Many malicious npm packages use it, such as Shai-Hulud 2.0 with a preinstall hook; by default, npm v12 runs such dependency scripts only after approval.
- Lockfile
- A file that records the exact resolved versions and checksums of all dependencies, such as package-lock.json, pnpm-lock.yaml or pylock.toml. If CI installs only from it, no new package name gets into the build without a visible change to the lockfile.
- Dependency cooldownminimum release age, release age gate
- Minimum age of a package version before it is installed or proposed as an update. Catches freshly published malicious versions, but not names that an attacker registered early.
- Registry proxyinternal artifact repository
- An internal cache between developers, builds and public registries that mirrors packages and, when operated with an allowlist, serves only approved packages. From VamiSec’s perspective, a central break point against slopsquatting, because a made-up name is not on the allowlist.
- Trusted publishingOIDC publishing
- Publishing packages from CI via short-lived OIDC identities instead of long-lived API tokens, available on PyPI (since 2023) and npm (since July 2025), among others. It replaces long-lived tokens that could be stolen, but does not protect against a compromised pipeline, as in the TanStack case in May 2026.
- Provenanceproof of origin, attestation
- Signed attestation of which repository and which build a package comes from. It proves origin, not harmlessness: in the TanStack and Miasma cases in 2026, malicious packages carried valid provenance.
- SBOMSoftware Bill of Materials
- Machine-readable list of all components of a piece of software, for example in CycloneDX or SPDX. From 11 December 2027, the CRA requires at least the top-level dependencies without prescribing a format; BSI TR-03183-2 requires recursive resolution.
- AI-BOMAIBOM
- Bill of materials for AI components: models, agents, MCP servers, skills, plugins and prompts with origin and version. Under ASI04, OWASP names SBOM and AIBOM as countermeasures against supply chain risks of agentic systems.
- Least agency
- Principle from the OWASP Top 10 for Agentic Applications 2026: give agents only as much autonomy as the task requires. It extends least privilege with the question of what an agent may decide on its own.
- Egress controlegress filtering
- Restricting outbound network traffic to approved destinations according to the deny-by-default principle. For agents and builds, it makes it harder for malicious code to exfiltrate data to third-party destinations or to download packages bypassing the allowlist; channels via approved destinations such as GitHub remain possible.
FAQ
Frequently asked questions on slopsquatting and coding agents
Short, reliable answers with sources — as of 8 October 2026.
Slopsquatting is a supply chain attack in which an attacker registers a package name that AI models invent, so that developers or coding agents install the malicious package. The name is attributed to Seth Larson of the Python Software Foundation and was popularized by Andrew Nesbitt on 8 April 2025, roughly as the AI variant of typosquatting. The basis is the study by Spracklen et al. (USENIX Security 2025): of 2.23 million package references in 576,000 code samples from 16 models, 19.7% were hallucinated. Important for context: no publicly documented case is known to date in which an attacker maliciously registered a demonstrably hallucinated name and victims installed it because of an AI suggestion.
Typosquatting relies on human typos and confusion with well-known names; slopsquatting relies on names that an AI model invents. In 2024, Check Point documented more than 500 malicious PyPI packages with names such as reqjuests or tensoflom; on 28 May 2026, Microsoft described 14 npm packages that appeared within four hours. Both are typosquatting, not slopsquatting. Hallucinated names, by contrast, are often not typos: in Spracklen et al., only 13.4% of the made-up Python names were at most two edits away from a real package, and 48.6% were six or more. Detection based on name similarity therefore falls short. Many countermeasures work against both attacks: a registry proxy with an allowlist, a cooldown, lockfiles and disabled install scripts.
Depending on the model and the study, for anywhere from a few percent to more than a fifth of suggested packages. Spracklen et al. (USENIX Security 2025) measured 19.7% hallucinated package references overall, an average of 5.2% for the three commercial OpenAI models tested and 21.7% for open-source models. Many errors are reproducible: in repeat tests, 43% of the made-up names reappeared in all ten runs, and 39% never did. A non-peer-reviewed preprint by Churilov (2026) arrives at 4.62 to 6.10% for five current models. A quick test on dev.to from 6 October 2026 with 30 npm prompts found two made-up names for Claude Haiku 4.5, one for Copilot and three for ChatGPT/Codex — according to the author, a signal, not a verdict.
No publicly documented malicious case is known to date (as of 8 October 2026). What is documented, however, is that made-up names do get installed: for an experiment published in 2024, Bar Lanyado uploaded an empty package to PyPI under the repeatedly hallucinated name huggingface-cli; according to Lasso Security, it received more than 30,000 downloads in three months. In 2026, Aikido found the call npx react-codeshift in AI-generated agent skills, which referred to a never-published npm package and had spread to at least 237 repositories, and registered the name defensively. Both packages were harmless placeholders. Koi Security attributed campaigns such as PhantomRaven to slopsquatting without publishing evidence that an AI had suggested the names. The risk is real; a damaging incident has not yet been publicly documented.
With several controls, the core of which, from VamiSec’s perspective, is an internal registry proxy with an allowlist: a made-up or mistyped name is not on the list and cannot be installed. Add a minimum age for new versions (npm min-release-age in days from version 11.10.0, pnpm minimumReleaseAge in minutes, uv exclude-newer, pip --uploaded-prior-to), installations only from the lockfile, disabled install scripts and a dependency review in the pull request. Since 8 July 2026, npm v12 runs dependency install scripts only after approval by default. For your own packages: publish via trusted publishing instead of tokens; npm write tokens expire after 7 days by default and after 90 days at most. Provenance proves the origin of a package, not its harmlessness.
The harness is everything that makes up a coding agent around the language model: system prompt, rules files, tools, skills, MCP servers and the orchestration logic that coordinates model calls, tool calls and workflows. In its framework of 28 July 2026, HiddenLayer argues that this harness, not the model, is the actual attack surface; the cause of the attacks, it says, is misplaced trust. Documented cases support this: hidden instructions in rules files (Rules File Backdoor, Pillar Security 2025), manipulated MCP server tool descriptions (Invariant Labs 2025) or a prompt injection that switched off the confirmation prompt in GitHub Copilot (CVE-2025-53773, CVSS 3.1: 7.8).
The five layers come from HiddenLayer’s framework (28 July 2026): Visibility, Control, Validation, Monitoring and Governance. Visibility means knowing every agent, model, tool, MCP server and skill along with their permissions, including shadow AI. Control limits the damage: least privilege, human approval for consequential actions, only approved tools, restricted outbound network traffic. Validation verifies before trusting: red teaming, vetting third-party tools including hidden metadata, approving specific versions instead of “latest”. Monitoring takes place outside the model. Governance anchors owners, threat models and incident response. In the self-assessment, VamiSec adds dependency hygiene as a sixth dimension.
No. ignore-scripts prevents npm from running packages’ lifecycle scripts during installation, thereby closing a common execution path, such as the install hooks in the case described by Microsoft on 28 May 2026. Three gaps remain: Git dependencies can bring their own .npmrc that overrides the path to the Git program and executes code despite ignore-scripts (countermeasure: --allow-git=none from npm 11.10.0); URL dependencies download code from arbitrary servers (--allow-remote=none from npm 11.15.0); and malicious code that only runs on import or at interpreter startup is not a lifecycle script, such as the .pth file in litellm 1.82.8. Therefore, combine the option with a registry proxy, a cooldown and isolated build and agent environments.
From 11 December 2027, the CRA requires manufacturers to exercise due diligence when integrating third-party components, explicitly including free and open-source software (Art. 13(5) CRA). The scope depends on the risk; recital 34 mentions, for example, checking the update history, cross-checking against the European vulnerability database and additional security testing. According to the non-binding Commission guidelines C(2026) 5252 (example 34), the package repository and an individual developer who publishes free software there have no CRA obligations; due diligence lies with the integrating manufacturer. In addition, there is an SBOM covering at least the top-level dependencies (Annex I Part II(1)) and the reporting of vulnerabilities found to the component’s manufacturer or maintainer (Art. 13(6)). The reporting obligations under Art. 14 CRA have already applied since 11 September 2026.
As a rule, no. High-risk systems under Art. 6(2) AI Act are only the areas of use listed in Annex III, and software development is not one of them. The situation may be different if a tool were used, for example, to evaluate employee performance (Annex III(4)(b)). In any case, the high-risk obligations for Annex III only apply from 2 December 2027. For companies that deploy coding assistants, Art. 4 is what mainly remains: since the Digital Omnibus (Regulation (EU) 2026/1744, in force since 27 July 2026), they must take measures to support AI literacy without guaranteeing a specific level. The obligations for general-purpose models apply to the model providers, not to the users.
A dependency cooldown is a minimum age that a new package version must have reached before it is installed or proposed as an update. The idea: malicious versions are often discovered and removed quickly; pnpm justifies the feature by noting that this usually happens within an hour. The units differ: npm min-release-age in days, pnpm minimumReleaseAge in minutes (default 1,440, i.e. one day, since pnpm 11), Bun in seconds, Yarn npmMinimalAgeGate as a duration such as 1d, uv exclude-newer as a duration, pip --uploaded-prior-to as a date or, from version 26.1, as P3D. Since 14 July 2026, Dependabot waits three days by default for version updates, with security updates exempted. Limitation: names registered early pass any cooldown.
You measure maturity with a self-assessment along the five layers plus dependency hygiene and with a few hard metrics. The VamiSec Readiness Check on this page assesses 29 questions across six dimensions on four levels, from “not in place” to “enforced and measured”, and shows at which stage of the attack chain your controls take effect. As metrics, we recommend, among others, the share of builds via the registry proxy, the share of repositories with a cooldown, the number of agents with auto-approve (target: zero), the median time to token rotation and the share of pinned agent extensions. Report the values quarterly to the management body.
Standards & Sources
The content on this page is based on the following publicly available guides and studies.
ThreatLocker · 2026
How to mitigate typosquatting and slopsquatting attacks in npm and PyPI ↗
Source article: countermeasures for npm and PyPI, 15 September 2026; vendor blog.
Harsh, DEV Community · 2026
I Tested 3 AI Coding Tools for Slopsquatting. Here’s How Many Fake Packages They Invented. ↗
Source article: quick test with 30 npm prompts, 6 October 2026; anecdotal and characterized by the author as a signal.
HiddenLayer · 2026
A Security Framework for Coding Agents and their Harnesses ↗
Source article: five layers Visibility, Control, Validation, Monitoring and Governance (28 July 2026).
Spracklen et al., USENIX Security · 2025
We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs ↗
Primary study: 19.7% (440,445 of 2.23 million) of package references from 576,000 code samples from 16 models were hallucinated.
Lasso Security · 2024
Diving Deeper into AI Package Hallucinations ↗
Bar Lanyado’s experiment with the placeholder huggingface-cli and more than 30,000 downloads in three months.
Aikido Security · 2026
Agent Skills Are Spreading Hallucinated npx Commands ↗
react-codeshift: hallucinated npx command in AI-generated agent skills, registered defensively.
Churilov, arXiv · 2026
The Range Shrinks, the Threat Remains: Re-evaluating LLM Package Hallucinations on the 2026 Frontier-Model Cohort ↗
Non-peer-reviewed preprint: hallucination rates of five current models and shared names.
Microsoft Security · 2026
Typosquatted npm packages used to steal cloud and CI/CD secrets ↗
14 typosquatting npm packages within four hours on 28 May 2026; typosquatting, not slopsquatting.
Check Point · 2024
PyPI Inundated by Malicious Typosquatting Campaign ↗
More than 500 malicious PyPI packages in March 2024; classic typosquatting with no AI connection.
Wiz · 2025
s1ngularity: supply chain attack leaks secrets on GitHub: everything you need to know ↗
Malware abused locally installed AI CLIs with flags that bypass confirmations.
GitHub Changelog · 2025
Strengthening npm security: Important changes to authentication and token management ↗
Newly created granular npm write tokens: default lifetime 7 days, maximum 90 days.
GitHub Changelog · 2026
npm install-time security and GAT bypass2fa deprecation ↗
npm v12 (8 July 2026): dependency install scripts only after approval, Git and URL dependencies blocked by default.
pnpm · 2026
pnpm 11.0 ↗
New defaults: minimumReleaseAge 1,440 minutes (one day), no Git or tarball subdependencies, build scripts only after approval (allowBuilds).
Pillar Security · 2025
New Vulnerability in GitHub Copilot and Cursor: How Hackers Can Weaponize Code Agents ↗
Rules File Backdoor: invisible Unicode instructions in rules files.
Invariant Labs · 2025
MCP Security Notification: Tool Poisoning Attacks ↗
Definition of tool poisoning, rug pull and tool shadowing in MCP servers.
OWASP GenAI Security Project · 2025
OWASP Top 10 for Agentic Applications for 2026 ↗
ASI04 Agentic Supply Chain Vulnerabilities, ASI05 Unexpected Code Execution and the principle of least agency.
OWASP GenAI Security Project · 2024
LLM09:2025 Misinformation ↗
Lists nonexistent libraries suggested by models as a risk of unsafe code generation.
OpenSSF · 2025
Security-Focused Guide for AI Code Assistant Instructions ↗
Guide for secure agent instructions; names hallucinated dependencies and slopsquatting.
BSI and ANSSI · 2024
AI Coding Assistants ↗
Government agency paper of 4 October 2024: package hallucinations as a gateway for package confusion, countermeasures.
ENISA · 2026
ENISA Technical Advisory for Secure Use of Package Managers ↗
Non-binding recommendation of 10 March 2026 that explicitly names slopsquatting as an attack vector.
European Union · 2024
Regulation (EU) 2024/2847 (Cyber Resilience Act) ↗
Due diligence obligation for third-party components (Art. 13(5), from 11 December 2027), reporting obligations (Art. 14, since 11 September 2026), SBOM (Annex I Part II(1)).
European Commission · 2026
Guidelines on the implementation of the Cyber Resilience Act, C(2026) 5252 final ↗
Non-binding guidelines of 27 July 2026; example 34 assigns the due diligence obligation to the integrating manufacturer.
gesetze-im-internet.de · 2025
BSI Act (BSIG) as amended by the NIS2UmsuCG, Section 30 ↗
Risk management measures including the supply chain (para. 2 sentence 2 no. 4) and acquisition, development and maintenance (no. 5); new BSIG in force since 6 December 2025 (BGBl. 2025 I No. 301).
European Union · 2024
Delegated Regulation (EU) 2024/1774 (RTS on ICT risk management) ↗
Specifies DORA for the full framework (Title II): tracking of open-source libraries, testing of software packages, change management.
Rolling out coding agents without opening up your supply chain?
VamiSec supports you with the inventory and policy for AI coding tools, with registry proxy, cooldown and install script hardening, with agent sandboxing and monitoring, and with red teaming of coding agents — aligned with the CRA, NIS2 and DORA.