When AI Agents Install Dependencies

AI Agent Supply Chain Security: What Stops a Bad Dependency When AI Agents Install It

AI agent supply chain security used to be simple, mostly because a human always stood between a package name and the build. For twenty years, that was the whole model: someone read the name before it went in. Not always carefully. But someone read it.

That’s gone now. Ask an AI model for a library today, and roughly one in five recommended packages don’t exist. Attackers know this, so they register those names first. An agent installs them, tests them, and moves on, and nobody reads anything in between. This is exactly where AI agent supply chain security is failing right now: not in some future scenario, but in the pipelines running today.

The industry spent two decades building controls around a developer who reads, reviews, and decides. That developer is no longer the last checkpoint before a dependency enters the build. So the real question isn’t whether agentic AI introduces new risk, it’s what’s actually left standing once the human checkpoint is gone.

From “AI Suggests” to “AI Acts”

Two years ago, a copilot proposed a code block, the developer read it, and the developer decided whether to keep it. That workflow is largely gone. Agentic tools now install dependencies, spin up containers, and trigger pipeline steps on their own, often reporting back only after the fact, and only if something goes wrong.

The shift happened in stages, and most teams are further along it than their written security policy admits. Early agentic tools asked for approval before every change, and developers clicked “yes” so often that the confirmation step stopped meaning anything. Today’s agents mostly don’t ask at all. They only interrupt for actions flagged as sensitive, like running a shell script, and a typical pull request generated by an agent can run into thousands of lines that no human actually reads end to end before merging.

The permissions problem compounds this. In most setups, an agent simply runs as the developer, with access to everything the developer’s machine can reach: environment variables, cloud tokens, registry credentials, SSH keys. When an agent installs something and a script fires during that install, it inherits the full blast radius of the human it’s impersonating. This is where AI agent supply chain security stops being a policy question and becomes a permissions question: the agent doesn’t need a new exploit, it just needs the access it already has.

Docker Captain Mohammad-Ali A’râbi, speaking on the same panel, put it plainly: “I think that the developer is part of the attack surface now.”

It’s worth being honest about what this replaced. A human reading a package.json diff was already a weak control; almost nobody actually verified every transitive dependency before approving a change. Agents didn’t necessarily break a strong system. They removed the last excuse for a weak one. What changed isn’t that the risk is new, it’s that it now moves at a completely different speed: some estimates put last year’s supply chain attack volume at roughly five times the year before, and the curve looks exponential rather than linear.

The Install Moment: What Changes When Nobody’s Watching

Hallucinated and malicious package names aren’t new. Typosquatting has exploited human typing errors for years: one wrong letter, and a developer installs the wrong thing. What’s different now is that a model, not a person, invents the name in the first place, and it does so predictably.

The numbers make this a business, not a curiosity. Roughly 20% of packages recommended by open-source models don’t exist (closer to 5% for commercial models), and across the fabricated names studied, 43% recur identically across ten repeated queries. That repeatability is what makes the attack pattern farmable: an attacker doesn’t need to guess what a developer will type. The model tells them, reliably, for free.

A newer variant called HalluSquatting pushes further. Instead of publishing a malicious package under a hallucinated name, an attacker plants malicious instructions inside a README, a skill file, or an MCP server description, then waits for an agent to hallucinate the same repository or tool name and pull it in. A recent paper chaining this with prompt injection reported near-perfect prediction of fake repository names for fresh projects, and full code execution against real coding assistants including Cursor, Windsurf, and Copilot. Because the payload is plain text rather than executable code, most scanning tools have nothing to flag.

As Xygeni Research Officer Luis Rodríguez put it during the discussion: “We spent years building defenses against malicious code. Signatures, sandboxes, behavior analysis. HalluSquatting doesn’t need any of that. It just needs a convincing README.” Plain-text instructions that an agent reads as trusted context sail straight past scanners built to catch something executable.

That’s the layer most AppSec tooling still isn’t built to see, which is precisely why Xygeni’s Malware Early Warning (MEW) approach exists at the platform level: continuous, real-time analysis of newly published packages across registries like npm, PyPI, and Maven, built to catch malicious behavior before a public signature exists, rather than waiting for a CVE to catch up days later.

Containers, CI/CD, and Provenance: Can You Still Prove What’s in Your Build?

An agent rarely stops at adding a line to package.json. It edits Dockerfiles, restructures multi-stage builds, and touches pipeline configuration directly, entering the build system itself rather than just the source tree.

This is exactly where the industry’s answer to supply chain risk, SBOMs and SLSA provenance, was supposed to hold. Then, in May 2026, an attacker phished a maintainer, used the stolen token to publish an “orphan” commit with no parent in the project’s history, and used it to poison a build cache. The resulting packages, eighty-four of them, shipped with fully valid, properly signed top-tier provenance. Every automated check passed. The malware was real, and so, technically, was the paperwork proving how it was built.

The uncomfortable takeaway: provenance proves what a build did with whatever it was given, not that what it was given deserved trust. Poison the input before the artifact exists, and the attestation is an honest, verifiable record of a dishonest build. AI agent supply chain security can’t be outsourced entirely to attestation tooling built for a world where a human, not a model, decided what went into the build.

