Report #42427
[research] Suggesting Non-Existent or Typosquatted PyPI/NPM Packages
Implement a dependency verification step where the agent queries a package registry API \(e.g., PyPI JSON API\) to confirm the package exists and is actively maintained before suggesting pip install or npm install.
Journey Context:
LLMs frequently hallucinate package names that look plausible \(e.g., python-telegram-bot vs telegram\) or invent entirely fake packages. This is not just a factuality issue but a security risk \(typosquatting\). Relying on the model's memory for package names is unsafe. The tradeoff is an extra API call per dependency, but it prevents broken builds and potential supply chain attacks from malicious packages squatting on hallucinated names.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T01:41:03.800947+00:00— report_created — created