Computer-Use and Browser Agents › Action spaces

Michael BrenndoerferDecember 1, 20262 min read
Language AI HandbookAll chapters
Part 49 of 67Long-Horizon Agents and Interoperability
Chapter 373Computer-Use and Browser Agents › Action spaces
Reading section 3 of 15 · Action spaces · 2 minSection 3 of 15 · 2 min

Section 3 of 15 · 2 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

An action space describes what the policy can propose. The runtime defines which proposals it can execute for a particular view and which operations the application has authorized. A small vocabulary makes faults easier to diagnose. The right vocabulary depends on the environment and its instrumentation.

  • Coordinate input lets you point or scroll where the interface offers no structured element. Accuracy depends on a valid coordinate frame, current geometry and explicit bounds.
  • Observation-indexed actions carry an element reference that the runtime resolves against a current view. The same integer can represent different elements in different views. Pair it with a view identity and check current availability.
  • Task-level actions can use application features such as a vetted read or explicit archive request. Give state-changing actions a clear scope and outcome. If a structured interface can identify the exact record and return a verifiable result, it can remove ambiguity that a sequence of clicks would otherwise leave.

Action schema in code

The local fixture accepts only clicks on known controls and a request to re-observe. An epoch, meaning the runtime-generated version number of the current view, travels with the proposal. The policy receives display data separated from the runtime’s control map. The fixture uses Python annotations for readability and validates proposals again at execution time. A type annotation does not validate an object created by the caller.

PythonIn [7]
CollapseExpand
from dataclasses import dataclass, field
from math import isclose


@dataclass(frozen=True)
class Action:
    epoch: int
    kind: str
    element_id: int | None = None

The observation exposes roles, names, enabled state and simple boxes. The boxes illustrate viewport units. The mock takes only element actions and does not perform coordinate clicks, OCR or real hit tests. A frozen observation limits accidental mutation in this exercise. A remote policy would receive serialized data and a server would validate the parsed response at the boundary.

PythonIn [8]
CollapseExpand
@dataclass(frozen=True)
class Element:
    id: int
    role: str
    name: str
    bbox: tuple[int, int, int, int]
    enabled: bool = True


@dataclass(frozen=True)
class Observation:
    epoch: int
    page: str
    elements: tuple[Element, ...]
    text: str = ""
    viewport: tuple[int, int] = (800, 600)

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy