Hallucinated Package Checker: Stop Slopsquatting Installs
by Vijay Kumar
Attackers register those names on PyPI and npm and wait for someone to run pip install or npm install.
Free
Works with the AI Agents you already use
What it does
- Extracts new imports from a diff or a whole repo, ignoring the standard library and your own modules
- Checks each name against the live PyPI and npm registries and flags packages that do not exist
- Flags look-alike names one or two letters from a popular package and packages first published in the last 30 d
- Maps import names to install names, such as yaml to PyYAML, so real packages are not wrongly rejected
- Cross-checks imports against requirements, pyproject and package.json and lists any that are undeclared
- Reports a clear verdict with a replacement for every risky name, and fails closed when the network is down
Who it's for
Developers using AI coding agents
Get a safety check before running an install an AI suggested.
Try asking: “Check the new dependencies in my last commit.”
Code reviewers and tech leads
Add a supply-chain pass to PR review.
Try asking: “Review this diff for fake or suspicious packages.”
Teams adopting AI-assisted coding
Audit a whole repo once.
Try asking: “Scan this repo and list imports that are not declared.”
Hallucinated Package Checker: Stop Slopsquatting Installs
Example session with this skill installed
Review the new imports in sample.patch for fake or risky packages. The repo root is sample_repo and I want the manifest checked too.
- Read your context and instructions
- Compiled the hallucinated package checker
$ python3 scripts/verify_packages.py --from-diff sample.patch --repo-root sample_repo --check-manifest
local pypi payment_handler (first-party module)
stdlib pypi os
missing pypi py_fake_cryptography_pkg (no such package)
ok pypi redis
ok pypi requests
ok pypi yaml -> PyYAML
ok npm express
missing npm sleep-promise-fast-xyz-123 (no such package)
ok npm zod
Not declared in manifest: pypi:py_fake_cryptography_pkg, pypi:redis, pypi:PyYAML, npm:express, npm:sleep-promise-fast-xyz-123, npm:zod
Agent report:
Dependency check (7 packages looked up on 2 registries, 2 skipped)
HIGH missing py_fake_cryptography_pkg (pypi) -> remove; use "cryptography" if encryption was intended
HIGH missing sleep-promise-fast-xyz-123 (npm) -> remove; no such package, a "sleep" helper is 3 lines of code
OK requests, redis, PyYAML (yaml), express, zod
Skipped: os (stdlib), payment_handler (first-party)
Not declared in manifest: redis, PyYAML (add to requirements.txt); express, zod (add to package.json)
Unknown (not checked): none
Verdict: BLOCK until the 2 HIGH findings are resolved and the 4 real packages are declared.
Connects securely to your tools. The creator never sees your data.
About this skill
AI coding assistants sometimes invent package names that sound right. Attackers register those names on PyPI and npm and wait for someone to run pip install or npm install. This is called slopsquatting, and one wrong install can put malware on your machine or in your build.
Hallucinated Package Checker gives your agent a fixed routine for stopping it. It pulls every new import from your diff (or your whole repo), skips the standard library and your own modules, and looks each name up in the real registry. Anything that does not exist is a high-severity finding. Anything that exists but looks suspicious (a name one or two letters from a famous package, or a first release in the last month) is flagged for a human decision.
It also catches a quieter bug: imports that work on your machine but are not listed in requirements.txt, pyproject.toml or package.json.
The checker is a short, readable Python script using only the standard library. It makes read-only requests to two hosts, pypi.org and registry.npmjs.org, sends only package names, installs nothing and writes nothing. A network failure is reported as "unknown", never as safe.
You end up with a short report: which packages are real, which are missing or look-alikes (with the likely intended name), and which are undeclared, plus a block or pass verdict.
This checks if a package exists and is popular, but it cannot guarantee a real package is 100% safe. It currently only supports Python and JavaScript.
Files: `SKILL.md`, `README.md`, `scripts/verify_packages.py` (about 14 KB, standard library only), `references/manual-checks.md`, `examples/`. Exit codes: 0 clean, 1 missing/similar/undeclared, 2 unknown. Network allow-list is enforced in code (`ALLOWED_HOSTS`). Permissions to expect in the scan: network (two named hosts, GET only), file read.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed today
- Free with an Agensi account
- Software
Python
Git
Permissions
What's inside
Frequently Asked Questions
New in Security
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.