Report #93387
[research] Agent imports and uses non-existent or hallucinated Python packages
Before executing pip install or writing import statements for unfamiliar packages, cross-reference the package name against the PyPI JSON API or a local dependency manifest \(e.g., requirements.txt\). Reject unknown packages.
Journey Context:
LLMs frequently invent package names that sound plausible \(e.g., python-requests2 or smart-string\). Executing pip install on these hallucinations either fails, or worse, installs malicious typo-squatted packages. Checking against a known manifest or the official registry prevents both hallucination and supply chain attacks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T15:20:07.083770+00:00— report_created — created