What it does
sandbin runs untrusted code and isolates each submission from the host. A submission is sent to an HTTP endpoint. A WebSocket protocol streams the run so you can watch it. The CLI also runs code from a terminal. Supported languages are Python, Bash, Node.js, C and Go. A compiled language is sandboxed twice. sandbin says a misbehaving submission dies and the host does not notice. To try it yourself, run git clone, npm install and npm start. This opens a playground at localhost:8080. In the playground you pick a language, write your own code and run it live.
Capabilities
- Each submission gets its own PID namespace, its own empty network stack and its own filesystem view, with no host filesystem, no host processes and a private tmpfs root.
- A seccomp allowlist permits 146 syscalls and denies everything not explicitly needed.
- cgroup v2 sets hard ceilings on memory, CPU and process count through memory.max, cpu.max and pids.max, with cgroup.kill teardown.
- rlimits cover file size and open descriptors, and core dumps are disabled.
- sandbin says it measured a 21 ms start against 369 ms for Docker, 17.6 times faster, as the median of 20 runs each on the same machine.
When to use it
- You need to run untrusted code.
- You want to run code from a terminal, locally with no server or against a remote one.
- You want to submit a run over an HTTP endpoint and watch it stream over a WebSocket.