| name | dependency-verification |
| description | Verifies a package exists before install, defending against hallucination and slopsquatting. Use when adding, recommending, or installing a package. |
| alwaysApply | false |
| category | workflow-methodology |
| tags | ["dependencies","supply-chain","hallucination","slopsquatting","verification"] |
| dependencies | [] |
| tools | [] |
| usage_patterns | ["pre-install-verification","supply-chain-defense","dependency-review"] |
| complexity | basic |
| model_hint | standard |
| estimated_tokens | 1400 |
| modules | ["modules/registry-checks.md"] |
| role | library |
A package name the model produced is a claim, not a fact. The
registry is the fact. Verify before you install.
Dependency Verification
Overview
Code-generating language models recommend packages that do not
exist at a measured rate of 5.2% (commercial models) to 21.7%
(open models) across 576,000 samples (Spracklen et al. 2024,
arXiv 2406.10279). Worse, 58% of hallucinated names recur across
reruns, so an attacker can predict them, register the empty name,
and ship malware. This is "slopsquatting." A proof-of-concept
package (huggingface-cli) drew over 30,000 downloads after being
registered against a commonly hallucinated name. Package
hallucination is also inversely correlated with coding-benchmark
score, so a better model does not make this go away.
The defense is cheap: confirm the name exists in its registry
before installing or recommending it. This skill defines that
check and is enforced by the guard_package_hallucination.py
PreToolUse hook.
When To Use
Apply before any of these:
- Running
pip install, uv add, npm install, pnpm add,
yarn add, cargo add, poetry add, or pdm add.
- Writing a dependency into
pyproject.toml, requirements.txt,
package.json, or Cargo.toml.
- Recommending a package to the user in prose.
When NOT To Use
- Bumping versions of packages already known to exist (use
sanctum:version-updates)
- Auditing a dependency's supply chain (use
leyline:supply-chain-advisory)
The Two Signals
A package fails verification on either signal:
- Nonexistent: the name is absent from its registry. This is
a likely hallucination. Do not install it. Search for the
correct name or confirm the package was renamed or removed.
- Typosquat / slopsquat: the name is one or two edits from a
popular package (for example
reqeusts versus requests).
This is either a typo or a deliberate impersonation. Confirm
the exact name you intend before proceeding.
A name that is unknown to the bundled popular-package set but
present in the registry passes. A name that cannot be checked
because the registry is unreachable is reported as unverified,
never blocked: the guard does not fail closed on a network error.