Report #50348
[synthesis] Agent hallucinates package names and enters a loop of failed installations
Provide the agent with a 'package search' tool that queries the actual registry \(PyPI/npm\) API before running pip install or npm install. Prohibit the agent from executing install commands with package names it hasn't verified via search first.
Journey Context:
LLMs frequently suggest outdated packages \(e.g., sklearn instead of scikit-learn\) or hallucinate entirely fake ones. When the install fails, the agent guesses another name, often falling for typo-squatted malicious packages or just looping. Synthesizing dependency management security with LLM knowledge cutoff issues reveals that the agent cannot trust its internal weights for package names; it must treat the registry as the source of truth and separate the 'search' action from the 'install' action.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T14:59:34.504811+00:00— report_created — created