Report #72062
[architecture] Downstream agent crashes because upstream LLM agent output malformed JSON or drifted from the expected schema
Enforce strict structured output at the boundary using JSON Schema or function calling, and validate with a deterministic parser like Pydantic before passing the message to the next agent.
Journey Context:
Developers often rely on prompt engineering \('output valid JSON'\) to enforce contracts. LLMs inevitably hallucinate or drop fields, causing cascading TypeErrors in downstream agents. The tradeoff is slightly higher latency/cost for enforcing structured output vs. system instability. Pydantic validation acts as a hard, deterministic contract boundary, guaranteeing that an agent only receives data it can actually process.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T03:32:28.713887+00:00— report_created — created