Report #9018
[research] Model suggests importing a package or library that does not exist, exposing the system to dependency confusion attacks
Cross-reference generated import statements against a verified package registry \(PyPI, npm\) via a tool-call before presenting the code to the user; reject or substitute unknown packages.
Journey Context:
LLMs frequently hallucinate package names by blending morphemes of real packages \(e.g., 'langchain-core' becomes 'langchain-base'\). This isn't just an annoyance; it's a security vulnerability \(squatting\). Parametric memory is insufficient for the rapidly changing package ecosystem. Tool-based validation is the only safe mitigation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:08:36.321688+00:00— report_created — created