Quickstart in 5 minutes
This page takes you from the source code to a forked sandbox. It is the short path. The tutorial gives each step in full.
What you need
Section titled “What you need”- A Linux machine with Docker, or a Mac with Docker or Podman.
- Go 1.26 or later, to build boxfork.
- Python 3.9 or later, for the last part.
1. Start the daemon
Section titled “1. Start the daemon”-
Get the source and build it:
Terminal window git clone https://github.com/mvplab-ai/boxfork.gitcd boxforkmake build -
If you use Podman on a Mac, start the Podman machine and give its socket to the daemon:
Terminal window podman machine startexport DOCKER_HOST=unix://$(podman machine inspect --format '{{.ConnectionInfo.PodmanSocket.Path}}') -
Start the daemon, and keep its terminal open:
Terminal window ./bin/boxfork serveOn the first start, the daemon prints an API key one time. The CLI on the same machine finds the key itself.
2. Create a sandbox and run code in it
Section titled “2. Create a sandbox and run code in it”Open a second terminal.
-
Create a sandbox. The command prints its ID:
Terminal window $ ./bin/boxfork create --image python:3.12sbx_uulezsidjhktd4lbThe first create of an image pulls the image, so it is slower.
-
Run a command in the sandbox:
Terminal window $ ./bin/boxfork exec sbx_uulezsidjhktd4lb -- python3 -c 'print(6 * 7)'42 -
Copy a file into the sandbox:
Terminal window ./bin/boxfork cp ./data.csv sbx_uulezsidjhktd4lb:/work/data.csv
A sandbox has a timeout. When the timeout ends, the daemon kills the sandbox.
--timeout 30m gives a longer life.
3. Fork it
Section titled “3. Fork it”A fork makes new sandboxes with the same files. This command makes three copies:
$ ./bin/boxfork fork --count 3 sbx_uulezsidjhktd4lbsbx_ww35nl5skarr6d2ysbx_eq3pjkqbrx3sysm5sbx_ba322nviqowim5x4Each copy has /work/data.csv. A change in one copy does not go to the other copies.
4. Do the same from Python
Section titled “4. Do the same from Python”-
Install the Python SDK from the repository:
Terminal window pip install ./sdk/python -
Run this program:
from boxfork import Sandboxwith Sandbox.create("python:3.12-slim") as sbx:sbx.files.write("/work/hello.py", "print('hello')")print(sbx.run("python3 /work/hello.py").stdout)sbx.run("pip install --quiet cowsay") # prepare one timefor copy in sbx.fork(3): # three copies with the packageprint(copy.id)copy.kill()
At the end of the with block, the SDK kills the first sandbox.
5. Clean up
Section titled “5. Clean up”- Kill each sandbox that you made:
./bin/boxfork kill <id>. - Stop the daemon with Ctrl+C.
- Use with any LLM: give the sandbox to Claude Code, or to any model through tool calls.
- How it works: the daemon, the gVisor wall and the helper.
- Deploy: one machine, a cloud, or Kubernetes.