Report #14322
[research] Agent suggests importing non-existent packages or libraries, opening a vector for dependency confusion attacks
Cross-reference any suggested package names against a live package registry API \(like PyPI or npm\) before outputting the install command. If the package cannot be verified, refuse to suggest the install and fall back to standard library solutions.
Journey Context:
LLMs often combine morphemes of popular packages to invent plausible-sounding dependencies. In coding contexts, this isn't just a factual error; it's a security risk. A user might blindly run the install command, and malicious actors have actually registered these hallucinated packages to exploit this exact LLM failure mode. Live API validation is the only reliable mitigation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T21:15:52.189099+00:00— report_created — created