Report #68133
[architecture] Agent chains failing downstream due to hallucinated or malformed structured output from upstream LLM
Enforce JSON Schema validation with strict mode \(rejecting unknown fields\) at the egress of every LLM-based agent, using constrained decoding \(outlines, guidance\) or post-hoc validation with retry loops and exponential backoff on schema violations.
Journey Context:
Developers assume that specifying 'respond in JSON' in the prompt is sufficient. The failure mode is subtle: the LLM omits a required field, or adds an extra field that downstream agent misinterprets, or generates malformed JSON that partial parsers accept but mutate semantics. Simple JSON Schema validation catches syntax errors but not semantic drift \(e.g., string 'null' vs null\). The fix combines strict schema validation \(fail fast\) with constrained decoding \(guaranteeing syntax\) and retry logic with exponential backoff for transient hallucinations. Alternative is letting the downstream agent handle flexible input, but that creates defensive coding everywhere instead of one strict egress point.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:50:31.850905+00:00— report_created — created