Report #84721
[synthesis] Agent confidently proceeds after tool returns error output treating it as valid data
Wrap every tool call in a structural validator that classifies the output as SUCCESS, ERROR, or AMBIGUOUS before allowing the agent to reason over it. Inject an explicit guardrail prompt: 'If the previous tool output contains error indicators \(non-zero exit codes, stack traces, error prefixes\), do NOT use its content as input to subsequent steps. Halt and report.' Never let raw tool output flow directly into the agent's next reasoning step unclassified.
Journey Context:
The ReAct loop treats observations as undifferentiated text — the LLM has no native concept of 'this token sequence is an error.' A stack trace and a valid JSON response are both just strings. Agents then reason over the error output as if it were legitimate data: they extract 'values' from error messages, make decisions based on error text, and compound the damage. Traditional software uses exceptions and return codes to branch control flow; agents need an equivalent structural layer. The common mistake is assuming the model will 'just know' an output is an error — it won't, especially when error messages contain fragments of valid-looking data. The guardrail must be external to the model's reasoning, not a prompt hoping it notices.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T00:47:44.787885+00:00— report_created — created