hallucination-detector

Detect hallucinated imports and fictional API calls in AI-generated code.

3|2|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/robotijn/ctoc --skill hallucination-detector-robotijn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hallucination-detector
Source: https://github.com/robotijn/ctoc/tree/main/skills/ai-quality/hallucination-detector
Command: npx skills add https://github.com/robotijn/ctoc --skill hallucination-detector-robotijn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

AI-generated code frequently contains non-existent package imports, fictional API calls, and plausible fake package names that attackers register for supply chain attacks, leading to runtime failures, security breaches, and costly post-deployment fixes.

Core Features & Use Cases

  • Registry Verification: Confirms every import exists on official package registries (npm, PyPI, Maven Central, NuGet, Cargo, Go modules) and checks for trusted provenance signatures.
  • API Accuracy Validation: Verifies function names, method signatures, and import paths match the actual library version to catch deprecated, renamed, or fictional calls.
  • Slopsquatting Risk Detection: Flags plausible hallucinated package names that attackers often register within hours of being suggested by LLMs, per 2026 supply chain threat research.
  • Use Case: When a developer uses AI to generate a payment processing module, this Skill catches hallucinated imports like 'stripe-checkout-pro' and incorrect Stripe API method signatures before code is merged, preventing runtime errors and supply chain compromises.

Quick Start

Run a full hallucination check on the AI-generated code in your project's src directory to verify all imports and API calls are valid and safe to merge.

Frequently Asked Questions about hallucination-detector

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect AI code hallucinations before merging?

To detect hallucinated imports in AI-generated code, you verify every imported artifact against official package registries and library type stubs. This confirms package existence and API signature accuracy to prevent runtime failures pre-merge.

What is slopsquatting in AI-generated code?

Slopsquatting is a supply chain threat where attackers register plausible fake package names hallucinated by AI models. Detecting slopsquatting risks involves flagging these fictional imports to prevent malicious packages from compromising your project dependencies.

Can I verify AI imports across TypeScript, Python, and Go registries?

Yes, you can verify AI imports across TypeScript, Python, Go, C#, Java, Rust, and SQL. The validation checks official registries like npm, PyPI, Maven Central, NuGet, and Cargo to confirm package existence and trusted provenance signatures.

How do I check for deprecated or fictional API calls in generated code?

You check for deprecated or fictional API calls by validating function names, method signatures, and import paths against the actual library version. This API accuracy validation catches incorrect calls before they cause production runtime errors.

Does hallucination detection work for supply chain security guardrails?

Yes, hallucination detection works for supply chain security guardrails by confirming package existence and signature provenance prior to production merge. It satisfies security requirements by verifying every imported artifact against official registries.