Microsoft's MXC: one SDK to sandbox agent-run code on Windows, macOS and Linux
MXC is Microsoft's open-source SDK for sandboxing model-written code across three OSes, for builders shipping agents that run commands locally.
Picture a two-person shop building an internal coding agent in Node. It writes small scripts, runs tests and edits a client's repo. Half the team is on MacBooks and half on Windows laptops. Today the agent's shell commands run with the full rights of whoever launched it. That covers their SSH keys, their Documents folder, every network destination, and the production config file the agent was only meant to read. The usual fixes don't fit well. Wrapping everything in Docker adds a heavy dependency for a desktop tool. Hand-rolling Seatbelt profiles on macOS and something else on Windows means maintaining a different sandbox per OS. And nobody can easily say why a command failed once it's locked down.
That is the gap Microsoft Execution Containers (MXC) targets. It's an open-source SDK, published on GitHub, that puts one policy model in front of each operating system's own sandbox. Microsoft declared it generally available on October 7, 2026, according to the Windows Developer Blog. Simon Willison flagged it the next day as "very promising."
What it is
The README describes MXC as "a sandboxed code execution system for running untrusted code (model output, plugins, and tools) on Windows, Linux, and macOS." It is an SDK dependency that builds into your app, not a service you run. Your application supplies three things: the container type, the containment rules and the workload command. MXC validates the request, picks the backend and launches the workload.
Here is how the pieces map to the lede's pain:
- One model, three OSes. The default backends are
processcontaineron Windows 11,bubblewrapon Linux andseatbelton macOS. Microsoft's blog says the Windows process container uses AppContainer. Other backends are LXC, WSLC, Windows Sandbox, Hyperlight, IsolationSession and a Nanvix microVM. The README marks several of these experimental. - Filesystem policy. You set read-only, read-write and denied path lists. That covers "read the server config, don't modify it," which is the scenario Microsoft's blog uses as its main example.
- Network policy. The README lists proxy support, outbound controls and "backend-dependent host filtering."
- UI policy. You control clipboard, display and GUI access.
- Lifecycle. Persistent containers can be provisioned, started, executed, stopped and deprovisioned, or you can do one-shot runs.
- SDKs. Rust, .NET and Node, with versioned APIs. For apps that can't embed the SDK, there are standalone executor binaries such as
wxc-exec.exethat take JSON requests. - Diagnostics. Tools to explain access-denied failures, which addresses the "why did it fail?" problem.
The design rule, per Microsoft, is that "an agent cannot be its own security authority": the policy sits outside the workload, so generated code can't grant itself more access. Pureinfotech reports that Microsoft lists GitHub Copilot, OpenAI Codex, OpenClaw, Replit, LM Studio and Unsloth AI as already supporting MXC, with Claude Code, Perplexity, Raycast and others said to be coming. Microsoft's Command Line post says Copilot can run commands "with controlled access to files, networks, system capabilities, and credentials."
Alternatives worth weighing:
- Docker Sandboxes run coding agents via the
sbxCLI, locally for free or on Docker's cloud with pay-as-you-go compute. It is a stronger fit if you want a managed tool and admin policies. MXC is the better fit if you need a library inside your own app. - microsandbox is a local-first microVM runtime with TypeScript, Rust, Python, Go and Ruby SDKs, OCI images and snapshots. It gives hardware-level isolation, but its README warns it's "still beta software."
- Quicksand, another Microsoft project, is a Python library that bundles QEMU to run, for example, Alpine Linux. Willison says he tried it on all three OSes. An open issue shows that port forwards currently go only from guest to host.
- AWS has also released an open-source agent sandbox, aimed at "YOLO mode" agents per The Register's headline. Our sources don't detail it, so we can't compare it here.
Who it's for
Pick it up if you ship an app or agent harness, in Node, Rust or .NET, that executes model-written code or third-party tools on users' own machines. It suits you most if those machines are a mix of Windows, Mac and Linux and you'd rather not maintain three sandbox configs. Windows-heavy teams get the most: session containers, WSLC and the audit tooling are Windows-only.
Skip it for now in three cases:
- You need strong isolation on macOS. The README lists only Seatbelt there, with no VM option.
- Your stack is Python. The SDKs are Rust, .NET and Node. Quicksand or microsandbox may fit better.
- Your agents already run in remote or containerized environments you control, where Docker Sandboxes or a microVM runtime is already doing the job.
Before and after
Before:
- The agent proposes a shell command.
- Your harness runs it as the logged-in user, with full file and network access.
- You rely on prompt instructions and an approval click to keep it out of
~/.sshor the production config. - For real isolation you write per-OS sandbox code, or ship Docker.
- When a locked-down command fails, you guess why.
After:
- The agent proposes a command.
- Your harness wraps it in an MXC
ContainerRequestthat declares the command, network egress rules and a timeout. - MXC picks the platform backend (Seatbelt, Bubblewrap or the Windows process container) and enforces the policy outside the agent's control.
- If the command hits a wall, MXC's diagnostics explain the access-denied failure.
- While authoring policy, you tune it in a learning-style mode. Ccleaks, a lower-reliability how-to outlet, describes three modes (Enforcement, Learning, Permissive) and says the activity report is available only on Windows.
Ccleaks reports that Microsoft suggests using a coding agent to integrate the SDK and draft the first policy, then reviewing and refining it by hand. That is a reasonable vibe-engineering loop, as long as a human owns the final policy.
Try it
You don't need to clone the repo. The README says to install an SDK from your package manager:
- Rust:
mxc-sdkon crates.io - .NET:
Microsoft.Mxc.Sdkon NuGet - Node:
@microsoft/mxc-sdkon npm
The Node and .NET packages include the native runtime assets. The Rust crate compiles the SDK, engine and chosen backends into your app. The README's Node example runs a command with outbound network denied and a 30-second timeout:
import { spawn, type ContainerRequest } from '@microsoft/mxc-sdk/v1';
const request: ContainerRequest = {
command: 'node -e "console.log(\'hello from container\')"',
network: { egress: { default: 'deny' } }, // block all outbound traffic
timeoutMs: 30_000,
};
const child = await spawn(request);
The README notes that your app "will hit access issues when running in a sandbox, until you've had time to tune your containment rules." If you use the standalone executor, you can get diagnostic output with:
wxc-exec.exe --debug config.json
Building from source is only needed if you're changing MXC itself or using the executors directly. It requires Rust pinned to 1.93 and Node.js 24 or later. Our sources don't give SDK version numbers or a minimal file-policy JSON example. Use the repo's samples/ and docs/api-reference/ folders for those.
Where it breaks
- Isolation strength varies by backend. Microsoft's blog positions process containers as lightweight and MicroVM as the "hardware-backed" option for higher-risk workloads. It also says each backend "has distinct security properties." No source we found independently compares Seatbelt or Bubblewrap with microVM isolation.
- macOS gets one backend. The README lists only Seatbelt on macOS.
- Experimental labels. Windows Sandbox, microVM and Hyperlight are starred experimental on Windows in the README. Microsoft's blog labels MicroVM experimental on Linux too, while the README's Linux row doesn't star it. Microsoft hasn't stated a maintenance commitment for these backends beyond those labels.
- Network host filtering is "backend-dependent." Our sources don't say which backends enforce it. Verify on each OS you ship before relying on an allow-list.
- Audit mode is unsafe by design. The README warns that
--audit"turns off all sandbox security for the workload being analyzed. Never use it to run untrusted code." It is available on supported Windows releases only. - Windows-first tooling. Session containers, WSLC, audit mode and (per Ccleaks) activity reports are Windows-only. Microsoft's blog says Entra identity and Agent 365 controls are coming soon; they aren't shipped.
- Telemetry. Official Microsoft builds can send diagnostic telemetry, but only with per-run opt-in, user consent, admin permission and your app enabling it. It's a no-op on non-Windows platforms and in local open-source builds.
- Not a cure-all. CNET notes that "no AI safety program is totally bulletproof." A sandbox limits the damage from a bad action. It doesn't make the agent's choices correct.
- Unconfirmed. One report places MXC's debut earlier than the October 7 GA announcement; we couldn't verify it. We also didn't research how MXC compares with hosted sandboxes such as E2B.
Sources
- GitHub - microsoft/mxc: Policy-driven, layered isolation and containment · GitHub
- Microsoft Execution Containers: Policy-driven containment for AI agents · Windows Developer Blog
- Bringing local models and sandboxed tools to Windows and GitHub Copilot · Command Line
- Microsoft has a new way to stop AI agents from accessing everything on Windows 11 · Pureinfotech • Windows 10 & Windows 11 help for humans
- How Microsoft Is Trying to Keep Your AI Agents Contained - CNET · CNET
- How to Use Microsoft Execution Containers to Sandbox AI Agents · Ccleaks
- Feature request: port forwards in opposite direction · Issue #55 · microsoft/quicksand · GitHub
- Docker Sandboxes · Docker Inc
- GitHub - superradcompany/microsandbox: 🧱 easy, fast, programmable and local-first microVM runtime and library · GitHub
- AWS launches open-source AI agent sandbox to prevent YOLO mode disasters · Theregister
- @simonw: New open source cross-platform (Windows, macOS, Linux) sandboxing library from Microsoft… · @simonw