# Windows Sandbox Computer Use A Windows-only agent skill for headlessly controlling Windows Sandbox. The Microsoft Store `wsb` CLI provides headless lifecycle (`start`/`list`/`stop`), guest commands, IP queries, and scoped directory sharing. `ironrdp-agent` (`>= 0.1.1`) provides headless full-frame screenshots and mouse/keyboard input over Windows Sandbox's local NamedPipe RDP transport without opening a host `WindowsSandboxClient` window. ## Requirements Native lifecycle, commands, sharing and IP queries run through the Microsoft Store Windows Sandbox CLI. This adapter targets the `wsb` interface in runtime `0.8.114.0+`. Commands support an explicit working directory and user context, and batches stop on failure. The native CLI reports guest exit codes without capturing guest stdout/stderr. - Windows 11 with the Store-delivered Windows Sandbox runtime and a working `wsb` CLI (`0.8.114.0+`) - Windows Sandbox enabled by the operator - Python 3.10 or newer - Node.js 22 or newer (and a persistent Node REPL with image display for visual sessions) - `ironrdp-agent` **0.1.1 or newer** on `PATH`, in Cargo's user bin directory (`~/.cargo/bin`), or selected via `IRONRDP_AGENT_BIN` ### Installing `ironrdp-agent` (`>= 0.1.1`) Windows Sandbox `0.8.114.0+` changed the private `WindowsSandboxServer` gRPC control-plane named pipe from single-GUID to a two-GUID layout (`\\.\pipe\wsandbox\-`). Upstream crates.io `ironrdp-agent 0.1.0` only probes the legacy single-GUID pipe and is rejected by `doctor`, `daemon-start`, `sandbox-connect`, and `sandbox-config`. Until upstream [Devolutions/IronRDP#2493](https://github.com/Devolutions/IronRDP/pull/2493) is merged and published as `>= 0.1.1`, install `0.1.1` from the fixed fork: ```sh cargo install --git https://github.com/2018wzh/IronRDP.git --branch fix/sandbox-grpc-owner-pipe --locked ironrdp-agent ``` Once an upstream `ironrdp-agent >= 0.1.1` release is published to crates.io, `cargo install ironrdp-agent` can be used directly. > Note: Windows Sandbox's local NamedPipe RDP endpoint (`\\.\pipe\{VMId}`) rejects TLS/CredSSP negotiation and relies on Windows per-user local named-pipe ACL isolation. This adapter strictly scopes connections to authorized local Windows Sandboxes and rejects generic network RDP targets, `.rdp` files, usernames, passwords, and certificate bypasses. ## Install with the Codex plugin Marketplace From this checkout, register the local Marketplace and install the plugin. ```sh codex plugin marketplace add . codex plugin add windows-sandbox-computer-use@windows-sandbox-tools ``` Start a new Codex task after installation, then invoke: ```text $windows-sandbox-computer-use ``` ## Install with `npx skills` Install this checkout globally for Codex. ```sh npx skills add . \ --skill windows-sandbox-computer-use \ --agent codex \ --global \ --yes ``` List the skill without installing it: ```sh npx skills add . --list ``` ## Validate the environment After loading the skill, use its adapter from the installed skill directory: ```sh python scripts/sandbox_cua.py doctor python scripts/sandbox_cua.py sandbox-list ``` `doctor` verifies both native `wsb` and `ironrdp-agent >= 0.1.1`. When `ironrdp-agent` is missing or older than `0.1.1`, `doctor` fails with `visual_available: false` while still reporting native `wsb` command capabilities. ## Headless lifecycle and visual control Start a headless Sandbox (no host Sandbox window is opened): ```sh python scripts/sandbox_cua.py sandbox-start ``` The command returns `sandbox_id`. Pass `--config FILE` to load startup settings from a `.wsb` XML file. Startup disables clipboard, microphone, camera, and printer redirection. Use `sandbox-share` to mount directories after startup. - **Command-only headless mode**: Run `sandbox-exec --run-as System` without starting `ironrdp-agent`. (`ExistingLogin` requires a logged-in guest desktop.) - **Headless visual + interactive mode**: Start the managed `ironrdp-agent` daemon (`daemon-start`) and connect via `sandbox.connect(selectedId)` (or `sandbox-connect --id SANDBOX_ID`). Connecting headlessly logs in `WDAGUtilityAccount`, captures full-frame PNGs via `sandbox.get_state()`, and delivers bounded mouse/keyboard input without opening a host Sandbox window. Initialize the persistent Node session as shown in [SKILL.md](plugins/windows-sandbox-computer-use/skills/windows-sandbox-computer-use/SKILL.md): ```js await sandbox.connect(selectedId); globalThis.state = await sandbox.get_state(); globalThis.state = await sandbox.click({ state: globalThis.state, x: 420, y: 260 }); ``` See the [API reference](plugins/windows-sandbox-computer-use/skills/windows-sandbox-computer-use/references/api.md) for all native and visual methods. Guest window enumeration and UI Automation accessibility trees are not provided; all visual decisions use inspected full-frame screenshots. Use `sandbox-stop SANDBOX_ID` to destroy an explicitly authorized Sandbox and discard its guest state. ## Scoped directory sharing Directory sharing is read-only by default: ```sh python scripts/sandbox_cua.py sandbox-share \ --id SANDBOX_ID \ --host-path work/debug-input \ --sandbox-path 'C:\DebugWorkspace' ``` Allow Sandbox writes only for an explicitly authorized output directory: ```sh python scripts/sandbox_cua.py sandbox-share \ --id SANDBOX_ID \ --host-path work/debug-output \ --sandbox-path 'C:\DebugOutput' \ --allow-write ``` The adapter rejects filesystem roots, missing directories, relative Sandbox paths, parent traversal and unknown Sandbox IDs. ## Development Run the focused validation suite: ```sh python scripts/validate_release.py python -m unittest discover \ -s plugins/windows-sandbox-computer-use/skills/windows-sandbox-computer-use/tests \ -p 'test_*.py' \ -v npx skills add . --list node --test plugins/windows-sandbox-computer-use/skills/windows-sandbox-computer-use/tests/test_session.mjs ``` The repository contains one canonical skill tree under the plugin. Both the Codex Marketplace and `npx skills` consume that same tree. ## Security This skill controls an isolated Windows desktop and can expose explicitly selected host directories. Read [SECURITY.md](SECURITY.md) before reporting a vulnerability or enabling writable sharing. ## License MIT. `ironrdp-agent` (IronRDP) is a separate dependency.