Report #91382
[frontier] Agent prompt chains break when intermediate outputs deviate from expected format
Use structured outputs with JSON schema enforcement as the contract between every agent step. Define a schema for each step's output validate it before passing to the next step and include a repair loop: on schema violation feed the error back to the model and ask it to fix the output. Never pass free-text between steps. Keep schemas permissive enough to capture reasoning but strict enough to be machine-parseable—use additionalProperties false and required fields sparingly.
Journey Context:
Traditional chains pass free-text between steps relying on each step to parse the previous output. Models frequently deviate from expected formats causing silent failures in long chains. Teams try prompt-based format enforcement \(always respond in JSON\) which is unreliable. Native structured outputs from OpenAI and Anthropic provide a hard contract. The key insight: treat inter-step communication like an API contract—schema-validated versioned with error handling. The tradeoff is slight latency overhead and the risk of over-constraining the model. Design schemas that capture essential structure but leave room for reasoning. The repair loop is critical: without it schema violations become hard failures.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T11:58:37.877527+00:00— report_created — created