Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

docs(cua-driver): fix bounded manifest examples that cannot load (#2847)

Francesco Bonacci1d7c54c38cf6
diff --git a/docs/content/docs/how-to-guides/driver/drive-a-web-page.mdx b/docs/content/docs/how-to-guides/driver/drive-a-web-page.mdx
index 142e9933f4..965af2c655 100644
--- a/docs/content/docs/how-to-guides/driver/drive-a-web-page.mdx
+++ b/docs/content/docs/how-to-guides/driver/drive-a-web-page.mdx
@@ -97,7 +97,7 @@ resources:
- bundle_id: com.google.Chrome
launch: false
windows: all
- terminate: never
+ terminate: deny
browser:
profiles:
- kind: existing_profile
diff --git a/docs/content/docs/how-to-guides/driver/write-a-bounded-manifest.mdx b/docs/content/docs/how-to-guides/driver/write-a-bounded-manifest.mdx
index 18bb02a0ef..c9de21477b 100644
--- a/docs/content/docs/how-to-guides/driver/write-a-bounded-manifest.mdx
+++ b/docs/content/docs/how-to-guides/driver/write-a-bounded-manifest.mdx
@@ -8,7 +8,7 @@ stay inside a reviewed set of applications, browser origins, files, and tools.
## 1. Create the manifest
-Save this as `cua-session.yaml` and replace the example paths and origin:
+Save this as `cua-session.yaml` and replace the example paths:
```yaml
version: 2
@@ -25,12 +25,6 @@ allow:
- click
- type_text
- press_key
- - browser_prepare
- - get_browser_state
- - browser_navigate
- - browser_click
- - browser_type
- - browser_download
- kill_app
resources:
@@ -40,12 +34,6 @@ resources:
windows: all
terminate: driver_launched
- browser:
- profiles:
- - kind: isolated
- origins:
- - https://app.example.com
-
files:
read:
- dir: /data/input
@@ -58,6 +46,9 @@ resources:
display: false
```
+This manifest drives a native application. Browser work uses a separate
+manifest, for the reason described in the next step.
+
On macOS, replace `executable` with the application's `bundle_id`:
```yaml
@@ -74,16 +65,61 @@ path.
## 2. Select browser access
+A bounded manifest that drives a browser is a separate, typed-browser-only
+manifest. It cannot also allow generic input or window observation.
+
+Every navigation is checked against `resources.browser.origins`, so a browser
+manifest must list at least one origin. Declaring origins then excludes the
+tools that could reach a page without crossing the typed browser adapter:
+`click`, `double_click`, `right_click`, `drag`, `scroll`, `type_text`,
+`press_key`, `hotkey`, `set_value`, the mouse primitives,
+`get_accessibility_tree`, `get_window_state`, `verify_state`,
+`get_desktop_state`, and `page`. Including any of them alongside origins is
+refused when the runtime starts:
+
+```text
+authorization startup error: origin-scoped bounded manifests cannot allow
+'click' because it bypasses the typed browser origin adapter
+```
+
+The check reads `allow.tools` alone, so it applies even when the manifest's
+application scope contains no browser. Use `list_windows` rather than
+`get_window_state` to find the `window_id` a browser call needs.
+
For a driver-owned browser profile:
```yaml
+version: 2
+mode: bounded
+expires_after: 8h
+idle_timeout: 30m
+
+allow:
+ tools:
+ - start_session
+ - end_session
+ - launch_app
+ - list_windows
+ - browser_prepare
+ - get_browser_state
+ - browser_navigate
+ - browser_click
+ - browser_type
+ - browser_download
+
resources:
browser:
profiles:
- kind: isolated
+ origins:
+ - https://app.example.com
+
+ desktop:
+ display: false
```
-If the task must use a logged-in Chromium profile, make that choice explicit:
+If the task must use a logged-in Chromium profile, make that choice explicit by
+replacing the profile kind:
```yaml
resources:
@@ -98,6 +134,17 @@ An existing-profile entry authorizes attachment under bounded mode without a
Cua modal or host callback. The typed browser tools still validate the live
top-level origin before input.
+An agent that needs both a browser and generic desktop input needs two
+runtimes: this manifest for the browser, and a separate application-scoped
+manifest for the desktop work.
+
+Scope that second runtime so it cannot reach a browser window. A runtime that
+can click the browser makes the first runtime's origin list decorative, because
+nothing checks an origin on the generic input path. Give it a bounded manifest
+naming only the non-browser applications it needs, and keep
+`desktop.display: false`. A standard-mode runtime is not a substitute: standard
+allows input against any application, including the browser.
+
## 3. Choose desktop scope
Application entries with `windows: all` authorize observation and input for
@@ -179,12 +226,25 @@ cua-driver revoke --all
`revoke --all` suspends the complete runtime generation. Restart the daemon
before starting a new bounded run.
+## Know what the manifest is worth
+
+A manifest bounds one runtime's tool surface. It is not a sandbox around your
+machine, your browser, or your logged-in accounts. Another Cua Driver runtime,
+or any other process running as the same user, is unaffected by it — including
+a standard-mode runtime, which allows input against every application.
+
+Read [Permission modes](/reference/cua-driver/permission-modes#origin-scope-excludes-generic-input)
+before relying on a manifest as a security boundary rather than as a reviewed
+statement of what one agent run may do.
+
## Rules to remember
- The manifest only narrows the built-in and configured policy ceilings.
- Ownership never bypasses the manifest.
- Unknown tools and missing resources fail closed.
- Browser origins match exact scheme, host, and port.
+- Declaring browser origins excludes generic input and window observation from
+ the same manifest.
- `terminate: driver_launched` requires a fresh process fingerprint match.
- `ask.tools` is denied in unattended use because an agent cannot approve its
own request.
diff --git a/docs/content/docs/reference/cua-driver/permission-modes.mdx b/docs/content/docs/reference/cua-driver/permission-modes.mdx
index 80272b18ce..75b0620e23 100644
--- a/docs/content/docs/reference/cua-driver/permission-modes.mdx
+++ b/docs/content/docs/reference/cua-driver/permission-modes.mdx
@@ -133,9 +133,7 @@ allow:
- start_session
- end_session
- launch_app
- - get_window_state
- - click
- - type_text
+ - list_windows
- browser_prepare
- get_browser_state
- browser_navigate
@@ -180,6 +178,48 @@ Browser origins match exact scheme, host, and port. File roots are
canonicalized and compared by path component, so a shared string prefix or a
symlink escape does not grant access.
+### Origin scope excludes generic input
+
+`resources.browser.origins` binds the typed browser adapter only. A manifest
+that declares origins therefore cannot also allow a tool that reaches a page
+around that adapter, and the runtime refuses to start if it does:
+
+```text
+authorization startup error: origin-scoped bounded manifests cannot allow
+'click' because it bypasses the typed browser origin adapter
+```
+
+The excluded tools are `click`, `double_click`, `right_click`, `drag`,
+`scroll`, `type_text`, `press_key`, `hotkey`, `set_value`,
+`mouse_button_down`, `mouse_button_up`, `mouse_drag`, `parallel_mouse_drag`,
+`get_accessibility_tree`, `get_window_state`, `verify_state`,
+`get_desktop_state`, and `page`.
+
+The exclusion covers observation as well as input. A window screenshot or
+accessibility tree of a browser window exposes whichever tab is open,
+regardless of the origin allow-list, so where a browser window is in reach
+these tools bound neither what an agent may change nor what it may read.
+
+The check is evaluated at load time against `allow.tools` alone. It does not
+analyze whether the manifest's application scope actually puts a browser window
+in reach, so a manifest that names only a non-browser application is refused on
+the same terms. This is deliberate: deciding reachability would require the
+runtime to keep a list of browser identities, and a stale list would void the
+origin boundary silently instead of refusing loudly.
+
+Every navigation is checked against the origin set, so a manifest that allows
+`browser_navigate` with no origins refuses every navigation. Browser access and
+generic desktop input consequently belong to separate manifests and separate
+runtimes. Use `list_windows` for the `window_id` a browser call needs.
+
+An origin scope binds one runtime's tool surface. It is not a property of the
+browser, the profile, or the machine. A second runtime that can deliver generic
+input to a browser window — including any standard-mode runtime, which allows
+input against every application — voids the first runtime's origin scope
+without violating it. Scope a companion runtime to non-browser applications
+with `desktop.display: false`, and treat same-user processes outside Cua Driver
+as outside the boundary entirely.
+
Version 1 manifests remain loadable. They may name exact PIDs, windows, and
paths, but version 2 is preferred for pre-launch and unattended workflows.