Skip to main content
This example demonstrates browser automation environments using two different modes: DOM mode (natural language actions via Stagehand) and CUA mode (vision-based control with low-level primitives). Both integrate with Browserbase for cloud browser management.

Overview

Verifiers provides two browser automation approaches: Both modes support:
  • Cloud browsers via Browserbase
  • Local browser automation
  • Sandbox deployment (CUA mode)
  • Screenshot capture and vision model integration

DOM Mode Example

DOM mode uses Stagehand’s AI-driven browser control for natural language interactions.

Complete Implementation

DOM Mode Tools

navigate(url) - Navigate to a URL
act(instruction) - Perform action via natural language
observe(instruction) - Find elements matching description
extract(instruction, schema_json) - Extract structured data

DOM Mode Interaction Example

Task: What does the headline say on the primeintellect.ai homepage?
Assistant: I’ll navigate to the homepage and extract the headline.Tool Call: navigate("https://primeintellect.ai")Tool Result: Navigation successful
Assistant: Now I’ll extract the main headline.Tool Call: act("read the main headline text")Tool Result: Found headline: “The Open Superintelligence Stack”
Assistant: The headline says “The Open Superintelligence Stack”.Judge: “yes”Result: ✓ Correct (reward = 1.0)

CUA Mode Example

CUA (Computer Use Agent) mode provides low-level vision-based browser control.

Complete Implementation

CUA Mode Tools

click(x, y, button="left") - Click at coordinates
type_text(text) - Type text into focused element
keypress(keys) - Press keyboard keys
scroll(x, y, scroll_x, scroll_y) - Scroll at position
goto(url) - Navigate to URL
screenshot() - Capture current state

CUA Mode Interaction Example

Task: Click the search button
Assistant: Let me take a screenshot to see the page.Tool Call: screenshot()Tool Result: [Image showing page with search button at (300, 150)]
Assistant: I can see the search button at coordinates (300, 150). I’ll click it.Tool Call: click(300, 150)Tool Result: Click successful
Assistant: Now I’ll type the search query.Tool Call: type_text("machine learning")Tool Result: Text entered
Assistant: Pressing Enter to search.Tool Call: keypress("Enter")

Mode Comparison

Running Browser Environments

Installation

DOM Mode Execution

CUA Mode Execution

Configuration Options

DOM Mode

CUA Mode

Key Features

Browserbase Integration

Both modes support cloud browsers via Browserbase:
  • No local browser installation needed
  • Scalable cloud infrastructure
  • Session recording and debugging
  • Proxy support for geo-targeting
Setup:
  1. Sign up at browserbase.com
  2. Get API key and project ID
  3. Set environment variables

Vision Model Integration

CUA mode integrates screenshots with vision models:

Sandbox Deployment

CUA mode supports three deployment modes: 1. Pre-built image (default, fastest)
2. Binary upload (custom server)
3. Manual (local development)

Metrics Tracked

DOM Mode

  • judge_reward: Answer correctness (0.0 or 1.0)
  • num_turns: Interaction count
  • total_tool_calls: Tools used
  • Per-tool counts: navigate_calls, act_calls, etc.

CUA Mode

  • judge_reward: Answer correctness (0.0 or 1.0)
  • num_turns: Interaction count
  • total_tool_calls: Tools used
  • Per-tool counts: click_calls, screenshot_calls, etc.
  • sandbox_ready_wait_time: Sandbox startup time

Advanced Usage

Custom Datasets

Create task-specific datasets:

Proxy Configuration

Screenshot Management

Next Steps