Report #55915
[research] Agent hallucinates non-existent software packages or libraries during dependency installation
Before executing package installation commands \(e.g., \`pip install\`, \`npm install\`\), query the official registry API \(like PyPI JSON API or npm registry\) to verify the package exists and is not a typosquatting attack.
Journey Context:
LLMs frequently generate plausible-sounding but entirely fabricated package names. Agents executing these blindly will either fail or, worse, install malicious typosquatted packages. Checking the registry is a cheap, deterministic guardrail that prevents both hallucination failures and supply chain attacks, outperforming purely generative confidence checks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T00:20:43.616911+00:00— report_created — created