igbuend/grimbard/hallucinated-packages-anti-pattern
Claude Code and agent skill by igbuend/grimbard
- community
Checking that the SKILL.md file is still in the repository.
Security anti-pattern for hallucinated (non-existent) packages (CWE-1357). Use when generating or reviewing AI-assisted code that imports packages, dependencies, or libraries. CRITICAL AI-specific vulnerability with 5-21% hallucination rate. Detects dependency confusion and slopsquatting risks.
Install
npx vskill@latest install igbuend/grimbard/hallucinated-packages-anti-patternSKILL.md
Hallucinated Packages Anti-Pattern
Severity: Critical
Summary
AI models hallucinate non-existent software packages at rates of 5-21%. Attackers exploit this through slopsquatting: registering hallucinated package names with malicious code. Developers installing AI-suggested packages without verification execute attacker code, leading to malware execution, credential theft, and system compromise. This AI-specific supply chain attack exploits the trust gap between AI suggestions and package verification.
The Anti-Pattern
Never install AI-suggested packages without verifying existence, legitimacy, and reputation in official registries.
BAD Code Example
In this scenario, the developer follows the AI's instructions without question. The numpy-magic package is not a real library. An attacker, anticipating this hallucination, has published a malicious package with that exact name. The developer's pip install command downloads and executes the attacker's code, compromising their machine and potentially the entire project.
GOOD Code Example
Language-Specific Examples
JavaScript/Node.js:
Java/Maven:
Detection
- Verify Package Existence: Search official registries before installing:
- Python:
pip index versions <package-name>or visitpypi.org - Node.js:
npm view <package-name>or visitnpmjs.com - Reject packages created within 48 hours or with < 100 weekly downloads
- Check for Typosquatting: Compare against popular packages using
pip searchor fuzzy matching tools - Review Package Statistics: Check downloads, release history, maintainers, GitHub stars:
npm view <package> time created dist-tags downloads- Inspect package.json repository field for active GitHub repos
- Use Auditing Tools: Integrate into CI/CD:
npm audit/pip-auditfor known vulnerabilitiessocket.devfor AI hallucination detectionosv-scannerfor supply chain risks
Prevention
- [ ] Always verify a package's existence and reputation on its official registry before installing it.
- [ ] Never blindly trust a package name suggested by an AI. Treat it as a hint, not a command.
- [ ] Check package download counts, creation dates, and maintainer reputation.
- [ ] Use lockfiles (
package-lock.json,Pipfile.lock,yarn.lock) to ensure that you are always installing the same version of a dependency. - [ ] Configure a private registry or an approved list of packages for your organization to prevent developers from installing untrusted dependencies.
- [ ] Integrate dependency scanning and auditing tools into your CI/CD pipeline.
Related Security Patterns & Anti-Patterns
- Missing Input Validation Anti-Pattern: The core issue is a failure to validate the "input" from the AI model.
References
- OWASP Top 10 A03:2025 - Software Supply Chain Failures
- OWASP GenAI LLM03:2025 - Supply Chain
- OWASP API Security API10:2023 - Unsafe Consumption of APIs
- CWE-1357: Reliance on Unverified Package
- CAPEC-538: Open-Source Library Manipulation
- USENIX Study on Package Hallucination
- Socket.dev: AI Package Hallucinations
- Source: sec-context
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/hallucinated-packages-anti-pattern/SKILL.md
Popularity
- Repository stars
- 4
- Repository forks
- 1
- 7-day trend score
- 8
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 2 May 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/igbuend/grimbard/hallucinated-packages-anti-pattern)