Skip to content
Beyond Prompt AI Studio
AI-Assisted Software Development for Businesses

Slopsquatting: When AI Invents Software Packages

AI hallucinations are usually a quality problem. With software dependencies, they turn into a concrete security risk – with an attack pattern that has only had its own name since 2025/2026: slopsquatting.

Four slopsquatting realities – worth remembering

Try it yourself: classic supply chain attack vs. slopsquatting

Tap a dimension to compare both sides.

Classic supply chain attack

Attacker registers a package with a similar, easily confused name (typosquatting).

Slopsquatting

Attacker registers a package under a name repeatedly hallucinated by AI that doesn't exist.

When AI invents packages that don't exist

AI coding tools regularly suggest software libraries while generating code that simply don't exist. Research puts the share of invented package names at roughly 20 percent of all suggestions. On its own, that would just be an annoyance – a failed install command, quickly noticed and fixed.

Why this turns into an attack pattern

The real risk factor is repeatability: 58 percent of invented package names recur across similar prompts – the same request or similarly worded ones reliably lead to the same, nonexistent name. Attackers exploit exactly this pattern: they deliberately register malicious code under invented but predictably recurring package names, expecting that developers will eventually actually install that name.

A risk that compounds with existing flaws

Slopsquatting rarely occurs in isolation: AI-generated code often also carries known vulnerability patterns (see the previous module) – insecure API calls, missing error handling, insufficient input validation. Combined with a hallucinated dependency that's been swapped for malicious code, this creates a compound risk for the entire software supply chain, not just a single line of code.

Practice section: three concrete countermeasures

Security researchers recommend three concrete countermeasures that fit directly into existing development processes: first, verify every AI-suggested package name against the official package registry before installing; second, pin versions firmly instead of allowing automatic updates; third, run hash checks on installed packages. All three are standard software supply chain security practices – with AI-generated code, they move from optional extra to necessity.

The key points

  • Roughly 20% of package names suggested by AI coding tools don't exist.
  • 58% of invented names recur across similar prompts – a pattern attackers deliberately exploit.
  • Attackers pre-register malicious code under these predictably recurring, invented names (slopsquatting).
  • Slopsquatting compounds with the code vulnerabilities described in the previous module into a combined supply chain risk.
  • Three effective countermeasures: verify package names before installing, pin versions, run hash checks.

Data Leaks and Supply Chain Risks

Quick check: did it sink in?

1 / 3

What turns invented package names into a real attack pattern, per this module, rather than just an annoyance?

Want to secure your software supply chain against slopsquatting and similar AI risks?