Skip to content
Docs
Request access

Add an independent verifier

A verifier gate hands a task’s output to another agent. The verifier gets the task, the definition of done, the output and the canon. It never gets the worker’s messages or reasoning. This guide adds a second verifier gate to the dev-team template.

The template already has the three parts. Look at them before you add a gate.

  1. A role of kind verifier, with its own model, in nuramesh.yaml:

    - {id: reviewer, name: Independent reviewer, kind: verifier, default_model: fake/reviewer-1}
  2. An agent with that role, a policy that lets the role call its model and spend, and a budget for the agent:

    - {id: rhea, name: Rhea (reviewer), role: reviewer, reports_to: chief}
  3. A gate of kind verifier on a task in team.py, naming the agent:

    GateSpec(
    id="review",
    kind=GateKind.VERIFIER,
    checks=("safe-change",),
    config={"verifier": "rhea", "require_different_model": True},
    ),

    With require_different_model the gate refuses a verifier that uses the worker’s model. It is off unless you set it.

The tester’s task has only a rule gate. Add a verifier gate that checks the tester’s report.

  1. In my-team/team.py, find the task test. Replace its one-line criteria with two criteria.

    criteria=(
    Criterion(id="suite-green", text="Every test passes"),
    Criterion(id="report-honest", text="The report matches the test run"),
    ),
  2. Add the gate to the gates of test, after the green gate.

    GateSpec(
    id="report-review",
    kind=GateKind.VERIFIER,
    checks=("report-honest",),
    config={"verifier": "rhea", "require_different_model": True},
    ),
  3. Script the fake reviewer’s answer for the new gate, so the team still runs with --fake. In fake_model, above the line if request.model == "reviewer-1"::

    text = " ".join(message.content for message in request.messages)
    if request.model == "reviewer-1" and "whole test suite" in text:
    evidence = "The report says passed is true and the exit code is 0."
    return json.dumps({"criteria": {"report-honest": {"verdict": "met", "evidence": evidence}}})

    A verifier answers in a strict format: for every criterion it checks, a verdict and the evidence for it. The scripted answer of the fake model must follow it too.

  4. Run the team.

    Terminal window
    nuramesh try my-team --fake --approve-as human:you --allow-unsandboxed --run-id verifier-1

The tester’s task has a second gate line, passed by the verifier agent, not by a rule:

[done] verifier-1-test-suite (theo, attempts 1): Run the whole test suite on the fix
gate green (rule): passed by gate:rule
gate report-review (verifier): passed by agent:rhea

The verifier’s call is paid from its own budget: the rhea-monthly line in the report grows with every verifier gate.

You see Do this
'theo' doesn't have a verifier role The agent named in "verifier" must have a role of kind verifier
a verifier can't check its own work The verifier is the task’s own assignee. Name another agent
the verifier uses the worker's model require_different_model is on and both roles have the same default_model. Give the verifier role another model
gate '...' checks unknown criteria checks names a criterion that is not in the task’s criteria
The gate line says error by agent:rhea and the task is needs_human The verifier’s answer did not give a verdict for the criterion in checks. With the fake model, check the criterion id in step 3

Was this page helpful?