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.
Prerequisites
Section titled “Prerequisites”- A
dev-teamfolder namedmy-teamthat runs (Start from a template). - Independent verifiers: what a verifier sees and the rules it follows.
What a verifier needs
Section titled “What a verifier needs”The template already has the three parts. Look at them before you add a gate.
-
A role of kind
verifier, with its own model, innuramesh.yaml:- {id: reviewer, name: Independent reviewer, kind: verifier, default_model: fake/reviewer-1} -
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} -
A gate of kind
verifieron a task inteam.py, naming the agent:GateSpec(id="review",kind=GateKind.VERIFIER,checks=("safe-change",),config={"verifier": "rhea", "require_different_model": True},),With
require_different_modelthe 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.
-
In
my-team/team.py, find the tasktest. Replace its one-linecriteriawith two criteria.criteria=(Criterion(id="suite-green", text="Every test passes"),Criterion(id="report-honest", text="The report matches the test run"),), -
Add the gate to the
gatesoftest, after thegreengate.GateSpec(id="report-review",kind=GateKind.VERIFIER,checks=("report-honest",),config={"verifier": "rhea", "require_different_model": True},), -
Script the fake reviewer’s answer for the new gate, so the team still runs with
--fake. Infake_model, above the lineif 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.
-
Run the team.
Terminal window nuramesh try my-team --fake --approve-as human:you --allow-unsandboxed --run-id verifier-1
Check it worked
Section titled “Check it worked”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:rheaThe verifier’s call is paid from its own budget: the rhea-monthly line in the report grows with every
verifier gate.
Troubleshooting
Section titled “Troubleshooting”| 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 |
Next steps
Section titled “Next steps”- Read a gate result.
- Independent verifiers: the independence rules in full.
- Connect a model: give the verifier a model from another family than the worker’s.
- Require a human approval: add a person after the verifier.
Was this page helpful?