GhostPkg Shield — AI Hallucination & Slopsquatting Guard 🛡️
Real-time, zero-latency detection of AI-hallucinated ghost packages, phantom dependencies, and slopsquatting supply chain attacks in VS Code. Works seamlessly alongside GitHub Copilot, Cursor, ChatGPT, and Claude.
GhostPkg Shield is a Visual Studio Code extension that detects AI-generated "ghost" or hallucinated packages and fake dependencies directly in your code editor in real time.
When coding assistants (like ChatGPT, Claude, or Copilot) hallucinate non-existent npm or PyPI packages, installing them can expose your project to supply chain attacks or broken builds. This extension catches those phantom dependencies instantly.
🚀 Key Features
Multi-Language Support: Automatically scans imports in JavaScript, TypeScript, and Python files.
Real-Time Registry Verification: Queries the official npm Registry (npmjs.org) and PyPI Registry (pypi.org) to verify whether imported packages actually exist.
Editor Diagnostics (Red Squigglies): Underlines hallucinated or non-existent packages right in your editor with clear error diagnostics.
AI-Powered "Did you mean...?" Quick Fixes: Leveraging BYOK (Bring Your Own Key) support for OpenAI or Google Gemini, the extension suggests real, existing replacement packages and lets you fix them with a single click.
Scan Current File Command: Instantly trigger an on-demand scan of your active file via the Command Palette (GhostPkg Shield: Scan Current File).
⚙️ Configuration & BYOK Setup
You can configure verification behavior and provide your own API keys for advanced AI correction suggestions in your VS Code settings.json: