AI Wiki中文/EN

Computer-use agents: screens, pixels and checking the final state

计算机使用智能体

How agents that drive a whole desktop with mouse and keyboard are formulated, grounded and evaluated; why resolution and step budgets matter; and what isolation they need.

On this pageIntuitionMathematics & methodImplementationLimitationsExercisesResearch connections

Operating a computer the way a person does

A computer-use agent operates a whole computer through the same channels a person uses. It observes the screen through screenshots and sometimes an accessibility tree, and acts with raw mouse and keyboard events: move, click at coordinates, type, press hotkeys, scroll, drag. It can work across any desktop application, the web and the terminal, without an API for each program. Browser agents are the web-only special case, usually with element-level actions; this article covers the general desktop case.

That generality makes the task harder. The agent must turn “click the Rename item” into a pair of pixel coordinates, read dense screens such as spreadsheets, notice short-lived notifications, and recover from mistakes within a limited number of steps. Evaluation is harder too: a desktop task can be done in many ways, the computer must be reset between attempts, and a wrong click can delete real files.

This article relies on two sources. OSWorld is a research environment and benchmark that runs real operating systems in virtual machines and checks each task with its own evaluation script. OSWorld Anthropic’s October 2024 post describes, from the company’s side, how it trained a model to use a computer through screenshots and the results it reported. Company post The worked example is an original synthetic simulation: Gaussian click errors and a tiny spreadsheet-tab state machine in Python, with no model, screen or operating system.

Formulation, observations, actions and evaluation

The task as a POMDP

OSWorld formalises a computer task as a partially observable Markov decision process with states, observations, actions, transitions and reward. The observation is the instruction plus a screenshot, an accessibility (a11y) tree, or both. Actions are executable code, for example a right-click at coordinates (300, 540) or the hotkey ctrl-alt-t. An episode ends when the agent outputs DONE or FAIL, or at a step cap, which was 15 in the paper’s experiments. Formulation

The reward is execution-based and lies in [0, 1]: 1 or a partial value if the final state meets the goal, also 1 for correctly predicting failure on an infeasible task, and 0 otherwise. Reward Infeasible tasks are deliberate: an agent should be able to say that a request cannot be done rather than flail.

What the agent sees

The observation space includes a full-desktop screenshot with the mouse position and an XML accessibility tree, obtained via AT-SPI on Ubuntu and pywinauto on Windows. High-resolution images and long trees make long-horizon decisions hard. Observation space The baselines compared four input settings: a11y tree only, filtered to tag, name, text, position and size in a tab-separated table, from which the model must still output coordinates; screenshot only, at 1920×1080; screenshot plus a11y tree; and Set-of-Mark (SoM), where numbered boxes taken from the a11y tree are drawn on the screenshot and the model names an index that is mapped back to an action. Input settings

What the agent can do

OSWorld’s action space is every mouse and keyboard action expressed as pyautogui Python code, plus three special actions: WAIT, FAIL and DONE. The authors contrast this with web-specific action sets that cannot express, for example, a right-click or a ctrl-click. Action space Anthropic’s post describes the same grounding problem from the model side: the model looks at screenshots and counts pixels vertically and horizontally to move the cursor to the right place, and the company says training accurate pixel counting was critical. Pixel counting

A simple model shows why resolution and target size matter. Suppose the predicted click point has independent Gaussian errors with standard deviation σ pixels in x and y, centred on a target of width w and height h. Then the probability of landing inside it is

Phit=erf⁡ ⁣(w22 σ)erf⁡ ⁣(h22 σ)P_{\mathrm{hit}}=\operatorname{erf}\!\left(\frac{w}{2\sqrt{2}\,\sigma}\right)\operatorname{erf}\!\left(\frac{h}{2\sqrt{2}\,\sigma}\right)

If the screenshot given to the model is downscaled by a factor s below 1 and the model’s error is σ_m pixels in the small image, mapping the click back to full resolution multiplies the error:

σ=σms\sigma=\frac{\sigma_m}{s}

with an extra rounding error of up to 0.5/s pixels per axis if the model outputs whole pixels. These two formulas are teaching models introduced here, not results from the sources. They agree in direction with OSWorld’s finding that higher screenshot resolution typically improves performance and that inaccurate mouse clicks are a common error. Findings

