{"id":50728946,"url":"https://github.com/microsoft/mxc","last_synced_at":"2026-06-11T00:00:45.197Z","repository":{"id":362351278,"uuid":"1151717775","full_name":"microsoft/mxc","owner":"microsoft","description":"Policy-driven, layered isolation and containment ","archived":false,"fork":false,"pushed_at":"2026-06-10T20:56:59.000Z","size":3503,"stargazers_count":868,"open_issues_count":21,"forks_count":41,"subscribers_count":7,"default_branch":"main","last_synced_at":"2026-06-10T22:22:02.715Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-06T20:13:08.000Z","updated_at":"2026-06-10T22:18:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/microsoft/mxc","commit_stats":null,"previous_names":["microsoft/mxc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/microsoft/mxc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fmxc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fmxc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fmxc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fmxc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/mxc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fmxc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34175887,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-10T07:00:27.292Z","updated_at":"2026-06-11T00:00:45.180Z","avatar_url":"https://github.com/microsoft.png","language":"Rust","funding_links":[],"categories":["Applications","Repos","Sandboxing \u0026 Isolation"],"sub_categories":["Security tools"],"readme":"# Microsoft eXecution Container (MXC)\n\nMXC is a **sandboxed code execution system** for running untrusted code (model output, plugins, tools) on Windows, Linux, and macOS. It provides multiple containment backends — from OS-native process sandboxes to full VMs — behind a unified JSON configuration schema and TypeScript SDK.\n\n\u003e [!WARNING]\n\u003e This repository contains an early preview of code published to enable early integration and feedback from developers on Microsoft Execution Containers. The underlying sandboxes in this early preview are expected to change as they are under ongoing development however we will aim to minimize compatibility impact as functionality evolves. There are known cases where the current policies generated by the MXC SDK in this repository are overly permissive and will be addressed before this is made more generally available. Security researcher partnership while MXC matures is welcome, however no MXC profiles should be treated as security boundaries currently.\n\n## Features\n\n- **Cross-platform**: Windows, Linux, and macOS support with platform-appropriate containment backends\n- **JSON-based Configuration**: Define execution parameters and security policies via a versioned JSON schema\n- **Multiple Containment Backends**: ProcessContainer, Windows Sandbox, LXC, Bubblewrap, Seatbelt (macOS), MicroVM (NanVix), Hyperlight, IsolationSession, and WSLC\n- **Policy-driven Sandboxing**:\n    - **Filesystem Policy**: Read-only and read-write path lists (denied paths not yet supported on Windows)\n    - **Network Policy**: Proxy support (not supported on macOS); allow/block outbound and host filtering (not yet supported on Windows)\n    - **UI Policy**: Clipboard, display, and GUI access controls\n- **State-aware Lifecycle**: Multi-step sandbox lifecycle (provision → start → exec → stop → deprovision) for session sandboxes\n- **TypeScript SDK**: [`@microsoft/mxc-sdk`](https://www.npmjs.com/package/@microsoft/mxc-sdk) npm package with one-shot and state-aware APIs\n- **Diagnostics**: Debug logging and Event Tracing for Windows (ETW) for troubleshooting\n\n## Building\n\nMXC ships a native container wrapper plus a TypeScript SDK — see the [SDK README](./sdk/README.md) for full API documentation.\n\n### Platforms\n\n| Platform | Default backend | Other backends | Minimum build |\n| --- | --- | --- | --- |\n| Windows 11 24H2+ (verified on 25H2) | `processcontainer` | `windows_sandbox`, `wslc`, `microvm`, `hyperlight`, `isolation_session` | `processcontainer`: 26100 (24H2)\u003cbr\u003e`isolation_session`: 26300.8553 ([Insider Preview](https://learn.microsoft.com/en-us/windows-insider/release-notes/experimental/preview-build-26300-8553)) |\n| Linux x64 / ARM64 | `bubblewrap` | `lxc`, `microvm`, `hyperlight` | — |\n| macOS ARM64 / x64 (schema `0.6.0-alpha`+) | `seatbelt` | — | — |\n\n\nThe stable one-shot backends (`processcontainer`, `bubblewrap`, and `lxc`) do not require experimental mode; Linux hosts also need the matching runtime installed: bwrap (Bubblewrap) for the default backend, or the lxc toolset for the lxc backend. **Experimental backends** (`windows_sandbox`, `wslc`, `microvm`, `seatbelt`, `isolation_session`, `hyperlight`) require `{ experimental: true }` in `SandboxSpawnOptions` or the `--experimental` CLI flag.\n\n\n### Requirements\n\n- [Rust toolchain](https://rustup.rs/) — version pinned to **1.93** via `src/rust-toolchain.toml` (auto-selected by `rustup`)\n- Node.js **≥ 18**\n- npm (for SDK and CLI builds)\n\n### Project Structure\n\n```\nsrc/        Rust workspace (native binaries + shared library crates)\nsdk/        TypeScript SDK (@microsoft/mxc-sdk npm package)\nschemas/    JSON configuration schemas (stable + dev)\ndocs/       Documentation (schema reference, backend guides, design docs)\ntests/      Test collateral (configs, examples, scripts)\nscripts/    Build and utility scripts\n```\n\n### Full Build\n\n#### Windows\n\n```bash\nbuild.bat                  # Release build for current architecture\nbuild.bat --debug          # Debug build\nbuild.bat --all            # Release build for both x64 and ARM64\nbuild.bat --with-microvm   # Include NanVix micro-VM binaries\n```\n\n#### Linux\n\n```bash\n./build.sh                 # Release build\n./build.sh --debug         # Debug build\n./build.sh --rust-only     # Only Rust binaries, skip SDK/CLI\n```\n\n#### macOS\n\n```bash\n./build-mac.sh             # Release build for native architecture\n./build-mac.sh --all       # Both Apple Silicon and Intel\n./build-mac.sh --debug     # Debug build\n./build-mac.sh --rust-only # Only Rust binary, skip SDK\n```\n\nAll build scripts:\n1. Build the platform-appropriate Rust binary\n2. Copy the binary into `sdk/bin/\u003carch\u003e/` (for example, `x64` or `arm64`) for SDK bundling\n\n3. Build the TypeScript SDK\n\n### Building Components Individually\n\n```bash\n# Rust workspace (from src/)\ncargo build --release --target x86_64-pc-windows-msvc     # Windows x64\ncargo build --release --target aarch64-pc-windows-msvc    # Windows ARM64\ncargo build --release -p lxc                               # Linux — lxc-exec (serves both LXC and Bubblewrap)\ncargo build --release -p mxc_darwin --target aarch64-apple-darwin  # macOS\n\n# SDK (from sdk/)\nnpm install \u0026\u0026 npm run build\n```\n\n### Lint and Format\n\n```bash\n# Windows Rust (from src/)\n\ncargo clippy --workspace --all-targets -- -D warnings\n\n# Linux Rust (from src/; matches build.sh's platform-compatible crate set)\n\ncargo clippy -p lxc -p lxc_common -p wxc_common -p bwrap_common -p linux_test_proxy --all-targets -- -D warnings\n\n# macOS Rust (from src/)\n\ncargo clippy -p mxc_darwin -p seatbelt_common --all-targets -- -D warnings\n```\n\n### Tests\n\n```bash\n# Rust unit tests (from src/)\ncargo test --workspace\ncargo test -p wxc_common                      # Single crate\ncargo test -p wxc_common -- config_parser     # Filter by test name\n\n# SDK (from sdk/)\nnpm test                     # Unit tests\nnpm run test:integration     # Integration tests\n\n# E2E (from src/)\ncargo test -p wxc_e2e_tests\n```\n\n## Usage\n\nMXC uses a JSON configuration to define execution parameters. See the [schema documentation](docs/schema.md) for full reference.\n\n### Native Binary\n\n```bash\n# File path\nwxc-exec.exe config.json\n\n# Base64-encoded config\nwxc-exec.exe --config-base64 \u003cbase64-encoded-json\u003e\n\n# Debug output\nwxc-exec.exe --debug config.json\n```\n\nOn Linux: `./lxc-exec config.json`\nOn macOS: `./mxc-exec-mac --experimental config.json`\n\n### TypeScript SDK\n\n```bash\nnpm install @microsoft/mxc-sdk\n```\n\n```typescript\nimport {\n  spawnSandboxFromConfig, createConfigFromPolicy,\n  getAvailableToolsPolicy, getTemporaryFilesPolicy,\n  getPlatformSupport,\n} from '@microsoft/mxc-sdk';\n\nif (!getPlatformSupport().isSupported) {\n  throw new Error('MXC not available on this host');\n}\n\nconst tools = getAvailableToolsPolicy(process.env);\nconst temp  = getTemporaryFilesPolicy();\n\nconst config = createConfigFromPolicy({\n  version: '0.6.0-alpha',\n  filesystem: {\n    readonlyPaths:  tools.readonlyPaths,\n    readwritePaths: temp.readwritePaths,\n  },\n  network: { allowOutbound: false },\n  timeoutMs: 30_000,\n});\nconfig.process!.commandLine = 'python -c \"print(\\'hello from sandbox\\')\"';\n\nconst child = spawnSandboxFromConfig(config, { usePty: false });\nchild.stdout!.on('data', (d) =\u003e process.stdout.write(d));\nchild.on('close', (code) =\u003e console.log('exit:', code));\n```\n\nThe SDK also provides a **state-aware lifecycle** API for long-lived sandboxes:\n\n```typescript\nimport {\n  provisionSandbox, startSandbox, execInSandboxAsync,\n  stopSandbox, deprovisionSandbox,\n} from '@microsoft/mxc-sdk';\n```\n\nSee the [SDK README](sdk/README.md) for full API documentation.\n\n## Schema Versions\n\n| Version | Status | Schema File |\n|---------|--------|-------------|\n| `0.5.0-alpha` | Stable | [`schemas/stable/mxc-config.schema.0.5.0-alpha.json`](schemas/stable/mxc-config.schema.0.5.0-alpha.json) |\n| `0.6.0-alpha` | Stable (current) | [`schemas/stable/mxc-config.schema.0.6.0-alpha.json`](schemas/stable/mxc-config.schema.0.6.0-alpha.json) |\n| `0.7.0-dev` | Dev (experimental backends, state-aware lifecycle) | [`schemas/dev/mxc-config.schema.0.7.0-dev.json`](schemas/dev/mxc-config.schema.0.7.0-dev.json) |\n\nPick `0.6.0-alpha` for new code on any supported platform. See [docs/versioning.md](docs/versioning.md) for the full versioning design.\n\n## Debugging\n\n### Debug Console Mode\n\nBy default, native binaries run in **silent mode** — stdin/stdout/stderr is coupled directly to the container. Use `--debug` for verbose output:\n\n```bash\nwxc-exec.exe --debug config.json\n```\n\nSee [docs/diagnostics.md](docs/diagnostics.md) for full diagnostics reference.\n\n## Documentation\n\n| Document | Description |\n|----------|-------------|\n| [docs/schema.md](docs/schema.md) | Full JSON configuration schema reference |\n| [docs/versioning.md](docs/versioning.md) | Schema versioning and experimental feature lifecycle |\n| [docs/examples.md](docs/examples.md) | Annotated configuration examples |\n| [docs/host-prep.md](docs/host-prep.md) | Windows host preparation (`wxc-host-prep.exe`) |\n| [docs/diagnostics.md](docs/diagnostics.md) | Diagnostic logging and ETW |\n| [docs/sandbox-policy/v1/policy.md](docs/sandbox-policy/v1/policy.md) | Sandbox policy v1 specification |\n| [docs/base-process-container/guide.md](docs/base-process-container/guide.md) | Windows AppContainer / BaseContainer guide |\n| [docs/lxc-support/lxc-backend.md](docs/lxc-support/lxc-backend.md) | LXC backend (Linux) |\n| [docs/bwrap-support/bubblewrap-backend.md](docs/bwrap-support/bubblewrap-backend.md) | Bubblewrap backend (Linux) |\n| [docs/macos-support/seatbelt-backend.md](docs/macos-support/seatbelt-backend.md) | Seatbelt backend (macOS) |\n| [docs/windows-sandbox/windows-sandbox.md](docs/windows-sandbox/windows-sandbox.md) | Windows Sandbox backend |\n| [docs/state-aware-lifecycle/mxc-state-aware-sandbox-api.md](docs/state-aware-lifecycle/mxc-state-aware-sandbox-api.md) | State-aware sandbox lifecycle API |\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines.\n\n## License\n\nSee [LICENSE.md](LICENSE.md) for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fmxc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2Fmxc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fmxc/lists"}