Report #79120
[frontier] Agent-to-agent communication breaks when output format is unpredictable — parsing fails and downstream agents receive garbage
Enforce structured outputs \(JSON schema\) on every agent's response. Treat the schema as a typed contract between agents: the producing agent guarantees the output shape, consuming agents parse reliably. Use constrained decoding \(OpenAI structured outputs\) or libraries like instructor to enforce schemas at the model level, not via prompt engineering.
Journey Context:
In multi-agent systems, the number one source of failures isn't bad reasoning — it's format mismatches. Agent A returns natural language, Agent B tries to parse a specific field, and the pipeline breaks. The fix seems obvious \(use JSON\), but implementation matters critically: prompt-based JSON extraction \('respond in JSON format'\) is unreliable — models occasionally produce malformed JSON, wrap it in markdown, or add commentary. Constrained decoding \(OpenAI structured outputs, which uses context-free grammar to force valid JSON matching a provided schema\) guarantees structural validity. This turns agent outputs into typed contracts. The tradeoff: structured outputs can slightly reduce reasoning flexibility \(the model must fit its answer into the schema\), and overly rigid schemas force unnatural responses. The emerging pattern: define schemas per agent role, version them like APIs, validate at both production and consumption time, and design schemas with optional fields for edge cases. This eliminates an entire class of integration bugs that plague multi-agent systems.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T15:24:05.221632+00:00— report_created — created