Slopsquatting exploits package hallucinations: an attacker registers a package name that coding models commonly invents, then waits for a developer or automated pipeline to install malicious software. The risk grows when generated dependencies enter agent workflows with large blast radii and little review. section 5.2.4
Treat every AI-suggested dependency as untrusted input:
- Verify that the package exists in the intended registry before running an install command. section 8.2.4
- Question whether the dependency is necessary; generated code often adds libraries that a small implementation could avoid. section 8.2.4
- Scan dependencies for vulnerabilities, compatible licenses, maintenance signals, suspicious ownership changes, and provenance. section 8.2.4
- Do not treat lower hallucination rates or registry defenses as eliminating the attack class; generated dependency names remain a structural risk. section 5.2.4
The hallucinated huggingface-cli package
Models repeatedly recommended a Python package named huggingface-cli, although the real command-line installation uses pip install -U "huggingface_hub[cli]". After a researcher registered the nonexistent name on PyPI as an empty package, it received more than 30,000 genuine downloads in three months, demonstrating how plausible model output can create a ready-made supply-chain target. section 5.2.4

