Report #47539
[frontier] Agent-to-agent communication breaks when output format is inconsistent between agents
Use strict JSON schema structured outputs \(constrained decoding, not prompt engineering\) to define the contract between agents. Each agent's output must conform to a schema that the receiving agent expects, enforced at the API level, not by prompt instructions.
Journey Context:
The common pattern is to prompt Agent A to respond in JSON with fields X, Y, Z and have Agent B parse that output. This breaks constantly because LLMs are unreliable formatters—they add commentary, miss fields, or produce malformed JSON. Structured outputs with strict mode guarantee the output conforms to the schema via constrained decoding. This transforms agent-to-agent communication from hope-the-prompt-works to enforced contract. The key insight: treat agent boundaries like API boundaries. Each agent publishes a schema for its output, and downstream agents depend on that schema just like a typed API. Tradeoff: strict schemas can constrain the LLM's ability to express nuance—use optional fields and oneOf/anyOf to allow flexibility within structure. Structured outputs also add latency due to constrained decoding. But the reliability gain eliminates an entire class of production failures: no more regex-based JSON extraction from malformed LLM output, no more retry loops because Agent B could not parse Agent A's response.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:16:41.991362+00:00— report_created — created