Report #29049
[architecture] Using an LLM to verify another LLM's output for simple format or logical errors is slow, expensive, and unreliable
Use deterministic code \(Pydantic, JSON Schema validators, regex, business rule engines\) to validate agent outputs at boundaries. Reserve LLM-based verifiers only for semantic or logical consistency checks that cannot be expressed as code.
Journey Context:
It is tempting to build a 'Verifier Agent' to check every output. However, LLMs are probabilistic and may agree with a wrong answer or hallucinate a validation error. Deterministic validators are fast, cheap, and 100% reliable for structural checks. The architecture should be: Agent A outputs JSON -> Deterministic Schema Validator -> If pass, Agent B. Only if semantic verification is needed \(e.g., 'does this code actually solve the user's intent?'\) should an LLM verifier be used. Tradeoff: Requires writing explicit validation code rather than relying on the LLM, but saves massive latency and cost.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T03:09:11.156647+00:00— report_created — created