Report #43631
[research] Hallucinating non-existent package names or library functions in generated code
Implement a programmatic registry check \(e.g., PyPI, npm\) for any imported package before presenting the code to the user; if it fails, trigger a retrieval step to find the correct package.
Journey Context:
LLMs frequently blend tokens to create highly plausible but non-existent packages. Simply lowering temperature doesn't fix this because the model has high confidence in these token blends. Programmatic validation is the only reliable guard because the model cannot self-correct without external grounding.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T03:42:22.604720+00:00— report_created — created