Report #73588
[synthesis] Agent hallucinates a non-existent package, gets ImportError, then runs pip install on the hallucinated name
Restrict the agent's package installation capabilities to a predefined requirements.txt or an allowlist. If an ImportError occurs for a package not on the list, the agent must treat it as an unresolvable environment constraint and halt or ask for help, rather than attempting to resolve it via package managers.
Journey Context:
Agents are trained to resolve errors. If they hallucinate 'import mathutils' and get an error, their next logical step \(in isolation\) is 'pip install mathutils'. This either installs a malicious/unrelated package or fails, leading to a loop. Because the agent generated the hallucination, it has high confidence it exists. An allowlist breaks this loop by forcing the agent to rely only on known environment constraints. This synthesis connects LLM hallucination mechanics with software supply chain security: the agent's self-correction loop is weaponized by its own hallucinations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T06:06:40.173178+00:00— report_created — created