Skip to content
AgentEnv Framework

Example Tasks

Tasks on computer envs, from a probe that needs no model to an agent that edits a spreadsheet in LibreOffice and is checked from inside the computer

These tasks run on the office desktop that Composing a computer environment builds: ubuntu-24.04 with cua-driver, LibreOffice and Chromium.

Run them

Start Docker, then run a task by name:

Terminal
agent-env run ./office --task probe
agent-env run ./office --task office-rehearsal
agent-env run ./office --task office
TaskWhat it doesNeeds
probeProbes the deployed computer at fullDocker
figuresLoads the seed into LibreOffice and reads it backDocker
officeAn agent adds a row in Calc while the screen is recordedDocker, a model endpoint
office-rehearsaloffice with the agent's part played without a modelDocker

The first run composes the images, 329 s from an empty store on an 8-core amd64 host, and later runs reuse them (What happens when you write it).

office deploys Claude Code, which needs a model endpoint that serves Anthropic's Messages API (Model Providers).

Add a row in Calc

office has an agent add the Q4 figures in Calc and save them:

tasks/office.json
[
  {"id": "env", "type": "deploy_env", "env_id": "desktop"},
  {"id": "files", "type": "load_artifact", "env_id": "desktop", "artifact_id": "figures", "depends_on": ["env"]},
  {"id": "agent", "type": "deploy_agent", "env_ids": ["desktop"]},
  {"id": "skills", "type": "add_skills", "env_ids": ["desktop"]},
  {"id": "record", "type": "start_computer_recording", "env_id": "desktop", "name": "agent", "depends_on": ["env"]},
  {"id": "task", "type": "prompt_agent", "depends_on": ["files", "skills", "record"],
   "prompt": "The quarterly figures are open in LibreOffice Calc on this computer. Add a row for Q4 under Q3, with revenue 165 and costs 97, then save the file as it is, a CSV. Reply DONE once it's saved."},
  {"id": "check", "type": "env_outcome_verifier", "env_id": "desktop", "file_artifact_id": "check_figures",
   "verifier_id": "q4", "depends_on": ["task"]},
  {"id": "end", "type": "end_computer_recording", "name": "agent", "depends_on": ["task"]}
]
  • files loads figures, an environment artifact named after libreoffice, through the app's data plane. Its two files land in ~/Office, and Calc reopens on figures.csv.
  • agent deploys the default agent, Claude Code, with the computer's /mcp, which serves 73 tools: the seven computer_* tools and cua-driver's 66.
  • skills installs the computer's desktop skill, led by cua-driver's own, and LibreOffice's.
  • check reads the saved file inside the computer through computer-exec/v1, which takes the deploy's control token. An agent can't reach it.
artifacts/check_figures/verify.py
"""Whether ~/Office/figures.csv holds the loaded quarters and the Q4 row under them, read inside the computer
through its driver's computer-exec."""
import csv
import uuid

from agentenv_protocol import client as protocol

EXEC = "urn:agentenv:computer-exec/v1"
EXPECTED = [["quarter", "revenue", "costs"], ["Q1", "120", "80"], ["Q2", "135", "86"], ["Q3", "150", "91"],
            ["Q4", "165", "97"]]


async def verify(mcp_url, env_url):
    card = await protocol.get_card(env_url)
    out = await protocol.invoke_extension(env_url, card, EXEC, {"argv": ["cat", "Office/figures.csv"],
                                                                "request_id": uuid.uuid4().hex}, method="run")
    rows = list(csv.reader(out["stdout"].splitlines()))
    saved = out["exit_code"] == 0 and rows == EXPECTED
    return [{"id": "q4", "result": saved, "description": "figures.csv has Q4 under Q1 to Q3" if saved else
             f"figures.csv holds {rows}"}]

It passes when the file holds the three loaded quarters and Q4,165,97, parsed as CSV, since Calc quotes text cells.

A run on Sonnet 5.5

Terminal
agent-env run ./office --task office --model claude-sonnet-5-5
Output (excerpt)
[tasks/office.json] step 6/8 task (prompt_agent)
[tasks/office.json] step 6/8 task done in 12.2s
[tasks/office.json] step 7/8 check (env_outcome_verifier)
[tasks/office.json] step 8/8 end (end_computer_recording)
[tasks/office.json] step 8/8 end done in 0.1s
[tasks/office.json] step 7/8 check done in 0.1s
[tasks/office.json] passed in 30.0s

