Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>GhostPkg Shield — AI Hallucination & Slopsquatting GuardNew to Visual Studio Code? Get it now.
GhostPkg Shield — AI Hallucination & Slopsquatting Guard

GhostPkg Shield — AI Hallucination & Slopsquatting Guard

Aaditya

|
1 install
| (0) | Free
Real-time, zero-latency detection of AI-hallucinated ghost packages and slopsquatting vulnerabilities inside VS Code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

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:

{
  "aiHallucinationDetector.openaiApiKey": "your-openai-api-key-here",
  "aiHallucinationDetector.geminiApiKey": "your-gemini-api-key-here",
  "aiHallucinationDetector.checkNpm": true,
  "aiHallucinationDetector.checkPypi": true
}

Settings Reference:

  • aiHallucinationDetector.openaiApiKey: OpenAI API key (uses gpt-4o-mini for smart package correction suggestions).
  • aiHallucinationDetector.geminiApiKey: Google Gemini API key (uses gemini-1.5-flash for smart package correction suggestions).
  • aiHallucinationDetector.checkNpm: Enable or disable registry verification for npm packages (true by default).
  • aiHallucinationDetector.checkPypi: Enable or disable registry verification for PyPI packages (true by default).

🕹️ Usage

  1. Open any JS/TS or Python file containing package imports.
  2. If an AI assistant has suggested a fake/hallucinated package, the extension will automatically underline it in red.
  3. Click the red squiggly or press Ctrl+. (Cmd+. on macOS) to open Quick Fixes and select the AI-suggested replacement package.
  4. Alternatively, run GhostPkg Shield: Scan Current File from the Command Palette (Ctrl+Shift+P / Cmd+Shift+P).
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft