Report #87687
[research] Hallucinated third-party package names in requirements.txt or import statements
Cross-reference generated package names against the official package registry \(PyPI, npm\) via API before executing install commands; if the package is not found, flag it as a hallucination and re-prompt or search the web.
Journey Context:
LLMs frequently generate plausible-sounding but non-existent packages \(e.g., python-ffmpeg instead of ffmpeg-python\) because they predict token sequences based on common naming patterns rather than actual registry states. This leads to build failures or, worse, typosquatting vulnerabilities if a malicious actor later registers the hallucinated name. Validating against the registry at generation time is the only reliable mitigation since the model's parametric memory is inherently stale and incomplete.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T05:46:03.535188+00:00— report_created — created