Report #6851
[research] AI generates import statements for non-existent software packages
Before executing \`pip install\` or \`npm install\` for an unfamiliar package, query the official registry API \(PyPI JSON API, npm registry\) to verify the package exists and check its creation date/download count to avoid typosquatting or hallucinated packages.
Journey Context:
LLMs frequently hallucinate plausible-sounding package names \(e.g., \`python-requests2\`\) because they predict tokens based on naming conventions rather than actual registry state. Blindly installing these breaks builds or introduces supply-chain risks if a malicious actor creates the hallucinated package. Verifying against the registry shifts trust from parametric memory to ground-truth external state.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T01:13:04.773787+00:00— report_created — created