Execution-based evaluation and its infrastructure

OSWorld runs tasks in virtual machines, which isolate the host from irreversible damage; snapshots allow fast resets, and several machines can run in parallel on one host. Infrastructure Each task has a configuration file for initial-state setup (download files, open applications, arrange windows), post-processing, getters that fetch files or data from the machine or the cloud, and an evaluator function with its parameters. Task configuration Tasks start from intermediate states, with software already open and work in progress, to resemble real situations in which people ask for help; setting up each example took about one person-hour. Initial states

The checkers are written per example: reading browser cookies to confirm that Amazon cookies were deleted, comparing a spreadsheet with a gold file by rules, or querying the accessibility tree of an email client. The benchmark has 134 unique evaluation functions, and answers that change over time use getters that fetch live values when the task is evaluated. Developing and checking an evaluation took about two person-hours per example. Evaluation scripts Checking the final state instead of comparing actions with a demonstration accepts any path that produces the result; the price is writing a checker for every task.

Step budgets and retries

A step cap interacts with error recovery. Suppose each step succeeds independently with probability p, the task needs L successful steps, and every failure is noticed and costs exactly one step to retry. Then the chance of finishing within B steps is a binomial tail, while the chance of finishing with no retries is p to the power L:

P(done within B)=∑n=LB(n−1L−1)pL(1−p)n−L=P(Bin(B,p)≥L),P(no retries)=pLP(\text{done within }B)=\sum_{n=L}^{B}\binom{n-1}{L-1}p^{L}(1-p)^{n-L}=P\left(\mathrm{Bin}(B,p)\ge L\right),\qquad P(\text{no retries})=p^{L}

This too is a teaching model, not a result from the sources. Its assumptions are optimistic: real errors are correlated, some go unnoticed, and some (deleting a file, sending an email) cannot be undone at any cost in steps.

What OSWorld measured

The benchmark has 369 Ubuntu tasks: 268 (72.6%) single-application and 101 (27.4%) multi-application workflows, 30 (8.1%) infeasible tasks, and 84 (22.8%) integrated from earlier datasets, with 302 distinct initial states and 134 evaluation scripts, plus 43 Windows tasks. Applications include Chrome, VLC, Thunderbird, VS Code, LibreOffice Calc, Writer and Impress, GIMP and operating-system utilities. Composition Quality control had authors who had not annotated a task attempt it, plus more than 400 person-hours over four rounds of checks; the authors say false positives and negatives could be reduced further. Quality control

Computer-science students unfamiliar with the samples and software solved 72.36% of tasks, with a median of 111.94 seconds per task. In OSWorld’s own comparison on 100 sampled WebArena tasks under the same setup, the same kind of participants took a median of 35.38 seconds and reached 88%. Human performance

The baselines used the most recent three observations and actions in chat form, temperature 1.0, top-p 0.9 and 15 steps; an earlier few-shot format gave 2.79% in the screenshot setting. Baseline setup Overall success in Table 5: GPT-4 with the a11y tree, 12.24%, the best; GPT-4V with screenshot only, 5.26%; GPT-4V with screenshot plus a11y tree, 12.17%; GPT-4V with Set-of-Mark, 11.77%; humans 72.36%. Table 5

Agents vary far more across task categories than humans, who stay around 70% in every category. Workflow tasks spanning several applications were generally below 5% for agents, and command-line-oriented operating-system tasks went better than GUI-heavy office tasks. Extra a11y information and SoM helped some models but not others; for GPT-4V, SoM scored below screenshot plus a11y tree, which the authors attribute to dense high-resolution screens such as spreadsheet cells and to coordinate-level operations that boxes cannot express. Analysis They still argue that screenshot-only is the long-run configuration, because a11y trees are not available or reliable for all software and can run to tens of thousands of tokens. Screenshot-only argument

For GPT-4V with SoM, success fell with human completion time: 16.78% on easy tasks (under 60 seconds for humans), 13.12% on medium and 4.59% on hard ones (over 180 seconds), against human rates of 84.91%, 81.08% and 49.57%. Infeasible tasks scored 16.67% against 13.34% for feasible ones, and single-application tasks 13.74% against 6.57% for multi-application ones. Some settings output FAIL too readily, which inflates success on infeasible tasks. Table 6 Further findings: more text history helps but image history does not, and agents are not robust to changes in UI layout and to noise. Findings

