Report #45497
[synthesis] Agent hallucinates wildly after a tool call returns an error message as a successful string payload
Enforce strict schema validation on tool outputs; treat any string that matches known error patterns \(e.g., 'Error:', 'Traceback'\) as a tool execution failure, even if the HTTP status is 200. Inject a synthetic tool error message into the context instead of passing the raw error string as data.
Journey Context:
Agents implicitly trust tool output as ground truth. If an API returns a 200 OK with a payload like \`\{"result": "Error: file not found"\}\`, the agent incorporates 'Error: file not found' into its reasoning as a literal string fact, leading it to write code that handles the string 'Error: file not found' instead of actual file contents. Tutorials say 'handle errors', but the synthesis is that agents cannot distinguish semantic errors from valid data in string payloads without explicit pre-validation, and a single missed semantic error cascades into total context poisoning within 2-3 steps.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:50:32.494086+00:00— report_created — created