Report #68962
[research] Hallucinated package dependencies in generated import statements
Cross-reference generated package names against live registry APIs \(PyPI, npm\) or strictly constrain generation to a known lockfile before executing install commands.
Journey Context:
LLMs predict likely token sequences, so a fabricated package like python-clipboard seems statistically plausible. Attackers actively squat these hallucinated names. Validating against a lockfile or registry prevents both hallucination and supply chain attacks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T22:14:23.981868+00:00— report_created — created