Slopsquatting: When AI invents package names

In short: Almost every AI-built app is full of ready-made building blocks called packages. Sometimes the AI invents names that don't exist, and attackers register exactly those names with malicious code. The cases are documented, including the first confirmed attack. In my work I mostly see the quiet sibling of this risk: outdated packages with long-known vulnerabilities. Here is how you spot both, even if you can't code.

By Michael Kaiser ·

What is slopsquatting?

Almost no app is written from scratch. It builds on ready-made blocks called packages: a library for signing users in, one for charts, one for file uploads. These packages live in public registries, npm for JavaScript, PyPI for Python. Anyone can publish there, under any name nobody has claimed yet.

Language models recommend packages when they write code. Sometimes they invent names that don’t exist. Researchers at the University of Texas at San Antonio, the University of Oklahoma and Virginia Tech measured it: they had 16 models generate 576,000 code samples. On average, at least 5.2 percent of the packages recommended by commercial models didn’t exist, and 21.7 percent for open-source models. In total they counted over 205,000 distinct invented names.

Slopsquatting turns that behavior into an attack. An attacker asks the same models typical programming questions and notes which nonexistent packages they suggest. Then they register exactly those names in the registry and fill them with malicious code. When someone later installs the package on their AI’s recommendation, the attacker’s code lands in their app. The name combines AI slop, the mass-produced filler of the AI era, with typosquatting, an older trick built on look-alike names.

What makes the attack practical is that the invented names repeat. When a hallucination-producing prompt was run ten times, the same invented name appeared in all ten responses 43 percent of the time. Attackers don’t have to guess. They know which names the AI will keep suggesting.

Does this actually happen?

Three documented cases show it does:

  • huggingface-cli (2024): AI assistants kept recommending a package called huggingface-cli that didn’t exist. Security researcher Bar Lanyado registered the name himself with a harmless package. Within three months it collected more than 30,000 genuine downloads, The Register reported. Alibaba’s GraphTranslator project even copied the wrong install command into its own instructions, apparently taken from an AI answer without checking.
  • react-codeshift (2026): An AI merged two real packages, jscodeshift and react-codemod, into one invented name. It spread through AI-written instruction files for agents into 237 GitHub repositories, copied, forked and even translated into Japanese, without a human ever verifying it. Aikido researcher Charlie Eriksen claimed the name in January 2026 before an attacker could. Downloads kept trickling in afterwards, one to four a day: agents following the instructions.
  • PhantomRaven (2025): the first confirmed attack. In late October 2025, security firms Koi Security and DCODX reported a campaign that uploaded more than a hundred malicious packages to npm through slopsquatting and typosquatting. The packages stole authentication tokens, CI/CD secrets and GitHub credentials. CrowdStrike assesses the malware itself was likely written with an LLM.

And it stays current: a replication study tested five frontier models in 2026 with nearly 200,000 generations. They still invented 3.6 to 5 percent of package names, better than before, but not gone. At least 23 of the suggested names had previously hosted malware that registries later removed, and one hallucinated name was registered with malicious code after the test runs.

Why does vibe coding make this worse?

In classic development, a programmer types the install command and can get suspicious. When you build with Lovable, Base44 and similar tools, it works differently: the AI decides which packages go into your app and installs them itself. In my own projects I see exactly that: the tools add packages without asking first.

Then there is the mechanism Aikido described with react-codeshift: when the installer asks whether to fetch the package, the agent confirms with yes on its own. Most people do the same.

If you can’t code, you face the problem twice over: you can’t judge a package name yourself, and the AI doesn’t ask. Canada’s Cyber Centre recommends in its vibe coding guidance that AI agents should not install packages autonomously, with an allow list or human review in between.

What do I find in real projects?

Honesty first: I have not yet come across an invented package name in my client work. What I find constantly instead is this risk’s quiet sibling: outdated packages. The AI reaches for versions that have been known to be vulnerable for a long time, or for packages that simply make no sense in the project.

In one audit before launch, exactly that turned up: outdated packages with documented vulnerabilities, caught just in time. Nothing happened, because we had them replaced before the app went live.

Why the two belong together: an outdated package with a publicly documented vulnerability is an instruction manual for attackers. They don’t have to invent anything or deceive anyone, they just exploit what is already written down. And a flaw nobody knows today can become public tomorrow. That is why checking once is not enough.

How do you protect yourself without coding skills?

You don’t need to read code. These five steps work with your AI:

  1. Have every package justified: Ask your AI: which packages are in my app, and what do I need each one for? Packages without a good answer come out. Every unnecessary package is a risk you don’t need.
  2. Don’t confirm installations unread: When the tool or agent asks whether it may install a package, read the name. If it’s unfamiliar, ask first instead of confirming.
  3. Have unknown packages checked before they go in: The AI can check whether a package even exists, how old it is, how often it is downloaded and whether any known vulnerabilities are documented for it. A package hardly anyone uses, or one that is only days old, does not belong in your app.
  4. Have packages re-checked for known vulnerabilities: What is safe today can have a public vulnerability tomorrow. A single check before launch is not enough.
  5. Take the check seriously, not the convenience: The AI means no harm when it suggests a package. But it takes no responsibility. That stays with you.

Tell your AI: “List every package in this project, what it is for and when it was last maintained. Check each package for known vulnerabilities. Don’t install any new package without asking me first and telling me why it’s needed.”

What do you do about a suspicious package?

Tell your AI to remove it and build the feature without it, or with a well-known replacement. Then test that everything still works.

If the package was already installed and the app ran with it, more is needed: packages can run their own scripts during installation. That is exactly how PhantomRaven read tokens and credentials. In that case, replace your app’s keys at the provider, because the old one stays valid otherwise. The procedure is in Vibe-coded app hacked?

How does builtSecure prevent this?

The steps above kick in once a package is already being discussed. builtSecure starts earlier: the AI checks every package for known vulnerabilities before adding it, and asks you when something is unclear. It keeps a file called BUILTSECURE.md in your project that records every package with its reason. And after launch your packages keep being watched: when a new vulnerability becomes known, you hear about it.

That doesn’t replace a review by experts, but the basics are right while the app is being built. What else to check before launch is in the checklist before you launch.

builtSecure is still at an early stage. If you want to try it, you can start for free below.

Frequently asked questions

Can I protect myself from slopsquatting without being able to code?

Yes. Have your AI explain what each package is for, don't confirm installations unread, and have unknown packages checked before they go in. Tools like builtSecure check every package automatically before it is added.

Are the new AI models safe from slopsquatting?

No. A 2026 replication study found that even current frontier models still invent 3.6 to 5 percent of package names. Better than before, but not gone.

What do I do when the AI wants to install a package I don't know?

Don't confirm it. Ask what the app needs it for and why this package in particular. If there is no good answer, have the AI remove it and build the feature another way.

Sources

  1. Spracklen et al.: We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs (USENIX Security 2025), retrieved on
  2. Churilov: The Range Shrinks, the Threat Remains: Re-evaluating LLM Package Hallucinations on the 2026 Frontier-Model Cohort, retrieved on
  3. The Register: AI bots hallucinate software packages and devs download them, retrieved on
  4. Aikido: Agent Skills Are Spreading Hallucinated npx Commands, retrieved on
  5. The Hacker News: Claimed Bug Bounty Hunter Likely Used LLM to Build PhantomRaven npm Stealer, retrieved on
  6. Canadian Centre for Cyber Security: Managing security risks in vibe coding (ITSM.60.043), retrieved on

Security you never have to ask for. Free during early access.

Start for free

Rather get news first? Subscribe and we'll email you now and then.

More posts