Architecture

Computer use

Synced from github.com/CoWork-OS/CoWork-OS/docs

Computer use lets the agent drive native desktop applications on macOS and Windows through real mouse, keyboard, and screen capture—when integrations, browser automation, and shell are not the right tool for the job.

Actions run on the computer where CoWork OS is running, using that computer's local permissions. A bot can instead work on its own desktop, a separate Linux desktop in a container that only that bot uses; see Bots and conversations → Where a bot works.

This page is the authoritative product guide for the feature. For a short summary, see Features → Computer use.

What it is for

Use computer use when the task clearly requires a desktop GUI that is not exposed through a stable API or through the in-app browser tools—for example:

  • Operating a native app’s windows, menus, or dialogs
  • Filling fields or clicking controls that only exist in a desktop UI
  • Short, bounded flows where scripting the UI is impractical

Prefer instead when possible:

  • MCP connectors and APIs for SaaS and internal systems
  • browser_* tools and the Browser Workbench for web surfaces, website testing, normal-user browser flows, Browser V2 snapshot refs, diagnostics, screenshots, annotation, and visible in-app browser automation
  • run_command / scripts for file, git, and CLI workflows
  • open_application to launch an app; pair with screenshot/click/type_text only when the agent must then interact with that app’s UI

The planner and tool policy treat the computer-use lane as a controlled, last-resort path: tools stay deferred unless the task signals native desktop GUI intent (for example Calculator, System Settings, or “click the OK button in the native dialog”). That keeps routine coding and web work from accidentally taking the desktop-control path.

If the task is not asking CoWork to click or type, but instead to understand a vague on-screen reference like what is this, what's on the right side, or why is this failing, see Chronicle. Chronicle shares the same Screen Recording prerequisite but resolves local screen context rather than driving the mouse and keyboard.

Platform requirements

  • macOS and Windows desktop builds are supported. Linux/headless builds do not expose this tool family.
  • macOS uses a bundled Swift helper with Accessibility and Screen Recording permissions.
  • Windows v1 uses a bundled PowerShell/Win32 helper for visible, non-minimized windows. Some protected or elevated apps may block capture or input unless CoWork is running with comparable privileges.

Run computer use in a Cua Space

For commands, files and a browser to share the same task computer, see Task computers. The connection below moves desktop control only.

