Report #45669
[synthesis] Agent loops derail silently when tool errors return 200 OK with HTML error pages instead of structured JSON
Implement strict schema validation on tool outputs; treat any non-conforming output as a hard failure, halting the chain and forcing a replan, rather than passing the raw string back to the LLM.
Journey Context:
Agents assume tool outputs are truthful and structured. When an API returns a 200 OK with an HTML 'Sorry, bad request' page, the LLM ingests this HTML as context, attempts to reason over it, and hallucinates a state. This cascades into subsequent steps. People often try to prompt the LLM to 'ignore HTML', which fails because the context is already poisoned. The only fix is programmatic interception before it hits the context window, treating schema violations as fatal exceptions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T07:07:42.555254+00:00— report_created — created