Computer Use: the GUI as an Action Space
Computer use lets an agent reach software that lacks a suitable machine interface for the work at hand. It can operate a vendor portal, a desktop application, or a canvas whose useful controls are available only through the interface built for people. That reach is valuable, but indirect. A screen is an observation; pointer and keyboard events are actions. Neither a visible button nor a logged-in browser tells the harness whether the user authorized the effect behind the button.
The practical rule is therefore narrow: prefer the typed tool when an API, command, or semantic UI operation expresses the intended effect and its authorization. Use computer vision and coordinates where structure is absent, incomplete, or unreliable. Computer use is a universal fallback for rendered software, not a universal replacement for machine interfaces. A capable system can switch representations within one task, but every channel must feed the same run and effect ledger described in Chapter 41.
This chapter develops that fallback as a partially observed control loop. It separates seeing, grounding, acting, and verifying; defines the contract between a model and an executor; shows why retries can duplicate real effects; and explains how to evaluate the whole system without confusing a grounding score with successful work.
From scripted interfaces to learned control
Screen-driven automation predates current multimodal models. World of Bits exposed web pages through both pixels and the DOM, with mouse and keyboard actions, in 2017 (Shi et al. 2017). Traditional browser automation and robotic process automation use selectors, accessibility properties, or recorded coordinates. Learned computer-use systems add a policy that can interpret unfamiliar layouts and propose actions from visual or structured observations. Anthropic's 2024 public beta brought that pattern to a frontier-model product: screenshots entered the model, while a developer-supplied tool executed the requested mouse and keyboard actions (Anthropic 2024).
Learned grounding does not make interface drift disappear. A visual policy may survive a changed DOM path and fail after a theme, scale, icon, or layout change. A semantic locator may survive a cosmetic redesign and fail when a custom widget omits its accessible name. These methods fail under different changes. The useful question is not whether pixels or selectors are inherently robust, but which observation and action channel exposes enough stable identity for this operation.
A partially observed control loop
Let be the hidden application state at step . It includes more than the visible page: active account, selected records, open dialogs, unsaved edits, remote service state, focus, clipboard, downloads, and windows outside the current viewport. The executor returns a partial observation
where is the observation process and is capture metadata such as the window, viewport, resolution, scale, cursor, timestamp, and selected modalities. The observation may contain a screenshot, a DOM or accessibility-tree subset, detected elements, the current URL, and focus metadata. It is evidence about , not the state itself.
Given the history , user instruction , and remaining budget , a policy proposes an action according to
Here is the policy, and the expression denotes its distribution over the next action under that history, instruction, and budget. The executor validates and dispatches the selected action. The environment then changes according to
where is the transition process and collects effects the agent does not control: network delay, animation, a popup, another actor, or a remote failure. A task succeeds only when an independent verifier establishes the required postcondition before a step, time, or cost horizon. Every symbol in these equations names a component that an implementation must record or bound; none assumes that the model sees the hidden application state.
This formalism matters because a partial observation can be plausible and wrong. A screenshot can omit a dialog behind the current window. A tree can be stale. A click can succeed remotely just before the browser crashes. The model's statement that the task is done is another proposal, not proof.
One interaction step should therefore be explicit:
- Capture an observation with an identity, timestamp, coordinate frame, window, focus, and selected modalities.
- Let the model propose one action or a small, bounded batch.
- Resolve the semantic intent, target origin, account, resource, payload, and expected effect.
- Check authorization, approval, freshness, focus, coordinate bounds, and actionability outside the model.
- Dispatch with an action ID and deadline.
- Wait for an observable condition, not an arbitrary sleep, then recapture after each state-changing action.
- Return executor evidence and verify the intended postcondition. Distinguish
executed,rejected,timed_out, andoutcome_unknown.
The boundary can be represented by three deliberately boring records:
UIObservation {
frame_id,
captured_at,
window_id,
viewport,
focus,
screenshot_ref,
semantic_elements,
visible_dialogs
}
UIAction {
action_id,
frame_id,
window_id,
viewport,
kind,
target,
payload_ref,
precondition,
postcondition,
risk_class,
approval_id,
timeout
}
UIResult {
action_id,
status,
dispatched_at,
completed_at,
new_frame_id,
observed_effect,
remote_receipt,
error
}
The executor rejects a stale frame, an invalid or out-of-bounds point, a focus mismatch, an expired approval, or a target whose identity has changed. If an image was downscaled before inference, coordinate remapping must use the recorded transform in both directions; current vendor guidance explicitly warns that coordinates refer to the original screenshot resolution (OpenAI 2026). Before a consequential click, recapture and revalidate the active window, origin, target, and exact payload. Batching stops at every side-effect boundary.
Pixels, structure, marks, and tools
A GUI system has more than two representations. Each reveals a different part of the state and supplies a different kind of target identity.
Screenshot pixels. They preserve visual layout, custom drawing, icons, spatial relationships, and canvas content. They struggle with small or occluded targets, resizing errors, the absence of stable element identity, and invisible or offscreen state.
DOM or accessibility tree. These expose names, roles, values, hierarchy, and sometimes node-addressed actions. They can omit custom widgets, include hidden or offscreen attacker text, return stale nodes or noisy dumps, and leave visual position ambiguous.
Detected elements or set of marks. These create a compact bridge from regions to stable labels for one frame (Yang et al. 2023). They inherit detector omissions, duplicate labels, overlays that obscure content, and movement that invalidates the labels.
API or typed tool. This channel supplies explicit arguments, validation, return values, and often idempotency or audit support. Its limits are coverage, integration work, schema drift, and operations the interface does not expose.
Coverage and identity are separate concerns. Pixels have broad visual coverage but weak identity. A tree can name an element while failing to show that it is covered by a modal. A typed operation can identify the resource precisely but omit a visual judgment the task requires. Structured observations are also untrusted content: a stale accessibility tree or attacker-controlled label is not safer merely because it is machine-readable.
Use the strongest channel that faithfully expresses the operation. Read a chart visually if its information exists only in the rendering. Use a semantic element action when its role and identity are current. Call an API for a payment or deletion when that API provides precise resources, authorization, idempotency, and receipts. A hybrid policy should be tested against pixel-only and structure-only alternatives under the same model, tasks, and harness; OSWorld's original ablations did not establish one representation as universally best (Xie et al. 2024).
Grounding, execution, and verification
"Click the Save button" hides at least five separate problems:
- Intent and planning: decide that saving is the next useful operation.
- Target identification: distinguish the document's Save action from similar controls.
- Grounding: map that target to a point, node, or semantic handle in the current observation.
- Execution: deliver the event to the intended window and control.
- Outcome verification: establish that the correct document was saved, not merely that the button changed appearance.
ScreenSpot-Pro isolates the third problem. It evaluates point-in-target grounding in high-resolution professional applications across operating systems. Its strongest previously tested model reached 18.9%, while cascaded visual search reached 48.1% (Li et al. 2025). That result demonstrates substantial grounding difficulty in this setting. It does not prove that grounding dominates planning, operational knowledge, recovery, or verification in end-to-end work.
Small targets expose two independent engineering failures. Downsampling can erase useful detail; resizing without a consistent transform can shift every coordinate. Zooming, cropping, and higher-resolution tiles can help the first problem, while explicit coordinate frames solve the second. Current computer-use schemas include zoom actions for this reason, but zoom changes the observation and invalidates coordinates from the earlier frame (Anthropic 2026).
The lower layers shape apparent agent intelligence. Capture resolution determines what the model can see. Viewport and crop policy determine what is omitted. Transport and model latency make observations stale. The sandbox determines which windows, files, clipboard contents, and network destinations exist. A grounding failure can therefore originate in the sensor or executor rather than in the policy. Record those layers before attributing an error to reasoning.
Reliability is reaching a verified state
For a fixed path of required steps, let mean that step achieved its postcondition. Define the conditional step probability
where denotes all required step outcomes before . The chain rule then gives
The familiar is only the homogeneous independent special case in which every conditional probability equals and any failure is unrecoverable. GUI errors are correlated: one wrong window can poison several later actions; a slow page can cause repeated stale clicks; a recovery action changes both the horizon and future probabilities. For an interactive policy, the useful quantity is the probability of reaching a verified goal state before its horizon, including recovery behavior.
OSWorld-Human makes efficiency visible alongside completion. In its evaluated systems, model calls dominated latency, later steps could take much longer than early ones, and the best agents used 2.7--4.3 times as many steps as the human-authored reference trajectories required (Abhyankar et al. 2026). These are measurements of particular agents and tasks, not a universal multiplier. They do show why task success alone hides operational quality.
Retries require effect semantics. A read, zoom, or fresh screenshot is usually safe to retry. A send, purchase, delete, permission change, or form submission may not be. If a timeout occurs after the remote effect but before the next observation, blind replay can duplicate it. A mutation is safe to retry only when it is idempotent or authoritative current state proves that the effect did not occur. Otherwise inspect and reconcile using a receipt, application history, or remote state. If the outcome remains ambiguous, enter needs_reconciliation rather than clicking again.
Approvals follow the same rule. An approval for an irreversible action is bound to the exact payload, target, origin, account, price or data disclosure, and current state. It is single-use and expires. A changed screen or payload requires a new approval; approval of a broad goal is not approval of every click used to pursue it. Stopping or restoring the local environment cannot undo an effect already committed to a remote service.
The environment is part of the system
Not every task needs a full desktop. A browser-only environment is enough for a web workflow; a full desktop is required when the task crosses native applications, system dialogs, or local files. Whichever boundary is chosen, the environment owns state that the model does not: browser profiles and cookies, downloads, clipboard, files, notifications, multiple windows, popups, extensions, locale, scale, and authentication challenges.
Keep three kinds of state distinct:
- Application state is the local and remote state changed by the user's task.
- Session state is the browser or desktop profile, credentials, files, clipboard, network identity, and environment configuration.
- Model context is the lossy history supplied to the policy.
Restoring model context does not restore application state. Restoring a VM snapshot does not reverse remote application state. Reusing session state can leak one run's data or authority into another.
Run computer use in a fresh, isolated browser context or desktop environment with the minimum necessary account and network access (OpenAI 2026; Anthropic 2026). Never attach the agent to a host browser profile containing personal history, extensions, saved cards, or a password manager. Disable shared host mounts and clipboard bridges unless the task specifically needs them. Keep browser-control, remote-debugging, and display endpoints private, authenticated, and scoped to one session. Downloads go to quarantine and are not opened or executed automatically; uploads and sharing pass through the same data-loss and approval checks as any other transmission.
Isolation also has layers. A fresh browser profile separates session data. A browser sandbox and site isolation constrain hostile renderers. A hardened container or microVM protects the host. Network and account policy constrain remote effects. None substitutes for the others, and an ordinary container is not a separate operating-system kernel (Souppaya et al. 2017; Chromium Project 2026).
The interface is an injection and privacy surface
Pixels, OCR, page text, DOM nodes, accessibility labels, email, PDFs, downloads, and tool results are untrusted data, not authority. They may describe what the agent should do, but only direct user instructions and external policy can authorize a new target, data flow, or side effect (OpenAI 2026). An authenticated browser carries ambient authority through its cookies. If page content can make the agent read one origin and type its data into another, the agent becomes a confused deputy across boundaries that normal browser code could not cross.
Authorization must therefore happen outside the model for every proposed effect. Resolve the authenticated user and tenant, current origin and account, target resource, semantic action, exact arguments, data being disclosed, remaining budget, and required approval. An allowed domain does not make its content trusted: it can host user text, third-party frames, redirects, malicious ads, or compromised pages. Navigation policy must recheck the scheme, host, port, resolved destination, redirects, and access to local, private, and metadata networks.
A prompt-injection detector can reduce exposure, but a classifier is not authorization. If it misses an attack, the policy layer must still prevent unauthorized sending, publishing, purchasing, deletion, installation, permission changes, acceptance of legal terms, and disclosure of sensitive data. WASP evaluates this end to end and finds that realistic, low-effort injections can divert capable web agents (Evtimov et al. 2025). Treat attack success, partial attack progress, and privileged effects as separate outcomes; failure to finish an attack may be security by incompetence, not a durable control.
Privacy starts before model inference. A screenshot or structured tree can contain names, account identifiers, notifications, input values, browsing history, one-time codes, and data outside the intended task. Capture the smallest relevant window or viewport, mask sensitive regions before upload where possible, and avoid raw screenshot logging by default. Store necessary artifacts encrypted, per session, with narrow access and short retention. Pause both model actions and capture during trusted user takeover.
Typing sensitive data counts as transmission (OpenAI 2026). Human typing alone does not guarantee secrecy: the next screenshot, DOM value, autofill popup, or account page can reveal it. Prefer a scoped credential or action broker. If a person must enter a password or one-time code, transfer control through a trusted surface outside the agent, suspend capture and model actions, clear transient UI, and resume with reduced authority. The model should not receive reusable credentials.
Place approval at the point of risk, immediately before the commit action. Show the person the exact site and account, recipient or target, payload, disclosed data, amount, and irreversible effect. Bind approval to an immutable action ID or payload hash, revalidate the fresh screen and origin after approval, and require another approval if anything changed. Text on the screen can never approve itself.
What a trajectory costs
Computer use consumes a trajectory, not one model call. A useful accounting identity is
where the cost of step is
with critical-path latency
Here is the number of attempted steps, including recovery; is inference cost; is image processing or image-token cost; is browser, container, or VM-seconds; and covers capture, dispatch, storage, and verification. is the non-overlapped wall time on step across capture, transport, inference, dispatch, settling, and verification. Each term should be measured, not inferred from a universal GUI-to-API multiplier.
Batching can reduce model calls, but it spends freshness: the later actions are chosen without seeing intermediate state. Parallel actions are safe only when their resources and effects are independent. Report task success together with action count, model calls, tokens, wall time, tail latency, VM-seconds, retries, and human intervention. Report both all-attempt cost and cost conditioned on success; the latter alone hides expensive failures.
Evaluate the system you actually run
A grounding benchmark asks whether a model identifies the right target in a supplied image. An end-to-end task benchmark asks whether the model, harness, executor, environment, and verifier reach the required state. ScreenSpot-Pro measures the first. OSWorld measures the second on desktop applications: its original 369 tasks reported 72.36% for humans and 12.24% for the best tested agent (Xie et al. 2024). AndroidWorld adds 116 parameterized tasks across 20 mobile applications, with programmatic setup, success checks, and teardown; its original results also showed that task variations can materially change performance (Rawles et al. 2025).
These numbers are not points on one timeless curve. Benchmark tasks, environment images, application versions, observation and action interfaces, maximum steps, prompts, retries, and verifiers change. Original OSWorld and OSWorld-Verified results are not directly comparable, nor does a later agent score on a revised benchmark cross the original human baseline. OSWorld 2.0 deliberately changes the problem again: its 108 workflows are much longer and expose failures involving constraints, changing information, hidden state, asking the user, and verification (Yuan et al. 2026). The benchmark version and harness are part of every score.
Use a state-based verifier that reads authoritative application or service state. A final screenshot and the model's self-report are weak evidence. For each run, record the task and initial state, benchmark commit, environment image, application versions, resolution, scale, locale, account, network conditions, observation sources, action interface, model snapshot, prompt, harness and verifier versions, limits, retries, and exclusions. Report completion with a bootstrap confidence interval and stratify by application, task horizon, and risk where sample size permits.
A release evaluation should cover four families of evidence:
- Capability: task completion, grounding accuracy, invalid-action rate, stale or out-of-bounds actions, unnecessary steps, and model calls.
- Efficiency: wall time, tail latency, tokens, cost, VM-seconds, retries, and human intervention.
- Recovery: success after delayed rendering, moved or occluded targets, popups, focus theft, stale accessibility tree, network retries, authentication challenges, crashes, and an ambiguous duplicate action.
- Safety: side-effect precision, approval-bypass rate, prompt-injection attack success, sensitive-data exposure, post-cancel action count, unauthorized-origin attempts, and effects committed after timeout.
Test those faults deliberately. Vary resolution, scale, theme, locale, and window size. Insert animation, delayed loading, overlays, duplicate controls, focus changes, and stale structure. Crash after a click but before the result observation. Inject an instruction into visible content and into a structured label. A system that passes only the clean path has not demonstrated reliable computer use.
A deployment checklist
Before exposing a GUI action surface, verify that:
- the typed or semantic alternative was considered first;
- every observation has a frame, window, viewport, scale, focus, and timestamp;
- coordinates and semantic handles are checked against fresh state;
- every mutation declares a precondition, postcondition, risk class, and retry policy;
- approvals bind to the exact target, payload, account, and current state;
- ambiguous outcomes enter reconciliation instead of blind replay;
- the browser or desktop is isolated from host profiles, credentials, files, and control endpoints;
- capture, logs, clipboard, downloads, uploads, and retention have explicit privacy rules;
- an independent verifier checks current state; and
- evaluation reports the complete model--harness--environment configuration.
Computer use may remain a long-lived compatibility layer, or its use may shrink as more products expose agent-facing tools. Neither outcome needs a universal claim. Structured operations are attractive when they provide stable identity, precise authorization, lower latency, and auditable results. Visual control remains useful for legacy software, custom rendering, cross-application workflows, and tasks whose content is inherently visual. The boundary is empirical and operation-specific: route each effect through the safest interface that can express it, then measure the fallback under realistic drift and faults.
One agent already faces partial observation, stale state, and ambiguous effects. Adding agents does not remove those conditions. If several policies share a browser or desktop, they can race on focus, invalidate one another's frames, and duplicate side effects unless ownership and coordination are explicit. Chapter 43 takes up that coordination problem next.
Further reading
- Shi et al., “World of Bits: An Open-Domain Platform for Web-Based Agents” (the origin: pixels + DOM + mouse and keyboard as an RL environment), 2017. proceedings.mlr.pressThe origin of GUI agents as a research line: agents perceive pixels and DOM and act with mouse and keyboard, plus the MiniWoB task suite the field trained on for years.
- Deng et al., “Mind2Web: Towards a Generalist Agent for the Web” (generalization to unseen sites as the yardstick), 2023. arXiv:2306.06070Over two thousand open-ended tasks across 137 real websites, making generalization to unseen sites the yardstick for web agents.
- Zhou et al., “WebArena: A Realistic Web Environment for Building Autonomous Agents” (the first big measurement of the human-agent gap), 2023. arXiv:2307.13854Self-hosted realistic web tasks (e-commerce, forums, code hosting) where the best GPT-4 agent completed 14.41% end-to-end against a human 78.24%, the first big quantification of the gap.
- Yang et al., “Set-of-Mark Prompting Unleashes Extraordinary Visual Grounding in GPT-4V” (number the elements, let the model pick a number), 2023. arXiv:2310.11441Overlay numbered marks on detected screen regions so the model outputs a mark instead of coordinates, the workaround that carried GUI grounding before natively grounded models.
- Hong et al., “CogAgent: A Visual Language Model for GUI Agents” (the first open model built around tiny UI elements), 2023. arXiv:2312.08914An 18B open vision-language model specialized for GUIs, with dual low- and high-resolution encoders because interface elements are tiny: proof that GUI perception needed architectural work, not just prompting.
- Xie et al., “OSWorld: Benchmarking Multimodal Agents for Open-Ended Tasks in Real Computer Environments” (the real-OS benchmark that became the progress bar), 2024. arXiv:2404.07972OSWorld defines desktop tasks with explicit initial-state setup and custom execution-based evaluators across web, file, command-line, and application workflows.
- Anthropic, “Introducing computer use, a new Claude 3.5 Sonnet, and Claude 3.5 Haiku” (the first frontier computer-use beta, with its caveats intact), 2024. anthropic.comThe first frontier model to offer computer use in public beta: general computer skills over per-task tools, released with the plain warning that it was experimental, cumbersome, and error-prone.
- OpenAI, “Introducing Operator” (a purpose-trained computer-using agent in a hosted browser), 2025. openai.comThe Computer-Using Agent: screenshots in, mouse and keyboard actions out, deployed through a hosted remote browser with user takeover for sensitive steps.
- Qin et al., “UI-TARS: Pioneering Automated GUI Interaction with Native Agents” (the end-to-end open counterpoint), 2025. arXiv:2501.12326A native GUI agent trained end to end, screenshots in and human-like actions out with no commercial-model wrapper, refined by reinforcement learning through hundreds of live virtual machines.
- Gou et al., “Navigating the Digital World as Humans Do: Universal Visual Grounding for GUI Agents” (the modular counter-design: frontier planner, dedicated grounder), 2024. arXiv:2410.05243The case for pipelines: a frontier model plans in language while a dedicated grounding model resolves descriptions to coordinates, and agents should perceive pixels only, like humans.
- Li et al., “ScreenSpot-Pro: GUI Grounding for Professional High-Resolution Computer Use” (a focused test of grounding in professional interfaces), 2025. arXiv:2504.07981A point-in-target grounding benchmark for high-resolution professional software: the best prior model reached 18.9%, while cascaded visual search reached 48.1%. It isolates grounding rather than end-to-end task completion.
- Abhyankar et al., “OSWorld-Human: Benchmarking the Efficiency of Computer-Use Agents” (success rates hide the product problem), 2026. arXiv:2506.16042Measures what completion rates hide: the tested agents took 2.7 to 4.3 times as many steps as human-authored reference trajectories, while model calls dominated their latency.
- OpenAI, “Computer use” (current executor, security, and approval guidance), 2026. developers.openai.comOfficial guidance for screenshot-action loops, original-resolution coordinates, isolated execution, untrusted content, sensitive-data transmission, and approval immediately before risky actions.
- Anthropic, “Computer use tool” (tool schema, reference loop, and current security guidance), 2026. platform.claude.comOfficial documentation for computer-use actions, the developer-run action loop, zoom support, isolated environments, minimal privileges, domain restrictions, and human confirmation.
- Rawles et al., “AndroidWorld: A Dynamic Benchmarking Environment for Autonomous Agents” (parameterized mobile tasks with programmatic state checks), 2025. proceedings.iclr.ccA reproducible Android environment with 116 parameterized tasks across 20 applications, each with setup, state-based success checking, and teardown; task variations materially affected results.
- Evtimov et al., “WASP: Benchmarking Web Agent Security Against Prompt Injection Attacks” (end-to-end prompt-injection evaluation for web agents), 2025. proceedings.neurips.ccAn end-to-end benchmark showing that realistic, low-effort prompt injections can divert capable web agents; partial attacker progress is separated from complete attacker success.
- Yuan et al., “OSWorld 2.0: Benchmarking Computer Use Agents on Long-Horizon Real-World Tasks” (long-horizon workflows reveal hidden-state and verification failures), 2026. arXiv:2606.29537A benchmark of 108 long-horizon workflows showing failures around changing information, hidden state, constraints, asking the user, and verification rather than only elementary GUI control.
- Souppaya et al., “Application Container Security Guide” (containers require host, image, runtime, and orchestration controls), 2017. csrc.nist.govNIST guidance that separates container images, registries, orchestrators, runtimes, and host operating systems, with countermeasures for each risk layer.
- Chromium Project, “Site Isolation” (renderer isolation is one browser-security layer, not host isolation), 2026. chromium.orgChromium's explanation of Site Isolation, which places cross-site documents in different processes to limit compromised renderers but does not replace environment isolation.
- Anthropic, “Piloting Claude for Chrome” (red-team numbers that justify gates, not confidence), 2025. anthropic.comA browser agent piloted with published red-team results: safeguards cut prompt-injection attack success from roughly a quarter of attempts to a tenth, framed by the vendor as not yet enough for wide deployment.
Comments
Log in to comment