The package investigation / About 5 minutes

Should you trust the package
an AI suggests?

Inspect the clues for a suggested package name and keep a checklist for the next one.

Open the investigation

Practice with fictional package names, publishers and records. Nothing is downloaded from a registry, installed or run, and no live AI is involved.

Case 1 / Fictional investigation

The name that appeared overnight

Yesterday this name had no registry entry. Today it does. What changed?

The task

I want to turn a folder of pictures into a contact sheet.

Authored recommendation example

Use crane-pixel-helper. It handles the layout for you.
crane-pixel-helper

Version 1.0.0 / Fictional record

Follow the evidence

0 of 4 records collected

Your next check

Which clue would you trust first?

Choose a source. Each record answers a different question. You can inspect them in any order.

All records are authored fiction.

You decide what happens next

What does your evidence support?

No “safe to install” button. A good investigation can end with a useful unanswered question.

Your decision is still open

Pick a next step above. You can revise it when new evidence changes your mind.

Each case keeps its notes while this page is open. Download them before leaving.

Choose a record to start.

Read or copy my field notes
Your collected evidence will appear here. The checklist below is always available.

The mechanism

What is slopsquatting?

An AI can suggest a package name it made up. Someone could later publish code using that name. The name now exists, but that does not make the AI’s suggestion trustworthy. A lookalike spelling is a different trick: it copies the name of an existing package.

Seth Larson of the Python Software Foundation coined the name in 2025 (Socket’s account). Spracklen and colleagues measured package hallucinations in 16 code models and 576,000 generated samples: on average at least 5.2% of suggested packages did not exist for commercial models and at least 21.7% for open-source models, under that study’s prompts and languages. This lesson does not estimate the chance that your current assistant will make this mistake. Read the USENIX Security 2025 paper.

The important limit

A badge answers a narrower question.

A record can help show who published code and where it came from. It cannot prove that the code is harmless. First check that it is even the project you meant to use.

Compare npm’s provenance guide and PyPI’s attestation security model. For the separate name-confusion problem, see npm’s threat overview.

Use it outside this lesson

Before you trust a package name

These checks reduce uncertainty. They do not guarantee safety.

  1. Treat an AI-suggested package name as unverified input.
  2. Follow official project documentation to the exact registry and package name.
  3. Compare spelling, publisher and release history. Existence and popularity are not safety proofs.
  4. Match version-specific provenance to the expected repository, commit and build workflow. Origin is not safe behavior.
  5. Review the exact release, dependency changes and permissions using your project’s review process. Do not install an unknown package merely to inspect it.
  6. Keep unresolved questions. Decline or seek a reviewed alternative if evidence is insufficient.