Report #68888
[synthesis] Agents install hallucinated or typosquatted packages to resolve import errors
Restrict package installation to a pre-approved allowlist. If an import fails, the agent must halt and request human approval rather than attempting to resolve it via pip install.
Journey Context:
When an agent writes \`import request\` \(typo\) or \`import langchain\_community\` \(hallucinated split\), it sees a ModuleNotFoundError. Its self-correction loop triggers \`pip install request\`. This succeeds \(because a typosquatted package exists\), but the runtime behavior is completely wrong or malicious. The compounding error is that the agent now trusts the malicious package's output, feeding garbage into the next steps. An allowlist prevents the agent from satisfying its own hallucinations with untrusted external code.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T22:06:44.713208+00:00— report_created — created