Skip to main content

Overview

Verifiers grade agent performance by running test scripts and producing reward signals. They validate that agents correctly completed tasks and provide quantitative feedback for evaluation. Every task includes a verification script that executes after the agent completes its work.

Verification Workflow

Verification Steps

  1. Upload Tests: Copy test scripts from task to environment
  2. Execute: Run the test script in the environment
  3. Parse Output: Extract rewards from output files
  4. Return Result: Package rewards into VerifierResult

Verifier Class

The Verifier class orchestrates verification:

Test Scripts

Verification scripts are located in the tests/ directory of each task.

Basic Structure

Critical: The test script MUST write rewards to either:
  • /logs/verifier/reward.txt (single numeric value)
  • /logs/verifier/reward.json (JSON object with multiple metrics)

Example: Simple File Check

Example: pytest-based Verification

Example: Multiple Metrics (JSON)

Reward Formats

Text Format (reward.txt)

Single numeric value:
or
Parsing:

JSON Format (reward.json)

Multiple named metrics:
Parsing:

VerifierResult

Verification produces a VerifierResult:
Example:

Verifier Configuration

Configure verification in task.toml:

VerifierConfig Model

Environment Variables

Verifiers can access environment variables:
Environment variables are resolved from the system:
LLM-based verifiers can use API keys from environment variables. You’ll incur costs for these API calls.

Verification Execution

The verify() method orchestrates the verification process:

Verifier Paths

Verifier files are stored in the trial’s verifier/ directory:
Path constants:

Error Handling

Verifiers define specific exceptions:
Handle errors in trial execution:

Disabling Verification

Skip verification for debugging or development:
Or in code:

LLM-Based Verifiers

Use LLM judges for subjective evaluation:
Configure in task.toml:
LLM-based verifiers incur API costs. Monitor usage carefully.

Best Practices

  • Make tests deterministic when possible
  • Test edge cases and boundary conditions
  • Provide clear pass/fail criteria
  • Document expected behavior
  • Use timeouts to prevent hanging tests
  • Use binary rewards (0/1) for simple tasks
  • Use continuous rewards (0.0-1.0) for partial credit
  • Use JSON rewards for multi-dimensional evaluation
  • Normalize rewards to comparable scales
  • Document reward semantics
  • Always write a reward file, even on failure
  • Log detailed error messages
  • Use set -e to catch script errors
  • Validate environment state before testing
  • Handle missing files gracefully
  • Keep verification fast (< 60 seconds ideal)
  • Cache dependencies when possible
  • Use efficient test frameworks
  • Parallelize independent tests
  • Set appropriate timeouts

Common Patterns

Unit Test Framework

Functional Test

Performance Test

Tasks

Task structure and test organization

Metrics

Aggregating verification results

Trials

Trial execution and verification

Environments

Execution environments for tests