Instead of this computer, the computer-use tools (screenshot, click, type_text, keypress, scroll, drag and the rest) can drive a Cua Space: a separate computer, on this machine or elsewhere, that you can watch from the Cua Spaces app. Your own windows, pointer and keyboard are not touched while it is on.

  1. Start a Space in Cua Spaces and note its address and token (the cua-spacesd URL, for example http://127.0.0.1:3211).
  2. Open Settings > Tools > Computer use, enter the Space URL and Space token, and choose Save. The token is stored encrypted and is never shown again; the settings page only says that one is saved.
  3. Choose Test connection. It checks that the Space answers and that it accepts the token.
  4. Turn on Run Computer Use in this Cua Space.

Rules for the address:

  • A token is required unless the Space runs on this computer (localhost, 127.0.0.1, ::1).
  • Plain http:// is accepted only for this computer and private network addresses (10.x, 172.16–31.x, 192.168.x, fc00::/7, fe80::/10). Anything else, including any host name other than localhost, needs https://.
  • Credentials inside the URL are refused; use the token field.

While the Space is on:

  • If the Space cannot be reached, computer-use actions fail with a message saying so. CoWork never falls back to this computer on its own; turn the Space off to work locally again.
  • Foreground input happens inside the Space, so the Background-only mode and visible-control approvals, which protect your own screen, do not apply.
  • Changing the Space, or turning it on or off, ends any active computer-use session, because its window ids belong to the computer it started on.
  • Only the computer-use tools move to the Space. Other tools such as native_app, open_application, run_command and the browser tools still act on this computer.

Optional Codex Computer Use MCP connection on macOS

An installed Codex/ChatGPT desktop Computer Use plugin can also be connected as a local MCP server. This is an unofficial integration with an installed desktop runtime; it is not a bundled CoWork engine or the OpenAI computer-use API.

  1. Find the newest installed unified-computer-use/<version>/.mcp.json under ~/.codex/plugins/cache/openai-bundled/ and read its mcpServers.cua_repl entry.
  2. In CoWork's MCP Servers, add a stdio server named codex-cu, copying the entry's command, args, and env exactly. Enter environment values as KEY=value, one per line. Use the installed paths rather than a version or username copied from someone else's configuration.
  3. Connect the server and verify that its js and js_reset tools appear.
  4. Ask CoWork: Use the codex-cu MCP tools to operate Calculator in the background, calculate 12 × 12, and verify the displayed result. CoWork exposes the tools as mcp_js and mcp_js_reset with the default MCP prefix.

Keep the desktop runtime installed and available, including its Computer Use helper and macOS permissions. Updates can change its paths or protocol; refresh the connection from the installed manifest if needed. Registering this server does not automatically replace CoWork's built-in desktop tools. To prefer it, add a behavioral rule in Personality → Instructions for native macOS GUI work. CoWork recognizes js and js_reset from the locally configured @oai/cua-repl stdio entry when its enabled surfaces include computer. Unlike other connected MCP tools, which are always available, those two are offered only for native GUI requests, and they stay available within step budgets for those tasks.

CoWork supports the plugin's approval-only form elicitation over stdio. The Ask for approval profile offers Allow for this task on the first engine permission. Each app then asks once for consent covering reads, clicks, typing, and drags for that task. Subsequent calls reuse consent; different apps and tasks ask again. Grants are kept in memory and invalidated by changed configuration, permissions, or access profile. Hard denies, explicit rule asks, and semantic review remain enforced on each call. Audio consent and other forms remain per operation. No grant changes a workspace rule or survives a restart. General data forms and URL elicitation are cancelled. Calls are serialized so consent belongs to the calling task.

Under effective Full access, routine engine calls and validated app-consent requests proceed without CoWork approval cards. Policy denies and OS permissions still apply. Audio and other special consent forms do not gain this exception. The access choice belongs to each task: selecting Full access in the Home composer does not change a task already created with Ask for approval.

Access-profile and operating-system boundaries

Computer-use tools must be exposed by the task's effective access profile and remain subject to administrator policy, tool restrictions, hard key-combination blocks, and action-specific approval. Selecting Full access does not grant macOS Accessibility or Screen Recording; those are independent operating-system permissions. Conversely, granting those OS permissions does not widen the task's filesystem, network, or command-tool profile. A remote or fallback computer-use route cannot use its transport to bypass the local profile.

Always allowed apps

When computer use asks to control an app (once per task for background control with native_app, or per window before visible control), the approval card offers Always allow next to Allow for this task. Choosing it puts the app on Settings > Built-in Tools > Computer Use (macOS) > Always allowed apps, and from then on that app is controlled without asking, in the background and visibly:

  • Only in sessions you start. Sessions started by a bot, a schedule or heartbeat, the API, a hook, a bot panel, a messaging channel or cowork run, sessions set to never ask a person, and sub-agents under any of them, keep asking.
  • Never past a deny. Deny rules, the access profile (a profile that never asks still refuses), administrator policy, the Background only mode and the operating-system permissions all apply as before. The list only answers the question a person would otherwise be asked.
  • Some apps can't be listed: CoWork itself; password managers (Passwords, Keychain Access, 1Password, Bitwarden, LastPass, Dashlane, KeePassXC, Enpass, Keeper, Proton Pass); terminals, scripting and automation apps (Terminal, iTerm, Warp, Ghostty, kitty, Alacritty, Hyper, WezTerm, Tabby, Script Editor, Script Debugger, Automator, Shortcuts, Keyboard Maestro, Hammerspoon); code editors with a built-in terminal (VS Code, Cursor, Xcode, Zed, JetBrains IDEs); Finder, Screen Sharing and Docker; and System Settings, Activity Monitor, Disk Utility and Console. The card doesn't offer Always allow for them.
  • Only from the card, in the app. An app is added only by your answer on the inline approval card in CoWork's own window; the card names the app and its bundle ID. The same answer from the browser app or another client allows that one request. The approval dialog doesn't add apps, and Settings can only remove them.
  • It covers CoWork's built-in computer use tools, not an external computer use MCP connection, whose app consent stays per task.

The list is kept in CoWork's encrypted settings on this computer (computer-use-apps). Each automatic approval is logged on the task as tool_authorization with reason always_allowed_app.

macOS permissions

Two system permissions gate computer use:

PermissionWhy it matters
AccessibilityAX-first focus, press, and value-setting require the helper to be trusted for accessibility control.
Screen RecordingCapturing the controlled window for screenshot() and follow-up action refreshes uses the helper’s ScreenCaptureKit path, which macOS treats as screen recording.

Where to enable in the product

  1. Open Settings → Tools → Computer use.
  2. Use the shortcuts into System Settings to enable Accessibility and Screen Recording for the computer-use helper binary shown in settings.
  3. After changing Screen Recording, quit and restart CoWork OS if capture still fails—macOS sometimes caches the old state until restart.

If a tool returns an error mentioning screen capture timeout or permission, re-check Screen Recording for this app and restart.

Windows behavior

Windows computer use targets one visible, non-minimized top-level window at a time. The helper enumerates native windows, captures the selected window region, and sends mouse/keyboard input through Win32 APIs.

Known v1 limits:

  • Minimized windows are not controlled; restore the target window first.
  • Apps running as administrator may require CoWork to run as administrator.
  • Some games, protected apps, or anti-cheat surfaces may block capture or input.
  • If background capture/control is unavailable, actions may briefly use the foreground mouse and keyboard.

Session model (one active session)

Computer use runs under a single global session on the machine:

  • Only one computer-use session is active at a time; starting control for a new task coordinates with the session manager.
  • Esc aborts the active computer-use session so you can interrupt quickly without hunting in the UI.
  • Sequential execution and a shortcut guard reduce the chance of overlapping actions or global hotkeys firing at the wrong time during automation.

The session is torn down when the task finishes or the session ends cleanly after abort.

Watching it work

Computer use runs in the background, so you can keep using your Mac. While a task uses an app on this computer, the task's right sidebar shows a live card under its other sections:

  • The window the task controls, refreshed by every action and, while the card is on screen, captured in the background about once a second. Only that window is captured, never the screen, and nothing is captured while the app window is hidden.
  • Windows it used earlier, stacked behind the live one.
  • Make larger opens the live window over the app; Esc closes it. Minimize folds the card to one row.
  • Take over stops the agent from using the computer until you click Hand back. When the agent asks you to step in (passwords, one-time codes, payments), its reason shows on the card.

Bot conversations show the same view in the bot's rail.

Built-in tools

All of these are part of the computer_use built-in tool family. They are registered together and can be enabled or prioritized alongside other built-in categories in Settings → Tools → Built-in tools.

ToolRole
screenshotSelect or refresh the current controlled window and return a fresh screenshot plus captureId.
click / double_clickClick inside the current controlled window using screenshot-relative coordinates.
move_mouseMove the pointer without clicking.
dragDrag through a screenshot-relative path in the controlled window.
scrollScroll at a screenshot-relative point in the controlled window.
type_textType or set text into the currently focused control.
keypressEmit key chords or special keys; dangerous combinations are blocklisted at the tool layer.
waitPause briefly, then refresh the controlled-window screenshot.

Key contract details:

  • Call screenshot() first.
  • All action coordinates are relative to the latest screenshot, not the whole desktop.
  • Successful actions return a new screenshot and captureId.
  • Passing a stale captureId fails with a refresh instruction.

open_application can launch native apps by name or bundle id/path where supported. For native GUI workflows, policy may allow open_application in the same steps as screenshot/click/type_text so the agent can start the target app before driving it. On macOS, that is separate from shell-based AppleScript or one-off scripts: when the goal is GUI interaction, the product steers toward the dedicated computer-use tools (and open_application when needed) rather than run_applescript as a first choice.

Routing and planner behavior (operator mental model)

Rough order the stack encourages:

  1. Structured integrations (MCP, APIs, mail, channels).
  2. Browser tools for web UIs.
  3. Shell and file tools for repo and CLI work.
  4. open_application when the missing piece is “the app is not running.”
  5. native_app (macOS, background; see Working with apps in the background) or screenshot + follow-up computer-use actions when the task still requires native GUI interaction.

Native desktop GUI intent is detected from the user goal and step text (not only from generic words like “browser” in strategy headers). Explicit mentions of native apps, windows, dialogs, or on-screen UI tend to unlock the computer-use lane; purely web or repo tasks should not.

Settings checklist

  1. Built-in tools: Confirm the computer_use category is enabled if you want the agent to use this lane at all.
  2. Permissions / platform status: On macOS, Accessibility + Screen Recording granted for the helper binary; restart after Screen Recording changes if needed. On Windows, confirm the helper is installed and the target window is visible/non-minimized.
  3. Operational model: On macOS the default is Background only: native_app targets an exact app window without taking the foreground, pointer, keyboard or clipboard (see Local background app control). Foreground modes are explicit opt-ins; on Windows, expect the visible controlled-window loop centered on screenshot() and the latest captureId.
  4. Always allowed apps: Under Computer Use (macOS), check the apps CoWork may control without asking in your sessions, and remove any you no longer want (see Always allowed apps).
  5. Chronicle: If your goal is contextual screen understanding rather than GUI control, enable Settings > Tools > Chronicle, keep the dedicated Chronicle built-in tool category enabled, and test screen_context_resolve before forcing a computer-use flow.

Security and abuse considerations

Computer use is high trust: a mistaken or malicious task could operate any UI your user can reach. Mitigations include:

  • Esc abort and single-session sequential execution
  • Helper-targeted permissions with inline bootstrap on macOS; visible-window constraints on Windows
  • Policy that keeps the computer-use lane off the default path unless GUI intent is clear
  • Blocklisted key combinations that could disrupt the session or OS
  • Private Browser Workbench prompts and filled documents block native computer control, including captures that overlap the private flow. Wait for prompt clearance or full navigation/closing the protected tab; do not route around the guard. See private browser safeguards.

For how this fits the wider tool-risk model, see Security guide → Computer use.

Troubleshooting

SymptomThings to check
Screenshot or capture errors / timeoutsmacOS: Screen Recording for the helper path shown in settings; restart app after granting. Windows: target window visible, non-minimized, and not protected/elevated above CoWork.
Clicks or keys do nothingmacOS: Accessibility trust for the helper path shown in settings. Windows: target app is not elevated/protected and no other app is stealing focus.
Agent uses shell or browser instead of desktopTask may not read as native GUI; rephrase with explicit app/window/dialog language, or ensure built-in computer_use is enabled.
Agent asks for a screenshot when the task is really “what is this on screen?”This may be a Chronicle case rather than a computer-use case; enable Chronicle and test screen_context_resolve with a clear on-screen prompt first.
Permission bootstrap repeatsmacOS: re-check that both Accessibility and Screen Recording are granted to the helper binary, not just to CoWork OS or Terminal.
Session feels “stuck”Use Esc to abort the computer-use session, then cancel or adjust the task.
“Cua Space … is not reachable” or “refused the connection”Start the Space in Cua Spaces, then use Test connection in Settings > Tools > Computer use. A refused connection usually means the token is wrong.

Implementation map (for contributors)

AreaLocation
Tool definitions and executionsrc/electron/agent/tools/computer-use-tools.ts
Helper runtime + providerssrc/electron/computer-use/helper-runtime.ts, src/electron/computer-use/provider.ts, resources/computer-use/bridge.swift, resources/computer-use/bridge.ps1
Session lifecyclesrc/electron/computer-use/session-manager.ts, shortcut-guard.ts
Policy / routingsrc/electron/agent/tool-policy-engine.ts, src/electron/agent/executor.ts
Settings / IPCsrc/renderer/components/ComputerUseSettings.tsx, IPC handlers
Cua Space backendsrc/electron/computer-use/cua-space/ (settings, MCP client, provider), src/renderer/components/CuaSpaceSettings.tsx

See also: Chronicle, Architecture, Features, Security guide, Operator runtime visibility.