Microsoft's sandboxed code execution system - MXC
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.
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);