Anthropic’s post reported 14.9% on OSWorld for its model, against 7.7% for the next-best model in the same category, which the post defines as models that act from looking at the screen (in effect, screenshots) and human-level performance of generally 70–75%. Reported score This is a company-reported number; the post does not state the step limit, the number of runs or other protocol details, so it is not directly comparable with the paper’s rows.

Simulating clicks, checkers and budgets

The program has three parts, all synthetic. First, it compares the analytic hit probability with a simulation for three target sizes and three screenshot scales, using σ_m = 6 pixels in the model’s image, a target centred at (1000, 500) on a 1920×1080 screen, 4,000 trials and seed 11; the simulated agent outputs whole pixels in the small image. Second, it runs four trajectories through a toy tab bar for the task “rename Sheet1 to Budget” and judges them with a final-state check and with exact action matching. Third, it evaluates the step-budget formula with B = 15.

"""Original synthetic computer-use simulation. No model, screen or operating system is used:
clicks are Gaussian draws around a target centre, and the 'app' is a small Python state machine."""
import json
import math
import random

TARGETS = {
    'spreadsheet_cell': (64, 20),
    'toolbar_icon': (24, 24),
    'dialog_button': (96, 32),
}


def hit_probability(width, height, sigma):
    """P(|ex| < w/2) * P(|ey| < h/2) for independent N(0, sigma^2) errors in x and y."""
    return math.erf(width / (2 * math.sqrt(2) * sigma)) * math.erf(height / (2 * math.sqrt(2) * sigma))


def simulate_clicks(width, height, sigma_model, scale, trials, seed):
    """The agent sees a screenshot downscaled by `scale`, predicts an integer pixel there with
    Gaussian error sigma_model, and the harness maps it back by dividing by `scale`."""
    rng = random.Random(seed)
    cx, cy = 1000.0, 500.0
    hits = 0
    for _ in range(trials):
        px = round(cx * scale + rng.gauss(0, sigma_model))
        py = round(cy * scale + rng.gauss(0, sigma_model))
        x, y = px / scale, py / scale
        hits += abs(x - cx) < width / 2 and abs(y - cy) < height / 2
    return hits / trials


class ToySheetApp:
    """A spreadsheet tab bar with just enough behaviour for two ways to rename a sheet."""

    def __init__(self):
        self.tabs = ['Sheet1', 'Sheet2']
        self.editing = None
        self.menu = None
        self.buffer = ''

    def step(self, action):
        kind, arg = action
        if kind == 'double_click' and arg in self.tabs:
            self.editing, self.buffer = arg, ''
        elif kind == 'right_click' and arg in self.tabs:
            self.menu = arg
        elif kind == 'click' and arg == 'Rename...' and self.menu:
            self.editing, self.menu, self.buffer = self.menu, None, ''
        elif kind == 'type' and self.editing:
            self.buffer += arg
        elif kind == 'key' and arg == 'enter' and self.editing:
            self.tabs[self.tabs.index(self.editing)] = self.buffer
            self.editing = None


def run(trajectory):
    app = ToySheetApp()
    for action in trajectory:
        app.step(action)
    return app


def state_check(app):
    return app.tabs == ['Budget', 'Sheet2'] and app.editing is None


def action_match(trajectory, reference):
    return trajectory == reference


def success_with_retries(p, steps, budget):
    """P(at least `steps` successes within `budget` independent attempts), i.e. a failed step can be retried."""
    return sum(math.comb(n - 1, steps - 1) * p ** steps * (1 - p) ** (n - steps) for n in range(steps, budget + 1))