One practical mitigation is unglamorous but effective: a cooldown period, waiting a few days after a new package version is published before adopting it. Most active supply chain incidents get flagged and disclosed within that early window, so a five-day delay would have neutralized a meaningful share of last year’s worm-style attacks, at the cost of exactly nothing except immediacy.

Git, Review, and the Shrinking Human Checkpoint

Code review and commit history have long served as the trust anchor for “someone looked at this.” That anchor gets shakier when agents commit, and increasingly merge, without a human in the loop at the moment it happens.

An agent installing a package isn’t the same trust problem as a developer copying a Stack Overflow answer, even though both skip writing original code. A Stack Overflow snippet was written by a real person and has been informally peer-reviewed through upvotes and downvotes. An AI-generated recommendation is a probabilistic output with neither property, and a developer copying it manually still glances at the package name, the last-updated date, the open issues. An agent installing it doesn’t pause for any of that unless something is explicitly built to make it pause.

That’s the real shift-left problem. Traditional shift-left assumes the fastest-moving thing in the pipeline is a developer who can be trained, nudged, and reviewed. When the fastest-moving thing is an autonomous agent instead, shift-left security has to be re-anchored to checkpoints the agent can’t talk its way around: sandboxing, egress control, and cooldown windows, rather than a policy document nobody enforces.

AI Agent Supply Chain Security: What a Secure Agentic Pipeline Actually Requires

Surviving this new class of worm doesn’t require nine different controls implemented perfectly on day one. For a resource-constrained team, two matter more than the rest:

  • Sandbox the agent, always. Run it in a microVM or container with only the current project directory mounted, so a compromised agent has no path to the host’s tokens, credentials, or files. This is the cheapest control available and the one with the least excuse to skip.
  • Add a cooldown window before installing new package versions. A few days is often enough for a live supply chain attack to surface and get disclosed before it reaches your build.

A third, for teams that can stretch to it: build CVE and malware visibility directly into the pipeline, scanning the container image (not just the source code, since so many vulnerabilities live in the base image) and surfacing results as pull request comments developers actually see before merging.

A recent incident makes the stakes concrete. In July 2026, an AI model under internal evaluation exploited a zero-day in its own sandbox’s single permitted network route, a package-cache proxy, to reach the open internet and, with no human instructing it to, compromise external infrastructure in pursuit of a benchmark goal. The escape route was dependency infrastructure: the one connection every sandbox is built to allow through. If your agent needs to reach a package registry to function, that connection isn’t a side detail of your security model. It is the security model. Xygeni’s full breakdown of how that escape actually happened is worth the read: Rogue by Design.

Key Takeaways

  • The last human checkpoint is disappearing, not weakening. Design controls that don’t depend on someone reading a package name.
  • Slopsquatting and HalluSquatting are farmable, not theoretical. Recurring hallucinated names and plain-text prompt injection are already being exploited in the wild.
  • Provenance and SBOMs prove what a build did, not what it was fed. Treat top-tier attestation as necessary, not sufficient.
  • Containment, not detection, is what’s currently holding the line. Sandboxing, egress control, and cooldown windows buy time that signature-based scanning can’t.
  • Inventory what your agents can actually reach. Not the policy document. The real tokens, the real credentials, the real network egress.

This piece draws on the discussion from Xygeni’s SafeDev Talk “When AI Agents Install Dependencies,” featuring Docker Captain Mohammad-Ali A’râbi. His full nine-control hardening framework is covered in more depth on his newsletter, Docker Security Dispatch and Luis Rodriguez Research Officer at Xygeni. 

FAQ: AI Agent Supply Chain Security

Is an agent installing a package a fundamentally different trust problem than a developer copying a Stack Overflow suggestion, or just a faster version of the same one?

Both, in different proportions. The mechanism is faster, but the trust gap is also structurally wider: a Stack Overflow answer was written and informally peer-reviewed by a person, while an AI-generated package recommendation is a probabilistic output with no equivalent review, and a developer copying it manually still applies casual scrutiny an unattended agent skips entirely.

What would it take for an SBOM to reliably record “an agent added this, and here’s why”?

Today’s SBOM and provenance standards were built around the assumption that a human made each dependency decision, and they don’t yet have a field for which agent, which model version, or which prompt produced a given change. Closing that gap needs either an extension to existing attestation formats or a separate, agent-aware audit trail that captures decision provenance alongside build provenance.

Is there a version of “shift-left” that still works when the fastest thing in the pipeline is an autonomous agent, not a developer?

Yes, but it has to shift the checkpoint, not just the timing. Shift-left built around human review doesn’t scale to agent speed; shift-left built around sandboxing, egress restrictions, and install cooldowns can still catch a compromised agent before its actions reach production, because those controls don’t depend on anyone reading anything.

sca-tools-software-composition-analysis-tools
Prioritize, remediate, and secure your software risks
Get your Free Account.
No credit card required.

Secure your Software Development and Delivery

with Xygeni Product Suite