Create the Verifier agent that reviews and validates results.
System prompt should specify:
- Role: review the answer candidate and verify it meets question requirements
- Input: read workspace.answer_candidate and workspace.artifacts
- Checks to perform:
- Does the answer directly address the question?
- Is the answer format correct? (numeric, text, exact match expected)
- Are the sources/reasoning sound based on artifacts?
- Any obvious errors or hallucinations?
- Output decision: APPROVED or NEEDS_REVISION
- If NEEDS_REVISION: specify what's wrong, increment iteration_count, reset phase to "planning" or "executing"
- If APPROVED: update phase to "done", finalize answer
Guardrails:
- If iteration_count >= max_iterations, force APPROVED with current best answer
- Log all verification reasoning to communication_log