Your AI coding assistant just installed a package that doesn't exist. Or rather, it didn't exist until an attacker predicted it would hallucinate that exact name and registered it first.
This isn't theoretical. Researchers demonstrated that AI coding agents across Cursor, Windsurf, GitHub Copilot, Cline, Gemini CLI, and OpenClaw all hallucinated consistent package names, names attackers could predict and weaponize.
What Happened
Security researchers discovered a new supply chain attack vector targeting AI coding agents. The attack, documented in a July 8, 2026 paper by researchers at Tel Aviv University, Technion, and Intuit, exploits a fundamental weakness: AI agents generate and fetch dependencies without verifying they're legitimate.
The attack works like this: An AI agent hallucinates a package name while generating code. An attacker who has predicted this hallucination registers a malicious package under that name. When the agent attempts to install dependencies, it fetches and executes the attacker's code, no human review, no approval gate.
Trail of Bits tested this vulnerability against commercial agent skill store scanners and bypassed them in under an hour.
Timeline
The attack pattern emerged from earlier supply chain techniques but targets autonomous agents specifically:
Pre-2026: Typosquatting and dependency confusion attacks required manual developer mistakes, a typo, a misconfigured registry, a copied command from an untrusted source.
July 2026: The research team published proof that hallucinated package names are predictable across different underlying models. The same fake identifiers appear whether you're using Cursor, Copilot, or Gemini CLI.
Post-publication: Attackers can now pre-register predicted package names and wait for AI agents to fetch them autonomously. No social engineering required.
Which Controls Failed
Pre-fetch verification: None of the tested platforms verified whether a generated package identifier corresponded to a real, vetted dependency before attempting installation. The agents trusted their own output implicitly.
Dependency allowlisting: Organizations running these agents hadn't restricted package sources to approved catalogs. Any hallucinated name could trigger a fetch from public registries.
Human approval gates: The agents operated with sufficient privilege to install packages without human confirmation. Autonomous execution, the feature that makes them useful, became the vulnerability.
Scanner effectiveness: Current security scanners analyze code after it's written or packages after they're published. Trail of Bits demonstrated these tools can't catch malicious packages designed to exploit agent behavior patterns. The scanners look for known malware signatures, not for packages that shouldn't exist in the first place.
What Standards Require
ISO/IEC 27001:2022 Control 8.30 (Outsourced development) requires organizations to establish security requirements for code produced by external sources. An AI agent generating and fetching code is functionally an outsourced developer. You need the same verification controls.
NIST 800-53 Rev 5 SA-10 (Developer Configuration Management) mandates configuration control of security-relevant information system components. Dependencies are configuration. If your agent can modify your dependency tree without approval, you're non-compliant.
PCI DSS v4.0.1 Requirement 6.3.2 requires maintaining an inventory of software components and their security status. When an AI agent autonomously adds a dependency, does it update your SBOM? Does it check the new component against your approved list? If not, you can't demonstrate compliance.
OWASP ASVS v4.0.3 V14.2 (Dependency) requires verification that all components come from trusted sources. An AI hallucination is not a trusted source. The standard explicitly requires cryptographic verification of component integrity, something impossible when the component didn't exist until an attacker created it.
Lessons and Action Items
Implement pre-fetch verification now. Before any AI agent installs a dependency, verify the identifier against an approved catalog. If the package name doesn't exist in your vetted sources, block the fetch and flag it for human review. This isn't optional, it's the control that would have stopped every instance researchers tested.
Restrict agent package sources. Configure your AI coding tools to pull dependencies only from internal mirrors or curated catalogs. ActiveState's Curated Catalog is one option; you can also maintain your own approved package list. The key is making hallucinated names unfetchable because they don't exist in your allowed registries.
Separate generation from execution. Your agent can suggest code and dependencies. It shouldn't install them autonomously. Add a review step where a human or automated policy engine approves the proposed changes before they touch your environment. This breaks the attack chain, attackers can't trigger code execution without getting past your approval gate.
Update your SBOM process. If you're generating a Software Bill of Materials for compliance, your process needs to account for AI-suggested dependencies. Every component an agent adds must flow through the same inventory and vulnerability tracking as manually added dependencies. This means your SBOM tooling needs hooks into agent workflows.
Test your scanners against agent-specific attacks. Don't assume your existing security scanners will catch these. Trail of Bits bypassed commercial tools in under an hour. Run your own tests: have your agents generate code in a sandboxed environment and see if your scanners flag hallucinated dependencies before they're fetched.
Document agent privilege boundaries. For ISO 27001 and SOC 2 Type II compliance, you need documented access controls. What can your AI agents do without approval? What requires human authorization? Where do they write code? Which registries can they access? Auditors will ask these questions. Have answers.
The predictability of hallucinated names makes this attack scalable. An attacker doesn't need to compromise your specific agent, they can predict what thousands of agents will hallucinate and pre-register those packages. Your defense can't rely on the attacker not knowing what your agent will do. It has to rely on verification before fetch, every time.



