Report #38117
[architecture] LLM agents outputting malformed JSON breaks downstream agents in a chain
Enforce strict JSON Schema validation at the agent boundary using structured output decoding \(e.g., constrained decoding or tool calls\), and reject non-conforming outputs to the generator agent for retry.
Journey Context:
Prompting an LLM to 'return JSON' is unreliable; it frequently hallucinates keys or changes types. Downstream agents fail silently or hallucinate further when parsing bad data. Structured output modes guarantee syntax, but you must validate the schema semantically at the boundary to prevent cascading failures. Alternatives like regex extraction are brittle; schema validation is a hard contract.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:27:10.511284+00:00— report_created — created