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
- Upload Tests: Copy test scripts from task to environment
- Execute: Run the test script in the environment
- Parse Output: Extract rewards from output files
- Return Result: Package rewards into
VerifierResult
Verifier Class
TheVerifier class orchestrates verification:
Test Scripts
Verification scripts are located in thetests/ directory of each task.
Basic Structure
Example: Simple File Check
Example: pytest-based Verification
Example: Multiple Metrics (JSON)
Reward Formats
Text Format (reward.txt)
Single numeric value:JSON Format (reward.json)
Multiple named metrics:VerifierResult
Verification produces aVerifierResult:
Verifier Configuration
Configure verification intask.toml:
VerifierConfig Model
Environment Variables
Verifiers can access environment variables:LLM-based verifiers can use API keys from environment variables. You’ll incur costs for these API calls.
Verification Execution
Theverify() method orchestrates the verification process:
Verifier Paths
Verifier files are stored in the trial’sverifier/ directory:
Error Handling
Verifiers define specific exceptions:Disabling Verification
Skip verification for debugging or development:LLM-Based Verifiers
Use LLM judges for subjective evaluation:task.toml:
LLM-based verifiers incur API costs. Monitor usage carefully.
Best Practices
Test Design
Test Design
- 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
Reward Signals
Reward Signals
- 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
Error Handling
Error Handling
- Always write a reward file, even on failure
- Log detailed error messages
- Use
set -eto catch script errors - Validate environment state before testing
- Handle missing files gracefully
Performance
Performance
- 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
Related Topics
Tasks
Task structure and test organization
Metrics
Aggregating verification results
Trials
Trial execution and verification
Environments
Execution environments for tests