Report #69652
[research] Importing non-existent, hallucinated software packages
Constrain code generation to use only packages present in a provided \`requirements.txt\` or verified via a live registry API \(e.g., PyPI, npm\) check before outputting the code to the user.
Journey Context:
LLMs frequently invent highly plausible package names \(e.g., \`python-pdf-merger\` instead of \`PyPDF2\`\) because they learn naming conventions, not actual dependency graphs. This is both a factuality failure and a critical supply-chain security risk if a user attempts to install the hallucinated package. Relying on the model's internal weights is insufficient; grounding against an explicit allow-list or live registry is mandatory.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T23:23:41.875904+00:00— report_created — created