Slopsquatting
Slopsquatting is a software supply-chain attack in which someone registers a package name that AI coding tools tend to invent, so that developers or agents who trust the suggestion install the attacker's code.
Modern software is built from open-source packages pulled from public registries such as PyPI for Python and npm for JavaScript, usually with a single install command. When a developer asks an AI assistant for code, the answer often includes such a command. Sometimes the package it names does not exist. This error is called package hallucination, and slopsquatting is the attack that exploits it: an attacker publishes a package under the invented name and waits for someone to install it.
The name combines "slop", slang for low-quality AI output, with typosquatting, the older trick of registering misspellings of popular package names. It is credited to Seth Larson, security developer-in-residence at the Python Software Foundation, who coined it in 2025. What makes it workable is repetition: models often give the same invented name to similar questions, so an attacker can predict which names are worth registering.
The scale has been measured. A study by Joseph Spracklen and colleagues, presented at the 2025 USENIX Security Symposium, generated 576,000 code samples from 16 models and found that at least 5.2% of packages suggested by commercial models and 21.7% of those from open-source models were hallucinated, adding up to 205,474 unique invented names. Earlier, in an experiment reported in March 2024, Bar Lanyado of Lasso Security uploaded an empty package called huggingface-cli after chatbots kept recommending it; it received more than 15,000 genuine downloads in about three months, and a README in an Alibaba research repository told users to install it.
The risk grows with coding agents that install dependencies themselves, without a person reading the command first. A malicious package can run code at install time, steal credentials or plant a backdoor in the finished software.
The defences are familiar from supply-chain security: check that a suggested package exists and is the one you expect before installing it, pin dependencies to known versions, use internal mirrors or allow-lists, and scan new dependencies. Registries can also watch for names that suddenly attract installs soon after being created. Lanyado said he was not aware of the technique being used in a real attack at the time, but it costs an attacker little to try.
Typosquatting relies on humans mistyping a real package name, such as a missing letter. Slopsquatting relies on AI models inventing a plausible name that does not exist. Both end with a developer installing an attacker's package, but slopsquatting targets names that models predictably make up. In a study of 16 models and 576,000 code samples presented at USENIX Security 2025, hallucinated packages averaged at least 5.2% for commercial models and 21.7% for open-source models. Rates vary by model, language and prompt, and newer models may differ. Verify that any package an AI suggests is real, maintained and the one you intended before installing it. Pin versions, use lock files and dependency scanners, and restrict coding agents so they cannot install new packages without review. Researchers have shown that it works: a harmless test package registered under a hallucinated name was downloaded thousands of times. The researcher behind that test said in 2024 he had not seen malicious use, though such attacks are hard to detect.Common questions
What is the difference between slopsquatting and typosquatting?
How often do AI coding tools invent package names?
How can developers protect themselves from slopsquatting?
Has slopsquatting been used in a real attack?
Search for "slopsquatting", "package hallucination" or "AI software supply chain". Peer-reviewed security research, such as USENIX Security papers, gives the most careful measurements, and package registries and the Python Software Foundation publish guidance for developers. Treat figures in vendor blog posts as indicative, since they often come from small or unpublished test sets.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.