Harness Options
Configure how the Trayn harness runs your agent against playgroundes.
Options
| Option | Type | Default | Description |
|---|---|---|---|
agentargs | AgentArgs | required | Agent factory — see Agent Interface |
url_override | string | — | Sandbox URL — fetches task dynamically from the backend |
headless | boolean | true | Run browser headless |
max_steps | number | 25 | Max actions per task |
viewport | object | 1280x720 | Browser viewport size |
log_level | string | info | debug, info, warn, error |
verbose | boolean | false | Show accessibility tree previews |
grader_endpoint | string | Trayn API | Custom grading endpoint URL |
session_id | string | auto | Session ID override |
run_id | string | auto | Run ID override |
user_id | string | — | User email for run attribution |
Usage
When url_override is provided, the harness fetches the task definition from the backend using the session ID embedded in the playground URL.
The harness parses the session ID from the URL, fetches the task definition (goal, verifiers, expected actions), and uses it to drive the agent run.
Programmatic Task Editing
Fetch the task definition, modify it, and push changes back to the backend:
Task Result
The harness returns a TaskResult for each completed task:
| Field | Type | Description |
|---|---|---|
task_name | string | Task identifier |
success | boolean | Whether the task was completed |
cum_reward | number | Total reward |
n_steps | number | Number of actions taken |
elapsed_time | number | Seconds elapsed |
err_msg | string | Error message if failed |