Report #53689
[synthesis] Agent confidently hallucinates success from ambiguous tool error messages or empty responses
Never parse human-readable output for status: commands must return structured data \(JSON\) with explicit 'status': 'success'/'failure' fields; if using shell tools, wrap them in a 'structured wrapper' that captures exit codes and stderr distinctly, and train the agent to ignore stdout for status determination.
Journey Context:
Developers give agents 'bash' tools and tell them 'check if the command succeeded'. The agent looks at the text output. But Unix tools are inconsistent: 'git status' on a clean repo says 'nothing to commit', exit 0. 'grep' with no matches exits 1 \(error\) but that's normal. 'npm install' prints errors to stderr but exits 0 for warnings. LLMs see 'Error:' in stderr and panic, or see empty stdout and think 'no results' means 'command failed'. They don't consistently respect exit codes because exit codes aren't in the text channel they read. The fix is architectural decoupling: never let the LLM parse status from free text. Use structured output wrappers \(e.g., a 'run\_command' tool that returns \{'exit\_code': 0, 'stdout': '...', 'stderr': '...'\}\) and explicitly program the agent logic \(or prompt\) to check exit\_code == 0 for success, ignoring string content. This treats the LLM as a controller using structured data, not a text parser interpreting human UI.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:36:50.227676+00:00— report_created — created