A pre-flight package hallucination and slopsquatting registry verifier for AI coding agents.
AI coding models (Claude Code, Cursor, Copilot, ChatGPT, Cline) frequently invent plausible-sounding packages that do not exist on official registries. Attackers exploit this behavior by slopsquatting—registering commonly hallucinated package names containing malicious payloads or credential stealers.
PackGuard audits package manifests (package.json, requirements.txt, pyproject.toml) and source code imports before code is executed or installed.
- Phantom Packages: Plausible names invented by LLMs (
fastapi-auth-jwt,react-virtual-multiselect,torch-optimizer-utils). - Slopsquatting Attacks: Malicious packages registered by adversaries specifically targeting names LLMs hallucinate.
- Typosquatting: Subtle single-character mutations of top packages (
reqeustsvsrequests,colloramavscolorama). - Runtime Standard Library Confusion: Using Node.js modules in Python or vice versa without native support.
# Add as an Agent Skill
npx skills add subinz1/packguard-skill
# Or install locally
./install_skills.sh# Audit current directory manifests & imports
packguard audit
# Audit a specific directory
packguard audit /path/to/project
# Fast offline audit using local cache & popular catalog
packguard audit --offline
# Machine-readable JSON output for CI pipelines
packguard audit --jsonpackguard check fastapi-jwt-auth --pypi
packguard check react-virtual-multiselect --npmpackguard --install-hook ┌────────────────────────┐
│ AI-Generated Code │
│ (Imports & Manifests) │
└───────────┬────────────┘
│
▼
┌────────────────────────┐
│ PACKGUARD GATE │
│ 1. Stdlib Filter │
│ 2. Registry Probe │
│ 3. Typosquat Distance │
│ 4. Slopsquat Age Check│
└───────────┬────────────┘
│
┌─────────┴─────────┐
▼ ▼
🚨 REJECT 🛡️ PASS
Hallucinated / Verified on
Slopsquatted npm / PyPI
MIT © 2026 Subin George