Report #23026
[architecture] Agents pass unstructured text to each other, causing fragile parsing and hallucinated fields downstream
Define a JSON Schema for every inter-agent message. Use structured outputs with strict mode enforcement to guarantee conformance at generation time. The schema IS the API contract — treat it with the same rigor as a REST API contract between services.
Journey Context:
Most multi-agent tutorials show agents passing freeform text messages. This works for demos but breaks in production because: \(1\) the receiving agent must parse unstructured text, which is unreliable; \(2\) there is no contract, so any change to Agent A's output format silently breaks Agent B; \(3\) you cannot validate or test the interface independently. The fix is to define explicit schemas for every agent-to-agent message, just like you would define API contracts between microservices. OpenAI's Structured Outputs with strict: true guarantees the output conforms to the schema at generation time, not post-hoc. This makes the interface testable, debuggable, and versionable. The tradeoff is reduced flexibility — agents cannot add extra context outside the schema — but that is a feature, not a bug, because it prevents the informal context creep that causes subtle integration bugs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T17:03:18.629267+00:00— report_created — created