Your Agent Gets a Throwaway Windows PC
An awdk agent can now open a brand-new Windows PC, run something suspicious in it, and tell you what it did. Then the PC is thrown away.
Windows 11 Pro ships a feature most people never turn on: Windows Sandbox, a whole Windows
desktop built from your own install that boots in about 15 seconds and is deleted when it
closes. Scott Hanselman's sandbox-mcp (MIT)
turned it into a command, sbx, with one feature that stands out: sbx detonate. Give it
a file and it runs that file in a fresh sandbox with no network adapter. It reports every
process started (with its command line), every name looked up, every connection attempted,
and every autorun, scheduled task, service or file it planted.
awdk now wraps sbx the same way it already wraps Sysinternals and PowerToys. Every agent
in the fleet can reach all three through one tool table. This is rolling out with the next
awdk release.
The verdict up front
- Three Windows toolkits, one table. Sysinternals (processes, services, modules, ports,
handles, dumps), PowerToys (FancyZones layouts, Workspaces, modules on and off) and
Windows Sandbox (detonate, run, install-test, deps) are rows in
DESKTOP_TOOLS. - The table is the whole integration. The in-process agent, the harness daemon's
/desk/toolsroute and the MCP gateway's desktop proxy all read it, so Claude Code and every fleet agent get a new tool the moment a row is added. - Anything that changes the machine or runs untrusted code needs
confirm=true. The route refuses it otherwise. - Detonation is offline by default. A guest that reaches the internet needs an explicit
allow_network=True.
One table, three readers
DESKTOP_TOOLS: List[Tuple[Callable[..., str], str]] = [
(desktop_list_windows, ""),
(desktop_arrange, "write"),
*[(fn, "") for fn in SYSINTERNALS_TOOLS],
(desktop_procdump, "write"),
...
# Sandbox tools that boot a VM, run untrusted code or write host artifacts are
# write-class: the daemon refuses them unless the caller sends confirm=true.
*[(fn, "write" if fn in _SANDBOX_WRITE_TOOLS else "") for fn in SANDBOX_TOOLS],
]
Each row is a function and an action class: "" reads, "write" changes the machine.
The daemon's route (awdk/adk/harnesses/desktop_routes.py) enforces the class:
if live and not confirm:
return 403, {"ok": False, "reason": "confirm_required", ...}
A write tool that can plan, such as desktop_arrange or desktop_sandbox_install,
defaults to dry_run=True and returns the plan. A tool that can only act (detonate, run,
install-test) has no dry run, so the route refuses every call to it that does not carry
confirm=true. In practice that means a person, or a policy, approves the run.
Sysinternals: parsed rows, never console text
awdk/adk/desktop/sysinternals.py has one runner. Every call passes -accepteula -nobanner, has a hard timeout, decodes the console code page with replacement, and returns
rows as dicts. The timeout is not decoration: handle run without elevation was measured
hanging past 120 seconds. Targets are validated before anything runs, and the patterns
never accept a leading dash, so an argument cannot become a flag:
_PSPING_TARGET = re.compile(r"^(?!-)[A-Za-z0-9._\[\]:-]{1,255}$")
_PROCESS_FILTER = re.compile(r"^(?!-)[A-Za-z0-9 ._()+-]{1,128}$")
So "what is holding port 8150?" comes back as rows with process, pid, state,
local and remote, and the agent never has to parse a console.
PowerToys: the settings file is the API
PowerToys keeps an enabled map in %LOCALAPPDATA%\Microsoft\PowerToys\settings.json and
hot-reloads it. powertoys.py writes that file atomically (temp file, then replace), so a
half-written file never reaches the PowerToys runner. Turning a module on, applying a
FancyZones layout, or launching a saved Workspace needs no fork and no UI automation.
Windows Sandbox: no shell, a pinned download, offline by default
The sandbox tools run code nobody trusts, so the wrapper is strict about four things.
No shell ever parses your arguments. The release ships sbx.cmd, and that shim is one
line: "%~dp0node.exe" "%~dp0src\cli.js" %*. Running a .cmd file means running
cmd.exe, which re-reads its whole command line as shell text. A value like &calc.exe
or %USERPROFILE% would then be shell syntax on your real machine. awdk skips the shim and
starts its target directly:
def command_prefix(sbx: Path) -> List[str]:
sbx = Path(sbx)
if sbx.suffix.lower() in (".cmd", ".bat"):
direct = node_cli(sbx) # [node.exe, src/cli.js] beside sbx.cmd
if direct is None:
raise SandboxError("refusing to run %r through cmd.exe ...", reason="not_installed")
return direct
return [str(sbx)]
The argument list goes straight to CreateProcess. We checked it with Windows' own parser
(CommandLineToArgvW): &calc.exe, %USERPROFILE% and a & whoami | calc ^ !x! each
arrive as exactly one argument, and so does an install path with a space in it.
The download is pinned. desktop_sandbox_install fetches the release ZIP over https
only, from github.com, api.github.com, objects.githubusercontent.com or
release-assets.githubusercontent.com. That check runs on the requested URL, on every
redirect hop and on the final URL. The body is capped at 128 MiB while it streams. Before
anything is extracted, the ZIP's SHA-256 must match both the release's .sha256 asset and
the digest GitHub's release API reports for it. Extraction refuses absolute paths, ..
segments and drive letters, and caps members (20,000) and expanded size (512 MiB). For
v1.2.0 that digest is e0fb22207acf904bc1d8fb8da7c990f73554dbb9465c7e87a53c988eed2adecb.
The guest stays offline unless you say otherwise.
def _check_network(value: str, *, allow_on: bool, what: str) -> str:
net = (value or "off").strip().lower()
...
if net == "on" and not allow_on:
raise SandboxError("network 'on' is refused for %s: pass allow_network=True ..." % what,
reason="refused")
off means the sandbox has no network adapter; sbx controls it through an encrypted
shared-folder mailbox. firewall shows which addresses and ports the file tries, all
blocked.
Your host paths are checked before anything touches them. The target must be a real
local file or folder. Network, device and extended paths (\\host\share, \\?\, \\.\)
are refused before any filesystem call. A stat of a UNC path opens an SMB session, and
that session would hand the remote host your Windows sign-in. What comes back from the
guest is treated as untrusted data: report.json is read with a bounded read, truncated,
and returned as text. It is never executed and never followed as a path.
Try it
Turn Windows Sandbox on once (Windows 11 24H2 or later, Pro, Enterprise or Education), from an administrator PowerShell, then restart and open Windows Sandbox from the Start menu once:
Enable-WindowsOptionalFeature -Online -FeatureName Containers-DisposableClientVM -All
Then ask your agent to install the tool (it shows the plan first) and run the readiness check. After that you can hand it a file:
desktop_sandbox_install(dry_run=false) # with confirm=true
desktop_sandbox_doctor()
desktop_sandbox_detonate("C:\\Users\\you\\Downloads\\invoice.js") # with confirm=true
Each run leaves report.md, report.json, screenshots and an audit log under
%LOCALAPPDATA%\sandbox-mcp\runs\<timestamp>, after the sandbox itself is gone.
Limits
Findings are heuristics, not a safety verdict: installers add autoruns and services too. Windows allows one sandbox at a time, and each one wants about 4 GB of RAM.
In awdesk: pick a file, read the card
awdesk now has Detonate a file in Windows Sandbox in its command list, plus a
desk://sandbox/detonate?path=... link that another app can use to hand a file in. Both go through the same flow, and the order of the steps is what makes it safe:
- The desk copies the file into its own folder first. It streams the file into a
per-request folder under awdesk's app data (refusing anything over 2 GiB or of a type
sbxwill not run), hashes the copy, and shows that SHA-256 on the confirm card next to the original name. Nothing has been sent to the daemon yet; adesk://link alone can only raise this card. - Your click is the confirmation. On the click the desk re-hashes the copy. If a single
byte changed it refuses, before any call. Otherwise it calls
desktop_sandbox_detonatewithconfirm=trueand networkoffon the copy, never on the file you picked. - The report card is counts, not a verdict. Processes, name lookups, connection attempts, services added, persistence entries and scheduled tasks, plus the digest the sandbox itself reports. If that digest differs from the card's, the card says so in capitals. Guest text is rendered as plain text and capped.
- Open folder opens only a real run folder. The desk resolves both the runs root and the
target with
realpathSyncand refuses any junction or symlink below the root, so a planted reparse point cannot send it anywhere else.
A long run can produce a receipt bigger than awdk returns whole. awdk then keeps a summary (exit code, run folder, executed digest and the per-category counts, computed before truncation), so the card still has everything it needs.
Keep the journal free
Sponsorship pays for the compute, the hardware and the hours behind these entries.
by email
New journal entries, in your inbox.
What the agents built, broke and fixed. One message per entry.