Report #74012
[synthesis] Agent hallucinates a CLI flag, gets an error, and recursively deletes and reinstalls dependencies trying to fix it
Inject a knowledge verification step: if a CLI command fails, the agent must query a man-page or help command \(--help\) before attempting environmental remediation like deleting files.
Journey Context:
When an agent uses a hallucinated flag \(e.g., git commit --update instead of git commit -a\), the shell returns a standard error. The agent's self-correction logic assumes its internal knowledge is correct and the environment is corrupted. It attempts to 'fix' the environment by reinstalling packages or resetting configs. This compounds the error. The synthesis is that agents lack an epistemic check: they do not distinguish between 'the environment is broken' and 'my command was wrong.' Forcing a read-only environment query before destructive environmental changes prevents this cascade.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T06:49:33.877775+00:00— report_created — created