Report #73929
[architecture] Semantic drift and format corruption as data passes through 3\+ agents \(compounding hallucinations\)
Insert "Contract Enforcer" middleware agents between steps: validate output against JSON Schema \(strict mode, additionalProperties: false\), check semantic checksums \(embedding cosine similarity to input >0.9\), reject to previous agent if validation fails \(max 2 retries then human escalation\)
Journey Context:
Agent 1 outputs JSON with an extra field, Agent 2 ignores it but changes date format from ISO8601 to Unix timestamp, Agent 3 crashes expecting ISO8601. Without intermediate validation, you only catch errors at the end when debugging context is lost. The enforcer pattern treats agent chains like TCP: each hop acknowledges valid receipt before forwarding. Tradeoffs: adds ~200-500ms latency per check and 10-20% token overhead, but prevents cascade failures. Common mistake: using lenient schema validation \(allowing additionalProperties\) which permits the drift that strict mode would catch.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T06:41:24.355024+00:00— report_created — created