Tasks:
  tasks/office.json v1: passed (check: 1), 30.0s, instance <instance id>
    models: solver claude-sonnet-5-5

Tore down 2 sandboxes.

Claude Code made six tool calls: LibreOffice's skill, list_windows, a screenshot, a click on A5, the row with computer_type, and Ctrl+S. It replied DONE, and the run cost $0.26:

RowResultDescription
q4truefigures.csv has Q4 under Q1 to Q3

Claude Code on Sonnet 5.5 during that run, from the computer's annotated recording, at half speed.

office-rehearsal plays the agent's part with play_office, a verifier, so the check passes without a model.

The shipped desktop tasks

The desktop bundle ships with the framework: ubuntu-24.04 on the reference driver, which serves only the computer_* tools:

Terminal
agent-env run desktop --task probe
agent-env run desktop --task files
agent-env run desktop --task agent

Probe

probe deploys the computer and runs the conformance probe at full, with no model. The office bundle has the same file:

tasks/probe.json
[
  {"id": "env", "type": "deploy_env", "env_id": "desktop"},
  {"id": "probe", "type": "env_outcome_verifier", "env_id": "desktop", "file_artifact_id": "check_probe",
   "verifier_id": "probe"}
]

The probe checks what the driver serves, then that clicks, typing, scrolls and drags in a test window land where they say. The score is 1 when every row passes or doesn't apply. agent-env task get-instance --id <instance id> lists the rows under metadata.verifications.probe.results. On the office desktop:

Output (summary)
Tasks:
  tasks/probe.json v1: passed (probe: 1), 16.2s, instance @local/~/office/probe-wdma6dhh

Files

files loads a CSV into ~/Documents and reads it inside the computer with a run_code script and a run_container_unit_tests_verifier command. It needs no model and passes with tests: 1.

Agent

agent has Claude Code move the CSV from ~/Downloads into a new ~/Documents/Reports folder. Its steps are office's, with another prompt and check.

Record the screen

start_computer_recording records a computer's display, and end_computer_recording stores the recording as one file artifact universe. Both are best effort: a failure is logged and the run goes on.

FieldDefaultMeaning
env_idrequiredThe computer to record
namerequiredThe recording's name in this run
fpsthe driver's default, 10Frames a second
max_edgethe screen's sizeThe longer edge in pixels, 64 to 8192
cursortrueShow the pointer
environment_namenoneIn a multi env, the computer to record
annotation_settings{"is_enabled": true}Draw each input over the frames; false records it plain
fail_task_on_errorfalseFail the run when the recording fails

The driver draws each input in its caller's colour: clicks as rings, keys and text as labels. A driver whose card lists no annotate records plain, with a warning.

The computer uploads H.264 MP4 segments itself, under a grant from the object store. The universe's id is the instance id, __recording- and the name:

Terminal
agent-env artifact file-artifact-universe get --id '<instance id>__recording-agent' --output-dir recording

It holds the segments and a manifest.json. The run's context keeps each recording's state under metadata.computer_recordings.<name>.

Warning: The computer must reach the object store

The start fails when the store's grants don't reach the computer's sandbox, or when the computer has no network.

Keep the agent to the screen

cua-driver's own tools act on apps through the accessibility tree or a script, and check passes however the row got there. Two settings keep an agent to the screen:

  • tools = "standard" on the computer env leaves it the seven computer_* tools (The computer tools). --set sets it for one run.
  • builtin_tools on deploy_agent limits the agent's own tools. Claude Code, Codex and OpenCode take it.
Terminal
agent-env run ./office --task office --set envs/desktop.tools=standard
The agent step, GUI-only
{"id": "agent", "type": "deploy_agent", "env_ids": ["desktop"], "builtin_tools": {"only": ["Skill", "Read"]}}

To hide only some tools, a modify_env_tool_access step disables them for a role. A reset_env drops its rule, so run it again after one.

Run it on another driver

--set swaps the driver for one run, as Swap the driver shows. The shipped desktop runs on cua-driver like this:

Terminal
agent-env run desktop --task agent --set envs/desktop.driver=cua-driver
Output (excerpt)
--set envs/desktop.driver=cua-driver: 1 env and 1 task written under ids ending in (desktop.driver cua-driver)

The task runs unchanged, and its agent sees cua-driver's 66 tools beside the computer_* ones. Its prompt asks for the computer_* tools alone; add --set envs/desktop.tools=standard to enforce it.

Last updated on

Ask a question · Report an issue

On this page