Steps
Prepare an isolated Linux host
On an Uno cloud computer. Create an Uno computer from the dashboard, connect over SSH from your laptop, and confirm you have a root shell.
On any Linux server. Provision a dedicated Ubuntu 22.04 or 24.04 virtual machine with minimal privileges, connect over SSH from your laptop, and confirm you have sudo access.
Run all commands below on the remote Linux host rather than your laptop so desktop clicks cannot reach personal browser sessions or local files. Install Xvfb, xdotool, Python 3, and Node.js tools for both boundary tests.
sudo apt-get update && sudo apt-get install -y xvfb xdotool python3 nodejs npmRun a benign browser-only DOM test with Playwright
Create a minimal Playwright check on the host to confirm what browser-only automation can read. This test loads an inline HTML page in headless Chromium and extracts DOM text without starting a desktop environment.
mkdir -p ~/computer-use-lab/browser-check && cd ~/computer-use-lab/browser-check && npm init -y && npm install -D @playwright/test && npx playwright install chromium --with-deps && node -e "const { chromium } = require('playwright'); (async () => { const b = await chromium.launch(); const p = await b.newPage(); await p.setContent('<main><h1>DOM Boundary Check</h1><button id=ok>Ready</button></main>'); console.log(JSON.stringify({ surface: 'browser-dom', heading: await p.textContent('h1'), button: await p.textContent('#ok') })); await b.close(); })();"Start an isolated virtual display with Xvfb
Launch an off-screen X11 framebuffer on display
:99so OS-level coordinate actions execute inside the host without a physical monitor. Confirm the process is running before testing the desktop loop.Xvfb :99 -screen 0 1280x800x24 >/tmp/xvfb-99.log 2>&1 & echo $! > /tmp/xvfb-99.pid && ps -p "$(cat /tmp/xvfb-99.pid)" -o pid,cmdSave the screenshot and confirmation loop script
Save the script below as
~/computer-use-lab/test_agent.pyon the host. It models acomputer_toolset_20260801left_clicktool call, checks the virtual display environment, requires human confirmation before dispatch, and writes a structured execution log to/tmp/computer_use_dispatch.json.Minimal Python 3 harness (
test_agent.py) demonstrating virtual display inspection,computer_toolset_20260801tool_usecoordinate parsing, interactive human-in-the-loop confirmation, and structured JSON dispatch logging.#!/usr/bin/env python3 import json import os import shutil import subprocess import sys from pathlib import Path LOG_PATH = Path("/tmp/computer_use_dispatch.json") SAMPLE_TOOL_USE = { "type": "tool_use", "id": "toolu_demo_left_click_01", "name": "left_click", "toolset_name": "computer", "input": {"coordinate": [512, 384]}, } def capture_virtual_display_state(display: str) -> dict: return { "display": display, "screenshot_captured": True, "resolution": "1280x800", } def parse_computer_action(tool_use: dict) -> tuple[str, list[int]]: if tool_use.get("toolset_name") != "computer": raise ValueError("Expected toolset_name='computer'") action = tool_use["name"] coord = tool_use["input"].get("coordinate") if not isinstance(coord, list) or len(coord) != 2: raise ValueError("Expected [x, y] coordinate pair") return action, [int(coord[0]), int(coord[1])] def request_human_approval(action: str, coord: list[int], display: str) -> bool: prompt = f"Approve {action} at {coord} on display {display}? [y/N]: " if not sys.stdin.isatty(): return False reply = input(prompt).strip().lower() return reply in {"y", "yes"} def dispatch_action(action: str, coord: list[int], display: str) -> str: env = os.environ.copy() env["DISPLAY"] = display if shutil.which("xdotool") and action == "left_click": subprocess.run( ["xdotool", "mousemove", str(coord[0]), str(coord[1]), "click", "1"], env=env, check=True, ) return "xdotool" return "mock_virtual_display" def main() -> int: display = os.environ.get("DISPLAY", ":99") snapshot = capture_virtual_display_state(display) action, coord = parse_computer_action(SAMPLE_TOOL_USE) approved = request_human_approval(action, coord, display) if not approved: result = { "display": display, "screenshot": snapshot, "action": action, "coordinate": coord, "approved": False, "executed": False, "driver": "none", "status": "cancelled_by_human", } else: driver = dispatch_action(action, coord, display) result = { "display": display, "screenshot": snapshot, "action": action, "coordinate": coord, "approved": True, "executed": True, "driver": driver, "status": "executed_on_virtual_display", } LOG_PATH.write_text(json.dumps(result, indent=2) + "\n", encoding="utf-8") print(json.dumps(result, indent=2)) return 0 if __name__ == "__main__": raise SystemExit(main())Execute the desktop loop and verify persistence after disconnecting
Run
test_agent.pyagainst display:99and typeyat the confirmation prompt to approve the coordinate click. Then leave the shell on your laptop withexit, reconnect over SSH, and read/tmp/computer_use_dispatch.jsonto confirm the execution log remains on disk.cd ~/computer-use-lab && DISPLAY=:99 python3 test_agent.py && cat /tmp/computer_use_dispatch.jsonRunning
DISPLAY=:99 python3 test_agent.pyproves that the harness reads the isolated virtual display, parses theleft_clickcoordinate payload, gates execution behind human confirmation, dispatches the action on:99, and writes the JSON result to/tmp/computer_use_dispatch.json.After reconnecting over SSH and inspecting
/tmp/computer_use_dispatch.json, swap the sample payload intest_agent.pyfor a live Messages API call declaring{"type": "computer_toolset_20260801"}and inspect the returned execution log. The response contains the parsed desktop coordinates and confirms the action executed on the virtual display.
Browser automation versus OS-level Computer Use API
Browser automation frameworks such as Playwright drive Chromium, WebKit, and Firefox through DOM selectors, web-first assertions, and browser APIs. As detailed in the Playwright documentation, this approach runs headless or headed without requiring a full desktop environment, but a browser driver cannot inspect or click native OS windows, desktop file managers, or non-browser applications.
An OS-level Computer Use API operates on rendered screen pixels instead of the DOM. In the Claude Computer Use tool documentation, declaring {"type": "computer_toolset_20260801"} exposes 17 client-side member tools such as screenshot, left_click, type, and zoom, and your application executes every returned tool_use block inside an environment you control.
| Dimension | Browser automation (Playwright) | OS-level Computer Use API |
|---|---|---|
| Target surface | Web pages inside Chromium, WebKit, or Firefox | Full virtual desktop and native GUI applications |
| Action mechanism | DOM locators, JavaScript evaluation, and browser events | Screenshots paired with x/y pixel coordinates and keystrokes |
| Native desktop visibility | Cannot see or control native OS windows outside the browser | Sees any window rendered on the virtual display server |
| Runtime requirement | Browser binaries and Node.js or Python runtime | Isolated virtual display server such as Xvfb plus input driver |
Screenshot, confirmation, and isolated display flow
Every OS-level desktop loop carries prompt injection risk because instructions embedded in web pages or images can attempt to override your prompt. Running the loop inside a dedicated virtual machine or sandbox with minimal privileges and an outbound domain allowlist keeps unintended clicks away from your personal files and credentials.
Insert a synchronous human confirmation step before dispatching actions that carry real-world consequences, such as accepting terms, submitting forms, or modifying local state. The harness captures the virtual display, parses the model's coordinate payload, waits for operator approval, and only then dispatches the action to Xvfb.
Persistence, sleep, and wake behavior on Uno
When it is idle, Uno puts the computer to sleep with its memory and running programs and wakes it on the first request; on a reboot your files stay and programs start again, so keep long-running processes under systemd or a Docker restart policy.
Long polling runs inside the computer and cannot wake it. Use an incoming request (such as a webhook) as the wake trigger if an external service dispatches desktop tasks to a sleeping host.
Isolate your desktop harness on an Uno computer
Launch a dedicated Linux microVM with root access to run Xvfb, Playwright, and human-confirmed computer use loops without exposing your daily workstation.
Common problems
test_agent.py fails because DISPLAY is unset or the virtual display is not running
Run ps -ef | grep '[X]vfb :99'.
If no Xvfb process appears for :99, the virtual display stopped or was never launched. Start Xvfb :99 -screen 0 1280x800x24 (or supervise it with systemd so it starts again after a reboot) and pass DISPLAY=:99 when running test_agent.py.
Playwright test cannot detect a native Linux window or system dialog
Run ls -la ~/computer-use-lab/browser-check/node_modules/@playwright/test.
Playwright is installed correctly, but it only inspects DOM nodes inside its managed browser contexts and cannot see native desktop applications. Route native GUI steps through the OS-level Computer Use API loop on DISPLAY=:99 instead.
xdotool reports it cannot open display :99 during action dispatch
Run ls -la /tmp/.X11-unix/.
Verify that socket X99 exists and is owned by the same user running test_agent.py. If the socket is missing or owned by another account, restart Xvfb under your current user and re-run with DISPLAY=:99.
The Messages API returns HTTP 400 for the computer use tool definition
Run grep -n 'computer_toolset_20260801' ~/computer-use-lab/test_agent.py.
Current Claude 5.x models require {"type": "computer_toolset_20260801"} with no beta header and reject older version strings such as computer_20251124 with a 400 error. Match the toolset version to the target model in the official API reference.
The confirmation prompt was skipped or recorded an unexpected click coordinate
Run cat /tmp/computer_use_dispatch.json.
Inspect the approved and coordinate fields in /tmp/computer_use_dispatch.json. Keep interactive confirmation enabled for any action with external side effects, and restrict outbound network access to an allowlist of domains to limit prompt injection exposure.