Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/trycua/cua/llms.txt

Use this file to discover all available pages before exploring further.

cua-driver enforces authorization inside the native runtime, after transport arguments are sanitized and before any platform action runs. CLI, MCP, direct SDK, private-worker, and service-backed calls all reach the same enforcement boundary. The permission mode is fixed at launch and belongs to the process that owns the runtime. A running daemon’s mode cannot be changed — stop it and start it again with the configuration you want.

Choosing a Mode

The default mode. Routine observation, input, file transfer, isolated browser use, recording, and agent-adjustable settings run without Cua prompts. Residual boundaries (such as attaching to an existing Chromium profile) return a structured refusal unless they have an explicit grant or trusted host callback.Best for: normal local CLI and MCP use, development, interactive sessions.
cua-driver mcp
# or explicitly:
cua-driver serve --permission-mode standard
autonomous is a manifest compatibility alias for bounded. yolo is a configuration alias for unrestricted. New integrations should use the canonical names.

Setting the Mode Without CLI Flags

The mode is read once when the runtime that owns the driver starts. Launchers that cannot pass flags — cua-driver mcp owning its own runtime on Windows and Linux, a Windows Scheduled Task, or an embedding host — use equivalent environment variables:
CLI flagEnvironment variable
--permission-mode <mode>CUA_DRIVER_PERMISSION_MODE=<mode>
--session-policy <path>CUA_DRIVER_SESSION_POLICY_FILE=<path>
--approve-session-policyCUA_DRIVER_SESSION_POLICY_APPROVED=1
--dangerously-bypass-approvalsCUA_DRIVER_DANGEROUSLY_BYPASS_APPROVALS=1
The variables accept 1, true, yes, or on for their boolean form.
Missing halves fail startup instead of silently downgrading to standard. unrestricted requires both CUA_DRIVER_PERMISSION_MODE=unrestricted and CUA_DRIVER_DANGEROUSLY_BYPASS_APPROVALS=1. bounded requires both the policy file path and its approval variable.
CUA_DRIVER_SESSION_POLICY_FILE and CUA_DRIVER_SESSION_POLICY_APPROVED are rejected in standard and unrestricted mode, so a stale exported variable prevents startup rather than applying silently. These variables are trusted launch configuration on the same footing as CLI flags. An agent tool call can never set them.

What Standard Mode Allows

Standard mode preserves practical autonomous workflows without requiring explicit approval for routine actions.
OperationStandard behavior
Observe windows, applications, and the desktopAllow
Click, type, scroll, drag, and focusAllow
Create and use a driver-owned isolated browserAllow
Read visible page content through typed browser toolsAllow
Upload, download, screenshot, record, and replay validated pathsAllow
Change agent-adjustable cursor and image settingsAllow and audit
Terminate a process proven to have been launched by this runtimeAllow after process fingerprint revalidation
Terminate a foreign processDeny
Run unbounded legacy page mutation scriptsDeny
Raise an operating-system permission prompt from an agent tool callDeny
Attach to an existing logged-in Chromium profileRequire an explicit launch grant or trusted host authorization
Invoke an unknown risk-bearing operationDeny

Attaching to Existing Chromium Profiles

An existing profile can contain live cookies and authenticated sites. Standard mode keeps attachment as an explicit boundary. Authorize it at daemon launch:
# For a newly launched MCP runtime:
cua-driver mcp --grant existing-profile

# For a long-running daemon:
cua-driver serve --grant existing-profile
--grant is repeatable and is trusted launch configuration. It cannot modify an already-running daemon — restart the daemon with the same grant when needed. Other valid authorization paths:
  • A bounded manifest that allows kind: existing_profile.
  • A DriverAuthorizationHost callback installed by an embedding application.
  • unrestricted mode with its dangerous acknowledgement.
An MCP transport marker, model-supplied boolean, environment variable, or ordinary tool argument is never an attachment grant.

Bounded Manifests

Bounded mode is deny-by-default. A tool must appear in allow.tools, and every resource crossed by that call must match the manifest. Manifest version 2 supports application identities, browser profile kinds, and directory roots:
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
    - kill_app

resources:
  apps:
    - executable: /usr/bin/example-editor
      launch: true
      windows: all
      terminate: driver_launched

  browser:
    profiles:
      - kind: isolated
      - kind: existing_profile
    origins:
      - https://app.example.com

  files:
    read:
      - dir: /data/input
        recursive: true
    write:
      - dir: /data/output
        recursive: true

  desktop:
    display: false
On macOS, use bundle_id for an application identity. On Windows and Linux, use a canonical absolute executable path. windows: all allows windows owned by the matching application. terminate: driver_launched permits termination only when Cua proved that the current runtime launched that exact process instance.

Origin Scope Excludes Generic Input

resources.browser.origins binds the typed browser adapter only. A manifest that declares origins cannot also allow tools that reach a page around that adapter. The runtime refuses to start if it does:
authorization startup error: origin-scoped bounded manifests cannot allow
'click' because it bypasses the typed browser origin adapter
The excluded tools include click, double_click, right_click, drag, scroll, type_text, press_key, hotkey, set_value, get_window_state, get_desktop_state, get_accessibility_tree, verify_state, and page. Browser access and generic desktop input consequently belong to separate manifests and separate runtimes.
Version 1 manifests remain loadable, but version 2 is preferred for pre-launch and unattended workflows.

Authorization Stack

Every call must pass all applicable layers in order:
  1. Hard invariants (self-targeting, protected-host checks).
  2. The reviewed built-in tool and risk map.
  3. Administrator policy from CUA_DRIVER_MANAGED_POLICY_FILE, when set.
  4. User policy from CUA_DRIVER_POLICY_FILE, when set.
  5. The bounded manifest, when the active mode is bounded.
  6. A launch grant or trusted host authorization for a residual standard-mode boundary.
Each layer can only narrow access. No grant or permission mode can widen a managed or user policy.

Revocation

Revoke a single session:
cua-driver revoke --session research-1
Suspend the entire runtime generation (terminal; restart required for new calls):
cua-driver revoke --all
Session end removes its grants, browser bindings, launch provenance, recording state, and cursor. The ended session label remains tombstoned until an explicit start_session re-declares it.

Host Authorization and Embedding

An embedding application may install DriverAuthorizationHost to decide residual standard-mode requests itself. Cua supplies an attested, request-bound resource and digest; the host returns allow, deny, or cancel. An optional DriverActivityObserver receives content-free action, authorization, grant, and session events. Events never contain page text, typed input, file contents, screenshots, or raw resource identities. When no launch grant or host callback exists, a residual boundary returns a structured authorization_required refusal — no Cua-owned modal is shown.

Security Boundary

The host owns the permission mode, manifest, launch grants, and any human consent UX. Agent tools cannot change them. Same-user native code, malware, and automation with control of the same desktop are outside cua-driver’s security boundary. Cua can prevent an agent from forging its own tool arguments, but it cannot turn an ordinary desktop window into a secure desktop.

Build docs developers (and LLMs) love