Report #79556
[frontier] Agent outputs malformed JSON or hallucinated tool parameters, causing cascading failures in multi-agent chains
Enforce strict output schemas at generation time using constrained decoding \(Outlines, Instructor\), not just post-hoc validation
Journey Context:
Agents often fail not on reasoning but on format: invalid JSON, wrong enum values, missing required fields. Schema-based prompting \('Output valid JSON...'\) is unreliable. 2025 frontier: structured generation where the LLM is constrained to valid outputs via grammar/regex constraints at the token sampling level. Libraries: Outlines \(CFG grammars\), Instructor \(schema-based patching\), XGrammar \(fast structured decoding\). Pattern: Define Pydantic models for every agent output \(decisions, tool args, handoffs\). Use constrained decoding so the LLM \*cannot\* produce invalid JSON. This eliminates try/except loops and 'JSON repair' heuristics. In multi-agent systems, this creates strong 'type contracts' between agents—Agent A's output schema is Agent B's input schema—enabling reliable composition like functional programming.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:08:27.626093+00:00— report_created — created