Verifiers Gym uses YAML configs to map agent-facing tools to MCP tools, enabling flexible environment configuration without code changes.

Basic Configuration

configs/browser.yaml
# Define agent interface
system_prompt: |
  You are an AI assistant that can interact with a browser.
  
  Available tools:
  - screenshot(): Take a screenshot
  - click(x, y): Click at coordinates
  - type(text): Type text
  - done(): Complete the task
  
  Use <tool>function(args)</tool> format.

# Map agent tools to MCP tools
action_mappings:
  screenshot:
    _tool: "computer"
    action: "screenshot"
  
  click:
    _parser:
      positional: ["x", "y"]  # Expected arguments
    _tool: "computer"
    action: "click"
    x: {from_arg: "x"}
    y: {from_arg: "y"}
  
  type:
    _parser:
      positional: ["text"]
    _tool: "computer"
    action: "type"
    text: {from_arg: "text"}

Advanced Features

Argument Transformation

Transform arguments before passing to MCP:
scroll:
  _parser:
    positional: ["direction", "amount"]
  _tool: "computer"
  action: "scroll"
  coordinate: [640, 400]  # Static value
  direction:
    from_arg: "direction"
  amount:
    from_arg: "amount"
    transform: "lambda a: int(a * 120)"  # Convert to pixels

Context-Aware Transforms

Access other arguments in transforms:
key:
  _parser:
    positional: ["key"]
  _tool: "computer"
  action: "press"
  keys:
    from_arg: "key"
    transform: "lambda x: x.split('+')"  # "ctrl+a" → ["ctrl", "a"]

Static Values

Use fixed values instead of arguments:
# 2048 game directions
left:
  _tool: "move"
  direction: {static: "left"}

right:
  _tool: "move"
  direction: {static: "right"}

Parser Settings

Control agent output parsing:
parser:
  use_thinking: false  # Disable <think> tags
  xml_weight: 0.6     # XML format validation weight
  action_weight: 0.4  # Action syntax validation weight

rubric:
  weights:
    task_completion: 0.8    # Primary task reward
    tool_execution: 0.1     # Tool success rate
    format_compliance: 0.1  # Proper formatting

Usage

import verifiers as vf

# Use your config (path relative to where you run the script)
env = vf.load_environment(
    env_id="hud-vf-gym",
    taskset="your-org/your-taskset",
    config_path=configs/your-env.yaml"
)

Examples

Config files are located in the hud-python/rl/configs/:
  • 2048.yaml - 2048 game with directional moves
  • default.yaml - Browser/computer interaction