When AI Agents Invent Software That Does Not Exist: Understanding the Slopsquatting Threat
November 1, 2026
When AI coding agents suggest package names that do not exist on PyPI, and those names are reproducible, attackers can register them and wait for an agent to install malicious code. Here is what you need to know about slopsquatting and how to defend against it.

TL;DR: Small local AI models reliably hallucinate fake Python package names, creating a predictable attack surface that attackers can exploit through slopsquatting, and independent verification is the only reliable defense.
A developer running local AI models on everyday coding tasks discovered something unsettling: the models were suggesting package names that do not exist on PyPI. Across 1,199 scripts generated from 200 tasks, roughly one in six install suggestions named a phantom package. Even more striking, the same model asked twice produced the same fake names, meaning the hallucinations are deterministic rather than random. This determinism creates a direct path for attackers who can pre-register those predicted names and wait for an agent to install them.
The Experiment: How Models Invent Packages
The study, compiled in November 2026, tested three small open-weight models, gemma4:e4b, qwen3:4b-instruct, and phi4-mini:3.8b, running locally via Ollama. The researcher generated 1,199 short Python scripts across 200 coding tasks, running each task twice. Every time a script suggested a pip install command, the researcher checked the named package against the real PyPI registry. The result: 15.0 percent of install suggestions, or 212 out of 1,410 total suggestions, named packages that have never existed on PyPI. The hallucination rate varied by model: gemma4 produced ghosts 8.1 percent of the time, phi4-mini 16.7 percent, and qwen3 20.7 percent. Task difficulty also influenced the rate. Everyday tasks produced ghost names only 1.7 percent of the time, while obscure tasks triggered hallucinations 30.0 percent of the time. The most critical finding was reproducibility. After wiping everything and rerunning from scratch, 161 of 162 ghost names returned, and 98.7 percent of outputs were word-for-word identical. This means the models are not generating random noise; they are reliably reinventing the same fake names, time after time.
Why Determinism Matters: The Slopsquatting Threat
The reproducibility of these hallucinations is what transforms them from a curiosity into a security risk. The researcher coined the term slopsquatting to describe the attack pattern: because the models reliably reinvent the same fake package names, attackers can register those names on PyPI and upload malicious code. When an agent follows the model's suggestion, it installs the attacker's payload. Lasso Security's Bar Lanyi demonstrated this attack empirically, registering one recurring ghost name as an empty package that attracted more than 30,000 authentic downloads in just three months. The threat is especially acute for coding agents such as Claude Code, Codex, and Cursor, which increasingly execute install commands before a human ever reads them. A single confident hallucinated install line, typed at 1:16 AM, is the failure mode. The study also found that 56.5 percent of the ghost names were simply the task's own words glued together, making them highly guessable by an attacker who has read the prompt. Asking a model "does this package exist?" is unreliable in both directions, the author notes; a hosted model once believed 60 of 161 ghosts were real packages.
The Defense: Pre-Install Guards and Offline Classifiers
In response, the researcher built a TabPFN-3.5 classifier trained to detect ghost names offline, meaning it does not need to look up the package registry. The classifier achieved an AUROC of 0.975 on unseen prompts and maintained strong calibration with an error of just 0.015. Deployed as a Claude Code hook plus a GitHub Action called phantom check, the guard intercepts install commands before they execute. In testing across the full study, it blocked all 212 ghost installs while falsely stopping only 13 of 1,165 real packages. The guard works even without internet connectivity, catching roughly 90 percent of ghosts when Wi-Fi is off. All code, evaluation data, and an anonymized dataset have been open-sourced under the project T-RexBytes/phantom-packages; continuous integration enforces that no ghost name leaks publicly, explicitly avoiding the publication of an attacker shopping list. The practical takeaway is that a dedicated pre-install guard is the effective control point, not relying on the model's own assessment of whether a package exists.
Parallels in AI-Generated Tooling
This research fits into a broader pattern of risk in AI-generated artifacts. Published research has found that roughly a quarter of agent skills carry at least one vulnerability, a signal that AI-generated tooling requires independent verification before use. SkillzBench, a free independent directory of AI agent skills, applies the same pre-deployment guardrail philosophy. Every skill on SkillzBench is pinned to a commit SHA, security-scanned, license-checked, and benchmarked in a sandbox with and without the skill before it is listed. The platform's trust score ranges from 0 to 100, drawing on security, quality, license, maintenance, and community signals. The free MCP connector then equips agents with only the verified skills the user has chosen, and the agent only sees what was chosen. The sandbox-before-trust principle that underpins SkillzBench's verify pillar mirrors the study's decision never to install anything during testing. For developers and business owners adopting AI at work, the parallel is clear: AI-generated code and AI-generated skills both need verification before they are trusted to run.
Practical Steps for Teams
For teams using coding agents, the study offers a clear checklist. First, assume that local small models will hallucinate package names, and do not rely on the model to self-check. Second, implement a pre-install guard such as the phantom check GitHub Action, which can block ghosts in about 2.2 seconds and let legitimate packages pass in about 1.7 seconds. Third, remember that the problem is worst where verification is least likely to happen: cost-sensitive setups using local models. Fourth, apply the same verify-and-benchmark mindset to agent skills by using a platform such as SkillzBench, which scans, benchmarks, and pins every skill to a commit SHA. Fifth, stay current; SkillzBench tracks upstream changes, re-scans, re-benchmarks, and notifies when a skill's status changes. The free directory, the free MCP connector, and the free benchmarks are all available today at skillzbench.com, and everything on the platform is free. Ad money never influences scores or listings, and comparisons of third-party tools remain neutral and evidence-based.
Bottom line
The reproducibility of model hallucinations is the critical insight from this research. Because small models reliably reinvent the same fake package names, attackers have a predictable path to slopsquatting. The study's defense, a dedicated pre-install guard, blocked every ghost install in testing and works offline. For anyone running coding agents or managing AI-generated tooling, the message is the same: trust but verify. A pre-install guard protects the package level, while platforms such as SkillzBench apply the same philosophy at the skill level, ensuring that every skill an agent loads has been scanned, benchmarked, and pinned to a known good version. The directory, the MCP connector, and the benchmarks are all free and running today, and readers can find current verified results at skillzbench.com.
Key takeaways
- Small open-weight models generate fake package names in 8 to 21 percent of install suggestions, and these names are reproducible across runs, making them guessable by attackers.
- The study shows that 56.5 percent of ghost names are constructed from the user's own task description, meaning attackers need only read the prompt to craft a name that the model will accept.
- Slopsquatting, the practice of registering hallucinated package names on PyPI, has already attracted tens of thousands of authentic downloads, demonstrating real-world harm from model determinism.
- SkillzBench applies the same pre-deployment guardrail philosophy at the skill level, scanning and benchmarking every agent skill before it reaches a user's agent.
- A dedicated pre-install guard, not model self-checks, is the effective control point for preventing ghost package installs in agent workflows.