The pull request was clean, and she reviewed it properly.
She read the new function top to bottom. Checked the error handling. Questioned a variable name, got a good answer, let it go. Traced the logic against the ticket. Left a comment asking for one more test case, watched it appear, approved. Twelve minutes of real attention on forty lines of generated code. The kind of review you’d want on your own work.
Her eyes passed over line three of the diff without stopping. A new import. One more package added to the manifest, the way the agent adds packages a dozen times a day. Not where review looks. Review looks at logic, at naming, at whether the thing does what the ticket said. The import is just plumbing. It either resolves or it doesn’t, and if it resolves, it’s real.
That’s the assumption the whole of modern software security quietly rests on. And it’s the assumption your AI coding agent has just made obsolete.
The diligence was real. It was aimed at the wrong target.
The Line Nobody Read
Here’s the uncomfortable arithmetic. When Endor Labs ran large-scale testing of the dependencies AI coding agents actually recommend across PyPI, npm, Maven, and NuGet in their 2025 State of Dependency Management report, only one in five of those dependency versions turned out to be safe to use. Safe meaning the boring, baseline thing you’d hope for: it exists, and it has no known vulnerabilities. Four out of five carried a problem. Up to 49% of them, depending on the model, pulled in a version with a known vulnerability. Roughly a third pointed at versions that don’t exist at all.
Sit with the proportion. Not the worst-of-the-worst, not a red-team stress test. A random pull of what these agents suggest when asked to do their job. Four in five carried some problem, from a known vulnerability to a version that doesn’t exist.
And almost none of it gets looked at, because the part of your pipeline that was built to look at dependencies was built for a different world. Think about every gate you have on what enters your codebase. Code review. The allowlist on your artifact proxy. The architecture rules in CI. Every one of them was designed back when a human chose each library. A developer went looking for a date-handling package, weighed three options, read the GitHub issues, picked one, and typed the import. The gate could lean on that. Someone chose this. Someone stands behind it.
Your AI agent removed that someone. The choosing moved from a person deliberating at a keyboard to a model emitting the statistically likely next token. Nobody redesigned the gate to notice. So the gate still runs, still goes green, and now passes whatever the model decided to type, because it was built to verify the work of a chooser who no longer exists.
This is the line nobody read. And it’s not a security problem you can hand to the security team. The decision of what enters your codebase was always an engineering decision. AI moved that decision upstream, from review time to generation time, where no human sits. You cannot put a guard on a door that’s already been walked through. What you’re left with is process debt, and it has a price tag.
The Package That Wasn’t There
Now follow the third of those recommendations that point at things that don’t exist, because that’s where this stops being a quality problem and becomes an attack.
When a model invents a package, the instinct is to picture a harmless typo. The install fails, you notice, you move on. That would be true if the invention were random. It isn’t.
In the most thorough study of the phenomenon to date, presented at USENIX Security 2025, Spracklen and colleagues generated 576,000 code samples across sixteen models and watched what they imported. Commercial models hallucinated non-existent package names at least 5.2% of the time. Open-source models did it 21.7% of the time. That alone is a lot of phantom packages. But the finding that matters is what happened when they asked the same question again.
They took the prompts that produced a hallucination and ran each one ten times. Forty-three percent of the invented package names came back in all ten runs. Not a different fantasy each time. The same name, again and again, like the model had a confident, consistent, completely wrong belief about a library that was never written.
A repeatable hallucination is not a typo. It’s an address. If the model reliably tells thousands of developers to install a package that doesn’t exist, then that empty name is a destination with guaranteed traffic and no occupant. Anyone can move in. Register the name, put code behind it, and wait for the next developer whose agent confidently recommends it, whose CI pulls it, whose build runs it.
Security researchers gave this its own word in 2025: slopsquatting. The older trick, typosquatting, relied on a human fat-fingering reqeusts instead of requests. Slopsquatting doesn’t need the human to slip. It lets the machine make the same mistake on purpose, predictably, at scale, and turns that predictability into a delivery route.
Here is the part you actually control, and I’ll come back to it, because the rest of this article is going to feel like bad news until we get there: every one of these failures happens at a gate you own, in a process you can change, without waiting for a single model to get better.
“Just Bump the Version”
The title of this piece promises two things, dependency hygiene and upgrade discipline, and so far we’ve only talked about what comes in the door. The upgrade story is where it gets genuinely awkward, because it turns a piece of advice you’ve heard a hundred times into a trap.
The advice is: keep your dependencies current. Don’t let them rot. Automate the updates so you’re never years behind on a library with a known hole in it. That advice is correct. Stale dependencies are a real and well-documented way to get breached, and the reflex to automate the boring work of staying current is a good reflex.
But watch what happens when the thing doing the automating is the same kind of model that invents packages. It invents upgrades too. Sonatype’s 2026 State of the Software Supply Chain report tested this directly: across 36,870 dependency upgrade recommendations from AI agents, 27.76% referenced versions that don’t exist. More than ten thousand confident suggestions to upgrade to a release that was never published.
So you’re holding two true things at once. Letting dependencies rot is dangerous. And blindly automating freshness is now also dangerous, because “bump it to the latest” and “just turn on the bot and walk away” have quietly become “act on a guess.” The model doesn’t know what the latest version is. It knows what the latest version probably looked like, given text that’s a year or more stale, which is a different and occasionally fictional thing.
And the everyday cost arrives long before any attacker does. A bot that confidently files ten upgrade pull requests, green checkmarks and all, three of them pointing at versions that were never published, isn’t a security incident. It’s a wedged pipeline, a failed deploy, and an on-call engineer at 2am chasing a release that doesn’t exist. The breach is the rare case. The broken build is Tuesday.
The resolution to that tension is the whole game, and it has a name: discipline. Not “don’t automate.” Automate the detection, the noticing, the flagging that a dependency is behind. Then gate the decision to act on it. The bot can tell you a hundred things are out of date. A human, or a check grounded in the live registry, decides which of those hundred upgrades point at versions that actually exist before any of them merge. Automate the toil. Gate the trust.
The New Model Won’t Save You
The reasonable objection at this point is to wait it out. These were yesterday’s models. The new ones are smarter. Give it a release cycle and the hallucination goes away on its own.
It doesn’t, and the reason it doesn’t is the reason this belongs in a readiness series instead of a changelog.
A model generates an import by predicting the most probable next tokens from what it absorbed in training. Training data is frozen, months or years before you type your prompt, and the model never checks the live registry while it’s working. It optimizes for what was common when it learned, not for what is true now. That’s not a bug a patch removes. It’s the mechanism. A system built to reproduce frequent patterns will confidently reproduce a package that was frequently discussed but never published, and a version number that looks exactly like a real one.
The numbers bear this out. When Churilov re-ran the package hallucination test on the 2026 frontier cohort, the newest and most capable models available, across 199,845 prompts, the hallucination rate had narrowed to a band between 4.62% and 6.10%. Better than the spread of two years earlier. Not gone. A twentieth of everything these state-of-the-art models import, still pointing at nothing.
And one detail in that study should end the wait-it-out strategy for good. The models didn’t just each hallucinate at random. A hundred and twenty-seven invented package names showed up identically across five different models. Five independent systems, from different labs, agreeing on the names of libraries that don’t exist. For an attacker, that’s not noise. That’s a shortlist. The convergence makes the names easier to pre-register, not harder, because you can target the ones every model agrees on. Newer and more uniform models make the residue more exploitable, not less.
A Vacancy in a Hostile Market
Everything so far would be a manageable curiosity if the registry your agent reaches into were a quiet, mostly-empty place where an unregistered name just sat there harmlessly. It isn’t.
The same Sonatype supply-chain report that counted those phantom upgrades also counted 454,600 new malicious packages entering the open-source ecosystem in 2025. Not flawed packages, not outdated ones. Deliberately malicious, published to be installed by someone who didn’t look closely. The registries are no longer a sleepy public library. They’re an actively contested marketplace where automated adversaries publish at industrial scale and iterate to catch as many people as they can.
Now put it together. Your agents recommend, confidently and repeatably, a shortlist of names that don’t exist. The registry they recommend from is a place where hundreds of thousands of malicious packages appear every year, published by people who study exactly these gaps. The hallucinated name isn’t a dead end. It’s a vacancy, in that market, with a known queue of tenants.
That’s the full cost of the line nobody read. Not “the build might fail.” The build might succeed, with someone else’s code in it.
Ground, Gate, Verify
I promised this turned into something you control. It does, and it doesn’t require a single model to improve or a single vendor to ship anything. The fix is structural, which means it’s yours.
The structural problem, stated once more, is simple: you have gates designed for a chooser who left. Three moves put a chooser back.
Ground the agent in reality. A model guessing from frozen training data is the entire source of the problem. The same Endor Labs testing found that when agents were given tools to check the live registry while they worked, instead of recommending from memory, the share of safe dependency versions rose from roughly one in five to about 57%. Nearly a threefold jump, from a single change. Note the ceiling too: 57% is better, and it is nowhere near “trust it blind.” Grounding is the first move, not the last.
Gate the decision, not just the toil. Automate every bit of noticing you can. Let the bots find what’s stale, flag what’s vulnerable, open the pull request. Then put a hard stop between that and merge. A new dependency or a version bump waits for a check that it exists in the real registry, has existed for more than a few days, and was chosen on purpose. A cooldown of even a few days on automatic merges turns “installed before anyone noticed” into “caught before it shipped.” The bot proposes. A grounded check disposes.
Put the human back on the import line. Review the manifest with the same seriousness you review the function. The new dependency is the most consequential line in the diff, because it’s the one line that runs someone else’s code on your infrastructure, and right now it’s the one line nobody reads.
None of these is exotic. They’re the unglamorous discipline of treating what enters your codebase as a decision again, instead of an autocomplete.
The Diagnostic: Three Questions, Two Altitudes
You can run this today.
If you lead the org, you don’t need to read a manifest. You need to ask three questions and watch how long the room goes quiet:
What percentage of the dependencies we added this quarter did a human choose, versus an agent added? Can anyone here even tell me?
Do our update bots auto-merge dependency changes without a cooldown or an existence check?
Are our coding agents grounded in the live package registry, or are they recommending from training data? Yes or no.
Every “I don’t know” and every “no” is process debt with a price tag attached. And the silence after question one is itself the first action item: if nobody can tell you what share of your imports a human chose, make import origin visible before you touch anything else. You can’t gate a decision you can’t see. The questions aren’t about tooling brands. They’re about whether the decision of what enters your code is still being made by someone, or whether it quietly stopped being made at all.
If you’re closer to the code, run the IC version. Open the last AI-generated pull request that got merged. Find the dependency changes. For each one, ask: Does this package exist, and has it existed for longer than a week? Is this the version the agent claimed, and does that version exist? Did anyone, at any point, actually decide to add this, or did it ride in under a reviewed function? Would a freshly-registered package at this exact name have been caught by anything we run?
If the honest answer to that last one is no, you’ve found your readiness ceiling. It isn’t the model. It isn’t the IDE. It’s the gate you built for a chooser who left.
The Line, One More Time
Go back to the review at the start. She did everything right. She read the code, questioned it, tested it, stood behind it. The forty lines she scrutinized were probably fine. The risk was never in the part she was trained to examine. It was in the one line she’d been taught, by twenty years of habit, to treat as plumbing.
That habit made sense when a person chose every import. It’s a liability now, and the fix isn’t to review harder or to wait for a better model. It’s to notice that the chooser left, and to put one back, at the door, where the decision is actually made.
So ask it plainly, about the codebase shipping AI-generated changes this week: of all the dependencies you’re now running in production, how many did a human actually choose?
If you can’t answer, that’s the gap an attacker is counting on.


