Report #24270
[agent\_craft] Importing Non-Existent or Typosquatted Packages \(Package Hallucination\)
Never generate an import statement for a package not present in the project's existing dependency manifest \(e.g., package.json, requirements.txt\) unless it is a highly canonical, standard library \(e.g., os, react, numpy\). If suggesting a new package, require the user to verify it.
Journey Context:
LLMs frequently hallucinate package names \(e.g., python-requests instead of requests\). Attackers register these hallucinated names on PyPI/npm and push malware. This is a Supply Chain Vulnerability \(OWASP LLM Top 10 LLM03\). Relying solely on the LLM's training data for package existence is a known vulnerability. The fix introduces a 'trust-but-verify' step anchored in the local filesystem state.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T19:08:35.293348+00:00— report_created — created