if __name__ == '__main__':
    grounding = {}
    for name, (w, h) in TARGETS.items():
        grounding[name] = {}
        for scale in (1.0, 0.5, 0.25):
            sigma_full = 6 / scale
            grounding[name][f'scale={scale}'] = dict(
                analytic=round(hit_probability(w, h, sigma_full), 4),
                simulated=round(simulate_clicks(w, h, 6, scale, 4000, seed=11), 4))

    reference = [('double_click', 'Sheet1'), ('type', 'Budget'), ('key', 'enter')]
    trajectories = {
        'reference_path': reference,
        'menu_path': [('right_click', 'Sheet1'), ('click', 'Rename...'), ('type', 'Budget'), ('key', 'enter')],
        'forgot_enter': [('double_click', 'Sheet1'), ('type', 'Budget')],
        'wrong_tab': [('double_click', 'Sheet2'), ('type', 'Budget'), ('key', 'enter')],
    }
    checking = {name: dict(final_tabs=run(t).tabs, state_check=state_check(run(t)),
                           action_match=action_match(t, reference))
                for name, t in trajectories.items()}

    budget = {f'p={p}': {f'L={L}': dict(no_retry=round(p ** L, 4),
                                          retry_within_15=round(success_with_retries(p, L, 15), 4))
                         for L in (5, 10)} for p in (0.8, 0.6)}
    print(json.dumps(dict(click_sigma_in_model_pixels=6, grounding_hit_rate=grounding,
                          execution_vs_action_matching=checking, step_budget=budget), indent=1))

Grounding against resolution. For the 64×20 spreadsheet cell, analytic and simulated hit rates are 0.9044 and 0.89 at full scale, 0.5908 and 0.5315 at half scale, and 0.2641 and 0.2497 at quarter scale. For the 24×24 toolbar icon they are 0.9111 and 0.8952, 0.4661 and 0.4047, and 0.1466 and 0.105. For the 96×32 dialog button they are 0.9923 and 0.9902, 0.8175 and 0.7885, and 0.4725 and 0.4078. The simulated values are lower mostly at small scales because whole-pixel output in the small image adds rounding error that the formula ignores. The thin dimension dominates: at full scale the 64×20 cell is about as hard to hit as the 24×24 icon.

Checking the final state against matching actions. The reference path (double-click the tab, type, press Enter) passes both checks. The menu path (right-click, Rename…, type, Enter) reaches the same final tabs, Budget and Sheet2, so the state check accepts it while action matching rejects it. The forgot_enter path leaves Sheet1 and Sheet2 unchanged, and the wrong_tab path produces Sheet1 and Budget; both checks reject both. Only the state check gives the right verdict on all four.

Step budgets. With B = 15, p = 0.8 and L = 5, success without retries is 0.3277, and with retries the program prints 1.0 at four decimals (the exact value is just below one). For p = 0.8 and L = 10 the values are 0.1074 and 0.9389; for p = 0.6 and L = 5, 0.0778 and 0.9907; for p = 0.6 and L = 10, 0.006 and 0.4032. Recovery turns hopeless odds into good ones, but only under the assumption that every error is noticed and costs one step.

Limits of the environment, the numbers and the safeguards

The OSWorld version read here is a preprint marked as under review. Its numbers come from 15-step episodes with specific prompting and the models tested at the time; a different step cap, prompt or history length would change them. The human comparison with WebArena is OSWorld’s own re-measurement on 100 sampled tasks, not WebArena’s reported human figure, which is discussed in agent evaluation. Hand-written checkers can still produce false positives and negatives, which the authors acknowledge.

Anthropic’s post lists its own limitations: the model was slow and often error-prone, could not yet perform actions such as dragging and zooming, and its “flipbook” of screenshots could miss short-lived actions or notifications; demonstration mishaps included stopping a screen recording. Limitations The post says training used a few simple programs such as a calculator and a text editor, without internet access during training, and reports the model correcting itself and retrying after obstacles. Training This article describes only that 2024 post, not later models or tool versions.

Safety is central. A computer-use agent reads whatever is on the screen, including emails and web pages written by others. Anthropic’s post flags prompt injection, where malicious instructions in screen content override the user’s task, as a risk, and describes misuse classifiers and, with the 2024 U.S. elections in view, monitoring of election-related use and steering the model away from posting on social media, registering web domains or interacting with government websites during the beta. Safety OSWorld’s use of virtual machines shows the basic isolation pattern: run the agent where a mistake cannot damage the host, reset from snapshots, and keep credentials out of reach.

The example’s models are deliberately simple: independent Gaussian errors centred on the target, a single tab bar with four trajectories, and fully recoverable step failures. Real click errors are biased by layout, real applications have far larger state, and some errors cannot be recovered.

