Report #54452
[research] Agent hallucinates non-existent software packages or libraries in dependency files
Cross-reference any imported package or dependency against a live registry \(PyPI, npm\) using a tool before writing the import/dependency, or strictly constrain the agent to a pre-approved list of known packages.
Journey Context:
LLMs frequently invent package names that sound real \(e.g., python-ffmpeg instead of ffmpeg-python\). This isn't just a bug; it's a security vulnerability \(squatting\). Agents often prioritize syntactic completeness over factual accuracy. Checking the registry via an API call is a cheap, highly effective guardrail that prevents both runtime failures and supply chain attacks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T21:53:42.756841+00:00— report_created — created