Slopsquatting: 1 in 5 AI Code Samples Recommends a Package …

AI-generated summary. Read the original report before relying on it.

Read the original report

A reported study says about 1 in 5 AI code samples named a package that does not exist, and a small npm campaign showed real developers installed invented packages.

Key findings

  • The reported study found 19.7% of AI code samples contained at least one nonexistent package, across 2.23 million samples from 16 models.
  • A research team uploaded 107 invented package names to npm and reported 35.2% of installs came from real developers, with most first interactions within two weeks.
  • Reported hallucination rates varied by model family: open-weight models averaged 21.7%, commercial models 5.2%, and GPT-4 Turbo 3.59%.
  • Adding web search to the generator reportedly worsened hallucination persistence, rising from 11.2% to 17.3%.

How you might use it

  • Treat AI-suggested package names as untrusted until checked against a real registry.
  • Test a small gate that blocks installs of packages not found in the registry.
  • Use the reported model-family spread as a reason to compare tools on package hallucination, not general code quality.

Limits

  • All numbers are reported claims from one linked source, not independently confirmed findings.
  • The source does not prove financial loss, customer demand, or vendor capabilities for the business ideas.
  • The related OpenAI and Claude sources are control comparisons only; they do not show either vendor was used or caused the incident.

Business ideas

Ideas inspired by this incident. They are untested, not claims of demand or financial outcome.

1. Package Existence Gate

Offer: Blocks installs of packages that do not exist in registries.

Buyer: Teams shipping AI-generated code

Technical link: The story reports 205,474 invented package names across AI samples.

Evidence

Supporting evidence: Slopsquatting: 1 in 5 AI Code Samples Recommends a Package …

  • 19.7% of AI code samples contained at least one package that does not exist 19.7% of the samples contained at least one package that does not exist.

Differentiation: Focuses only on registry existence, not code quality.
First test: Run it on 100 AI-generated dependency lists.
Success measure: It flags every invented package in the test set.
Constraints: Unknown if teams will pay for a narrow gate.

2. AI Code Provenance Ledger

Offer: Records which AI model wrote each code change.

Buyer: Companies using AI coding assistants

Technical link: The story reports hallucination rates varied by model family.

Evidence

Supporting evidence: Slopsquatting: 1 in 5 AI Code Samples Recommends a Package …

  • 19.7% of AI code samples contained at least one package that does not exist

Differentiation: Provenance tracking, not just code scanning.
First test: Add it to one team's pull-request flow.
Success measure: Every AI change shows its model source.
Constraints: Unknown if teams want to track model sources.

3. Hallucination Audit Service

Offer: Manual review of AI-generated code for fake dependencies.

Buyer: Firms adopting AI coding tools

Technical link: The story reports 19.7% of samples contained a nonexistent package.

Evidence

Supporting evidence: Slopsquatting: 1 in 5 AI Code Samples Recommends a Package …

  • 19.7% of AI code samples contained at least one package that does not exist

Differentiation: Human review, not automated scanning.
First test: Audit 20 AI-generated projects for fake packages.
Success measure: It finds hallucinated packages in the sample.
Constraints: Unknown if firms will pay for manual audits.

4. Model Hallucination Scorecard

Offer: Ranks AI coding models by hallucinated package rate.

Buyer: Engineering leaders choosing AI tools

Technical link: The story reports rates from 3.59% to 33% across models.

Evidence

Supporting evidence: Slopsquatting: 1 in 5 AI Code Samples Recommends a Package …

  • 19.7% of AI code samples contained at least one package that does not exist

Differentiation: Focuses on package hallucination, not general code quality.
First test: Test 5 models on 100 prompts each.
Success measure: It produces a clear ranking of hallucination rates.
Constraints: Unknown if leaders trust small-sample rankings.

5. Dependency Quarantine Sandbox

Offer: Isolates new packages in a safe environment before install.

Buyer: DevOps teams running AI code

Technical link: The story reports 35.2% of installs of invented packages came from real developers.

Evidence

Supporting evidence: Slopsquatting: 1 in 5 AI Code Samples Recommends a Package …

  • 19.7% of AI code samples contained at least one package that does not exist

Differentiation: Sandboxing, not detection or blocking.
First test: Route 50 new dependencies through the sandbox.
Success measure: No new package runs outside the sandbox.
Constraints: Unknown if teams accept slower installs.

We use a small amount of analytics and storage to improve this site. Review settings in the cookie policy.