Exercises

  1. Why does OSWorld check the final state (files, cookies, accessibility tree) instead of comparing the agent’s actions with a recorded demonstration?

    Answer: Many action sequences reach the same goal, such as a menu versus a double-click or a shortcut versus the mouse. Comparing with reference actions wrongly penalises valid alternatives, like the menu path in the example, while a state check accepts any path that produces the required result. The cost is writing a task-specific checker: 134 functions, about two person-hours per example.

  2. A model sees a screenshot at half resolution (s = 0.5) with σ_m = 6 pixels. Ignoring rounding, what is the hit probability for a 96×32 button?

    Answer: σ = 6 / 0.5 = 12. The first factor is erf(96 / (2√2 · 12)) = erf(2.83) ≈ 0.9999 and the second is erf(32 / (2√2 · 12)) = erf(0.943) ≈ 0.818, so the product is about 0.8175, which is what the program prints. The simulation with rounding gives 0.7885.

  3. A company post says its model scores 14.9% on OSWorld, while the OSWorld paper’s best baseline is 12.24%. Can you conclude that the company’s model is better?

    Answer: Not from these numbers alone. The 12.24% is GPT-4 with the a11y-tree input under the paper’s protocol (15 steps, specific prompting). The post compares within its own category of models that act from looking at the screen (next best 7.7%) and does not state the step limit, the number of runs or the task subset. Input settings, protocols and dates differ; you would need the same configuration and repeated runs.

  4. “Set-of-Mark annotations always improve grounding, because the model only has to name an index.” Is this right?

    Answer: No. OSWorld found SoM below screenshot plus a11y tree for GPT-4V (11.77% against 12.17%). SoM boxes come from the a11y tree, so elements missing from the tree, such as canvas content or cells in dense grids, cannot be marked, and coordinate-level operations such as dragging a slider to a value or selecting part of an image cannot be expressed as a box index.

  5. You want an agent to file expense reports in a legacy desktop application with no API, on employees’ own laptops. What would you put around it?

    Answer: First prefer an API or scripted integration if one exists, since it is cheaper and deterministic. If GUI control is necessary, run the agent in an isolated virtual machine or dedicated account rather than on the personal desktop; use the a11y tree where available plus screenshots at sufficient resolution; set a step cap with WAIT, FAIL and DONE semantics; check completion against the final state; require human confirmation before irreversible submissions; and treat on-screen text such as emails and web pages as untrusted input because of prompt injection.

Reading the literature

For any computer-use result, ask which observation the agent received (screenshot, a11y tree, both, or marked boxes), at what resolution, how many steps it was allowed, how success was checked and by whom, whether infeasible tasks were included, and how many runs were averaged. Company-reported numbers without these details are claims to note, not measurements to rank.

OSWorld contributes a reproducible desktop environment with virtual machines, task-specific setup and execution-based checkers, and it shows a wide gap between 2024 models and people, largest on multi-application workflows and dense GUIs. OSWorld Anthropic’s post documents one company’s approach of training a model to count pixels on screenshots, its reported score, and the safety concerns that come with letting a model operate an internet-connected computer. Company post Together they frame the open problems: precise grounding at realistic resolutions, recovery within a step budget, and safe operation when the screen itself may contain hostile instructions.

Make a prediction, then check

An agent renames a sheet correctly via the right-click menu instead of the recorded double-click path. Which evaluation counts it as a success?

Choose one answer

Learning objectives

  • Explain how screenshot, accessibility-tree and Set-of-Mark observations affect coordinate grounding, and use a click-error model to estimate the cost of lower resolution.
  • Design VM isolation, initial state, an execution-based checker and a step limit for a desktop task, and identify prompt-injection and irreversible-action risks.

Prerequisites & connections

Explore related knowledge →

References

  1. OSWorld: Benchmarking Multimodal Agents for Open-Ended Tasks in Real Computer Environments — scoped arXiv v2
    Tianbao Xie; Danyang Zhang; Jixuan Chen; Xiaochuan Li; Siheng Zhao; Ruisheng Cao; Toh Jing Hua; Zhoujun Cheng; Dongchan Shin; Fangyu Lei; Yitao Liu; Yiheng Xu; Shuyan Zhou; Silvio Savarese; Caiming Xiong; Victor Zhong; Tao Yu · 2024
  2. Developing a computer use model — scoped web post
    Anthropic · 2024

Version1 · Editorial status: Recorded technical checks completed

View technical check record (AI)

