use.computer

Windows (Beta)

Windows VM sandboxes — mouse, keyboard, screenshot, PowerShell exec, VNC.

Beta. Windows sandboxes are new and the surface may change. They're currently admin-only.

Overview

Windows sandboxes are full Windows 11 desktops that start in a few seconds (restored from a memory snapshot, like the macOS sandboxes) and are driven by the same use.computer SDK and API. Each sandbox ships with Chrome (no sign-in prompts), Node/npm, Postgres, ffmpeg, Git, VS Code, LibreOffice, GIMP and VLC preinstalled, and runs as an Administrator with UAC/Defender/firewall and update nags disabled — so automation just works.

How it differs from macOS

  • No SSH. Commands run in-guest through the sandbox agent via PowerShell or cmd (sandbox.run(...) / sandbox.shell), not over SSH.
  • Accessibility. ui_tree() returns the native Windows UIAutomation tree. The macOS axe-schema .accessibility is not available on Windows.
  • Mouse / keyboard / screenshot / recording / file upload-download are identical to macOS.

Quickstart (Python SDK)

from use_computer import Computer

with Computer().create(type="windows") as win:
    print(win.run("$env:COMPUTERNAME").stdout)      # PowerShell by default
    win.run("Start-Process notepad")
    win.keyboard.type("hello from use.computer")
    png = win.screenshot.take_full_screen()
    open("win.png", "wb").write(png)

AsyncWindowsSandbox mirrors the same surface with await.

Seeding: upload a script and run it

Seeding a Windows sandbox is the same upload-a-file + run-a-script model as the macOS pre_command — there's no separate DSL. Drop any files you need (a setup.ps1, a tarball, a .py) and run them:

with Computer().create(type="windows") as win:
    win.upload("setup.ps1", r"C:\setup.ps1")
    win.run(r"powershell -ExecutionPolicy Bypass -File C:\setup.ps1", timeout=1200)

A setup.ps1 can do anything — clone a repo, install deps, start a backend, and even route a real-looking domain to a local app via the hosts file + a port proxy:

# setup.ps1 — start a local app on :8080 and make app.example.com reach it
Set-Location C:\app
npm install; npm run build
Start-Process node -ArgumentList "dist/index.js" -WindowStyle Hidden   # serves :8080

# hosts redirect + port proxy so http://app.example.com hits the local app
$hosts = "$env:SystemRoot\System32\drivers\etc\hosts"
Add-Content $hosts "`n127.0.0.1 app.example.com"
netsh interface portproxy add v4tov4 listenport=80 connectport=8080 connectaddress=127.0.0.1
ipconfig /flushdns
Start-Process chrome "http://app.example.com"

Verifiers

A verifier is just a script you upload, run, and read back — write a reward to a file and download it:

# verifier.ps1 — check a condition and write a reward (0..1)
$reward = if (Test-Path C:\app\output.csv) { 1 } else { 0 }
New-Item -ItemType Directory -Force C:\reward | Out-Null
"$reward" | Out-File C:\reward\reward.txt -Encoding ASCII -NoNewline
win.upload("verifier.ps1", r"C:\verifier.ps1")
win.run(r"powershell -ExecutionPolicy Bypass -File C:\verifier.ps1")
reward = win.run("Get-Content C:\\reward\\reward.txt").stdout.strip()

VNC

create() returns a vnc_url — a public, no-auth noVNC viewer you can open in a browser to watch (and drive) the desktop live.

Evals (runner)

Windows tasks run through the runner with platform="windows" and a PowerShell agent; pre_command and graders are authored in PowerShell. See the runner.

On this page