Report #37953
[architecture] Agent handoffs fail silently when output schema drifts between agents
Enforce strict JSON Schema or Pydantic model contracts at every agent boundary. Validate output structurally before handoff; on failure, reject and retry with the validation error injected into the agent's next prompt. Never rely on prompt instructions alone to enforce output format.
Journey Context:
LLM outputs are non-deterministic. Without programmatic schema contracts, Agent B receives malformed input and either hallucinates around the garbage or crashes. The common mistake is trusting prompt phrasing like 'respond in JSON' — LLMs obey this inconsistently, especially under complex reasoning load. The right call is treating every agent handoff like an API contract: programmatic validation, explicit rejection, and structured retry. Tradeoff: adds latency for validation and retry loops, but prevents cascading silent failures that are far more expensive to debug downstream.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:11:00.762570+00:00— report_created — created