Claude · 2026-12-03 · Independent AI check (Claude subagent, not the author; not a human or expert review). Research was done by a separate research subagent (facts.md) and the prose by a writer subagent. The Gemini app style edits to the opening (intuition) sections, logged in gemini-edits-016a.json, were applied by the main session before this check; each logged old/new pair for this topic was compared and found to be style-only, with no change to facts, hedges or attributions, and the zh/en intuition sections still say the same thing. Ran example.py with python3 and diffed it against example.stdout.txt (identical); confirmed the python block is byte-identical in en.mdx, zh.mdx and example.py and display equations match; verified the negative-binomial/binomial-tail identity, recomputed exercise 2 (erf factors 0.99994 and 0.81758, product 0.8175) and computed the p=0.8, L=5, B=15 retry probability exactly as 0.999988, which confirms the prose parenthetical that the printed 1.0 is a value just below one. Downloaded the OSWorld v2 PDF and read with pdftotext sections 2.3-2.4, 3.2-3.4, 4.1-4.2, Table 5, the section 5 opening findings list, section 5.1 and Table 6 (369/268/101/30/84/302/134/43 tasks, ~1 and ~2 person-hours, >400 person-hours over four rounds, 72.36% and 111.94 s vs 35.38 s and 88%, 12.24/5.26/12.17/11.77, Table 6 rows, 2.79% few-shot, 'Preprint. Under review.'); fetched the Anthropic post of 2024-10-22 and read it in full (pixel counting, calculator/text-editor training without internet, 14.9% vs 7.7% 'in the same category' vs 70-75%, prompt injection, misuse classifiers, election measures, limitations). Confirmed the Gaussian click model, sigma scaling and retry formula are labelled teaching models and the 14.9%/7.7% are labelled company-reported. Compared zh and en section by section and checked data.json IDs and quiz answer. Not checked: OSWorld section 5.2 onward and appendices, Anthropic linked docs, rendered HTML.

  • example.py output matches example.stdout.txt; the retry case is exactly 0.999988, printed as 1.0 at four decimals, so the prose parenthetical is correct.
  • OSWorld composition, human study, Table 5 and Table 6 figures match the PDF; Anthropic's 14.9%/7.7% are labelled company-reported.
  • Gaussian click model, sigma scaling and retry formula are labelled teaching models, not source results; exercise 2 hand calculation is correct.
  • zh/en agree section by section; Gemini style edits did not change facts or attribution.

Source locations checked:

  • OSWorld: Benchmarking Multimodal Agents for Open-Ended Tasks in Real Computer Environments — scoped arXiv v2 · pdftotext of arXiv v2: abstract (369 tasks, 72.36% vs 12.24%); §1; §2.1 POMDP, action examples, 15-step cap, reward in [0,1] incl. infeasible; §2.2–2.2.3 VM, snapshots, config file, intermediate initial states, task-specific evaluation, Table 1 examples, live getters; §2.3 screenshot and a11y tree (AT-SPI, pywinauto); §2.4 pyautogui actions, WAIT/FAIL/DONE, Table 2; §3.1–3.3 apps, ~1 and ~2 person-hours, quality control >400 person-hours, Table 3 (268/101/30/84/302/134; 43 Windows); Table 4; §3.4 human study (72.36%, 111.94 s vs 35.38 s, 88% on 100 WebArena tasks); §4.1 settings (3-step history, temp 1.0, top-p 0.9, 2.79% few-shot, 1920×1080); Table 5 (verified in -layout extraction); §4.2; §5 opening findings list; §5.1 and Table 6. Not read: §5.2 onward (resolution, history, layout, cross-OS, qualitative analysis), appendices A–C.
  • Developing a computer use model — scoped web post · HTML fetched with curl and text extracted; whole article read (date 2024-10-22 from the page's dateTime). Checked: screenshots + pixel counting, training on calculator/text editor without internet, self-correction, OSWorld link text and 14.9% vs 7.7% vs 70–75%, ASL-2 statement, prompt injection, misuse classifiers and election-related measures, limitations (slow, error-prone, no dragging/zooming, flipbook view), demo mishaps. Not read: linked documentation, reference implementation, model card, any later updates or API docs.

Related topics

No matches. Try a synonym or acronym.

0 results shown

Wrap the whole query in double quotes for a phrase match.