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. Inspect registry, namespace and provenance evidence for an AI-suggested package, then export a reusable verification checklist.
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-helperVersion 1.0.0 / Fictional record
Follow the evidence
0 of 4 records collectedYour next check
Which clue would you trust first?
Choose a source. Each record answers a different question. You can inspect them in any order. Select an evidence source to inspect namespace ownership, registration timestamps, build provenance, or release-diff scope.
- Day 1 AI suggests a name.
No entry exists. - Day 2 A publisher registers it.
The origin is still unverified.
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. Select a disposition above. Collecting a new record reopens your disposition; re-reading an already-collected record preserves it.
What this reveals:
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. A coding model can invent a plausible package name. Someone can then publish a package under that name, so a later user follows the suggestion to code the model never verified. This is different from a lookalike name that imitates 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. Provenance can connect an artifact to a publisher, source and build. It cannot establish that the source is harmless. A valid record for the wrong project is still the wrong project.
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.
- Treat an AI-suggested package name as unverified input.
- Follow official project documentation to the exact registry and package name.
- Compare spelling, publisher and release history. Existence and popularity are not safety proofs.
- Match version-specific provenance to the expected repository, commit and build workflow. Origin is not safe behavior.
- Review the exact release, dependency changes and permissions using your project’s review process. Do not install an unknown package merely to inspect it.
- Keep unresolved questions. Decline or seek a reviewed alternative if evidence is insufficient.