AI EngineerGuide

Microsoft's sandboxed code execution system - MXC

by Ashik Nesin Ashik Nesin

Microsoft has released open source sandbox code execution system

Under the hood, it uses OS native’s sandbox tool like Bubblewrap for linux, Apple’s seatbelt, etc

It lets you run your unsafe code (like agent generated code) in a sandbox environment where you can configure the policy like network access.

image.png

How to get started?

Just install this package @microsoft/mxc-sdk via npm and you can use it like this

import { spawn, type ContainerRequest } from '@microsoft/mxc-sdk/v1';

const request: ContainerRequest = {
  command: 'node -e "console.log(\'hello from container\')"',
  network: { egress: { default: 'deny' } },
  timeoutMs: 30_000,
};

const child = await spawn(request);

Reference

Stay Updated

Get the latest AI engineering insights delivered to your inbox.

No spam. Unsubscribe at any time.