Sayversayver.
All articles
Explainer

Slopsquatting Explained: When AI Hallucinates a Package Name

July 23, 2026 · 7 min read

Frequently asked questions

What is slopsquatting?

Slopsquatting is a supply-chain attack that exploits AI code assistants. LLMs sometimes hallucinate package names that sound plausible but don't exist. Attackers watch for these commonly-hallucinated names, register them as real packages containing malicious code, and wait for developers to install them on an AI's recommendation. The name plays on 'typosquatting,' but the mistake comes from AI 'slop' rather than a typo.

How is slopsquatting different from typosquatting?

Typosquatting relies on a human mistyping a real package name (for example, 'reqeusts' instead of 'requests'). Slopsquatting relies on an AI inventing a package name that never existed, which an attacker then creates. The developer didn't make a typo — they trusted a confident but wrong AI suggestion.

How do I protect against slopsquatting?

Never install a package just because an AI suggested it. Verify the package exists on the official registry, check its download count, publish date, and repository, and be suspicious of a 'perfect fit' package with almost no history. Pin your dependencies and review your lockfile. A code scan can also flag suspicious or unknown dependencies.

Is slopsquatting a real threat?

Yes. Researchers have shown that LLMs hallucinate package names at a meaningful rate and that the same fake names recur, which is exactly what makes pre-registration attractive to attackers. Treat any AI-suggested dependency as unverified until you've confirmed it on the official registry.