Design decisions
This page is the record of the decisions that shape boxfork. Each record gives the context, the decision, the reason and the cost. Read a record before you change the part that it controls.
Add a record when you make a decision that is hard to change later. Do not delete an old record. If a decision changes, add a new record and set the old record to “Replaced”.
| Number | Decision | Status |
|---|---|---|
| 1 | Sandboxes for agents first, open source, on your own machine | Accepted |
| 2 | gVisor on a container engine first, a microVM backend later | Accepted |
| 3 | One Go binary, no database, no Kubernetes | Accepted for one machine. Decision 17 covers clusters. |
| 4 | The daemon speaks the Docker Engine API directly | Accepted |
| 5 | A helper in each sandbox, and no network connection into a sandbox | Accepted |
| 6 | One whole GPU for one sandbox | Accepted |
| 7 | A snapshot keeps files only | Accepted |
| 8 | One state file in JSON | Accepted |
| 9 | One API key for one daemon | Accepted for version 1 |
| 10 | No model in the daemon | Accepted |
| 11 | Python gets new features first, and TypeScript follows | Accepted. Changed on 5 December 2026. |
| 12 | A pool hands out sandboxes that already run | Accepted |
| 13 | One kept connection for the commands of a sandbox | Accepted |
| 14 | Version 1 and version 2, with a proof between them | Accepted |
| 15 | Documentation in Simplified Technical English, in the repository | Accepted |
| 16 | The name is boxfork | Accepted on 5 December 2026 |
| 17 | Clusters run on Kubernetes, with boxfork resources of their own | Accepted on 5 December 2026 |
1. Sandboxes for agents first, open source, on your own machine
Section titled “1. Sandboxes for agents first, open source, on your own machine”Context. Hosted sandbox services are closed, or they have no GPU, or you cannot run them on your own machine. The open-source projects that have a GPU are large platforms with many components.
Decision. boxfork is an open-source project with the Apache-2.0 licence. The first stage is self-hosted: the user runs one binary on a machine that the user owns or rents. A hosted service can come later. It will run the same open code. Work for CI/CD is not in the plan now. The design leaves space for it.
Reason. The users that hosted services do not serve are these:
- Users who cannot send code or data to a third party.
- Users who already own or rent GPU machines.
- Users with constant, heavy use, for whom a price for each second is too high.
Cost. The user must operate one machine. A machine with a GPU costs money while it is on, also when no sandbox uses it. With the Apache-2.0 licence, a different company can host the same code as a service.
2. gVisor on a container engine first, a microVM backend later
Section titled “2. gVisor on a container engine first, a microVM backend later”Context. A sandbox runs code that nobody trusts. The isolation must be stronger than a plain container. The two common answers are a microVM (Firecracker, Cloud Hypervisor) and gVisor.
Decision. Version 1 runs each sandbox as a container under gVisor (runsc) when gVisor is installed.
A plain container is a fallback. The daemon marks it clearly as suitable only for code that you trust.
The engine is behind an interface, so that a microVM backend can come later with no change to the API.
Reason.
- A microVM needs KVM. Many cloud machines, and many rented GPU machines, do not give KVM. gVisor runs on a usual Linux machine.
- Firecracker has no support for a GPU. gVisor has support for NVIDIA GPUs.
- The same binary then runs on a laptop for development and on a cloud machine.
Cost.
- The boundary of gVisor is strong, but the boundary of a microVM is stronger.
- With a GPU, the code in the sandbox talks to the NVIDIA driver. gVisor protects less against a defect in that driver.
- A sandbox cannot run Docker.
- A snapshot cannot keep the memory of a sandbox. See decision 7.
3. One Go binary, no database, no Kubernetes
Section titled “3. One Go binary, no database, no Kubernetes”Context. The aim is a tool that one person can install with one command and understand in one day.
Decision. The daemon, the CLI and the MCP server are one Go binary, boxfork.
The helper is a second small Go binary. The build embeds it in the first.
The repository has no Go dependency outside the standard library.
Reason. Go gives one static file for each chip type, and the cross-build is one command. The daemon holds many connections at the same time, and Go does that well with small code. We measured where the time of a command goes: almost all of it was in the engine, not in the daemon. A faster language does not change that.
Cost. One machine is the limit of version 1. Work for more than one machine is a later stage. Without dependencies, the project must contain its own small clients for the Docker Engine API and for MCP.
4. The daemon speaks the Docker Engine API directly
Section titled “4. The daemon speaks the Docker Engine API directly”Decision. The daemon sends HTTP requests to the socket of the engine. It does not use the Docker SDK.
Reason. The daemon uses a small part of the API. The direct client keeps the binary small and the build simple. The same client works with Podman, which gives a compatible API.
Cost. We must follow changes in the Engine API ourselves. Podman differs from Docker in some answers. internals/engine.md lists the differences that we found.
5. A helper in each sandbox, and no network connection into a sandbox
Section titled “5. A helper in each sandbox, and no network connection into a sandbox”Context. The daemon must run commands and read and write files in a sandbox. A common design puts a server in the sandbox, and the daemon connects to it over the network.
Decision. The daemon copies a small helper into each sandbox. For each operation, the daemon asks the engine to run the helper. The daemon talks to the helper through the input and the output of that process. The daemon opens no network connection into a sandbox.
Reason.
- A sandbox with no network is fully controllable.
- A sandbox has no open port that other code can attack.
- An idle sandbox runs only its first process, so it uses almost no memory and no CPU.
Cost. Each new process that the engine starts costs time. Decision 13 removes most of that cost for commands. The helper runs in the sandbox, so the code in the sandbox can kill it or stop it. The daemon must not trust anything that the helper sends.
6. One whole GPU for one sandbox
Section titled “6. One whole GPU for one sandbox”Decision. A sandbox gets whole GPUs: one or more. Each GPU goes to a maximum of one sandbox. Two sandboxes never share a GPU.
Reason. Code that nobody trusts must not read the memory of the GPU of a different sandbox. A whole device is also simple to count, to check and to release.
Cost. The number of GPU sandboxes on a machine is the number of GPUs in the machine. A mode that shares a GPU between sandboxes that you trust is in the roadmap, as an option that the administrator must permit.
7. A snapshot keeps files only
Section titled “7. A snapshot keeps files only”Decision. A snapshot is the files of a sandbox. The engine saves them as an image while the sandbox is frozen. A fork is a snapshot plus one or more new sandboxes from that snapshot. A process that ran in the sandbox does not continue in the copy.
Reason. The engine already has copy-on-write layers, so a snapshot is fast and the copies share the data that did not change. This covers the common pattern for an agent: prepare an environment one time, then make many copies of it.
Cost. The copy must start its processes again. Memory is lost, also the memory of a GPU. A snapshot that keeps the memory needs the microVM backend.
8. One state file in JSON
Section titled “8. One state file in JSON”Decision. The daemon keeps its records in one JSON file in its data directory. It writes the file again after each change.
Reason. The number of records on one machine is small. A file needs no database server, and a person can read it. The engine is the second source of truth: each container and each image of boxfork has labels. When the daemon starts, it compares the file with the engine and corrects the differences.
Cost. Each change writes the full file. This does not scale to many thousands of records. Two daemons cannot share one file or one engine.
9. One API key for one daemon
Section titled “9. One API key for one daemon”Decision. In version 1 the daemon has one API key. It makes the key when it starts for the first time.
Reason. One user or one team operates one machine. More keys add work that only a hosted service needs.
Cost. Each client that has the key sees and controls all sandboxes. More than one key, limits for each key and records of use belong to the hosted stage.
10. No model in the daemon
Section titled “10. No model in the daemon”Decision. The daemon contains no code for a model and calls no model. A model reaches a sandbox through one of four doors: the MCP server, the tool kit, the Python SDK or the HTTP API.
Reason. The same sandbox then works with all models, and also with no model. The project has no account, no licence key and no telemetry, and it works on a network with no internet.
Cost. The project gives no agent of its own. The user brings the model and the loop.
11. Python gets new features first, and TypeScript follows
Section titled “11. Python gets new features first, and TypeScript follows”Decision. New features go into the Python SDK first.
The TypeScript SDK in sdk/typescript gets them after that. Issue #55 brings it level, in the stage “Version 2: reach”.
On 5 December 2026 it had all calls except the pool calls.
The first form of this decision was “Python is the only SDK that gets new work”. The owner changed it on 5 December 2026 (#31).
Reason. The users of version 2 (reinforcement learning, evaluation) work in Python, so Python gets the features first. TypeScript is the language of many agent applications, so its SDK stays and follows. The HTTP API and the MCP server serve all other languages.
Cost. A user of TypeScript gets a new feature later than a user of Python. The project keeps two SDKs and two sets of tests.
12. A pool hands out sandboxes that already run
Section titled “12. A pool hands out sandboxes that already run”Context. We measured the time to create a sandbox. Almost all of it is the time that the engine needs to start a container. gVisor adds almost nothing to it.
Decision. The daemon can keep a pool of started sandboxes for an image or a snapshot. A create that matches a pool gets one of them at once. The daemon then fills the pool again.
Reason. On the test machine, a create took a median of 139 ms without a pool and 1.5 ms from a pool.
Cost. A waiting sandbox holds memory. A pool serves only a create with the same image, CPU count, memory and network setting. A create with a GPU, with environment variables or with volumes of its own does not come from a pool.
13. One kept connection for the commands of a sandbox
Section titled “13. One kept connection for the commands of a sandbox”Context. After decision 5, each command made the engine start a new process in the sandbox. We first estimated that a kept connection had little to gain. The measurement showed that the estimate was wrong. On the test machine a command took 13 ms, and the start of the process by the engine was almost 10 ms of that.
Decision. The first command in a sandbox starts the helper in its serve mode, and the daemon keeps that connection open.
The daemon sends each later command through the same connection. It closes a connection that nobody used for one minute.
Reason. On the test machine a command after the first took a median of 4 ms. An idle sandbox still returns to only its first process, so decision 5 keeps its benefit.
Cost. While the connection is open, the helper holds about 15 MB of the memory of the sandbox. The protocol has more states, and the daemon needs defences against a helper that code in the sandbox kills, stops or replaces. Commands with streamed output and file operations do not use the kept connection now.
14. Version 1 and version 2, with a proof between them
Section titled “14. Version 1 and version 2, with a proof between them”Decision. Version 1 is a GPU sandbox that works on one machine. Version 2 makes it faster and complete. Between them is a proof: version 1 must run on real hardware and on real cloud accounts, with measured times.
Reason. The measurements decide the order of the speed work. Decisions 12 and 13 came from them.
Cost. The proof needs hardware and accounts that the project does not have now. The work on version 2 started before the proof was complete. ROADMAP.md lists what is not proven.
15. Documentation in Simplified Technical English, in the repository
Section titled “15. Documentation in Simplified Technical English, in the repository”Decision. All documentation follows the rules in STYLE.md. It lives in the repository.
The wiki is only a guide: it has a home page, a FAQ and links into docs/.
The wiki has no documentation of its own, so that no page in it can become different from the code.
Reason. Many contributors and users do not have English as their first language. A page in the repository changes in the same pull request as the code, and a reviewer sees both.
Cost. A page takes longer to write. The checker finds only the mechanical errors.
16. The name is boxfork
Section titled “16. The name is boxfork”Context. The first name of the project was agentbox, as a temporary name.
On 5 December 2026 we checked 89 names on GitHub, PyPI and npm.
We also checked the monthly Google searches for the names and for the words of this field.
- Three active projects in the same field have the name
agentbox. The most popular has 591 stars. The namesagentboxon PyPI and on npm belong to other projects. - Google gets about 5,400 searches each month for
agentbox. These searches go to the other projects. agent-sandboxis the name of a Kubernetes project with 4,833 stars. The words “agent sandbox” get about 3,600 searches each month, and that project holds them.- The words with the most searches in this field are “ai sandbox” (about 4,400 each month), “agent sandbox” (about 3,600) and “code interpreter” (about 3,600).
Decision. The name is boxfork: a box, which is the sandbox, and fork, which is its main feature.
The binary, the CLI, the Go module and the packages of the two SDKs use this name.
The variables BOXFORK_*, the labels, the paths and the repository also use it.
Reason. On 5 December 2026, no repository on GitHub had this name.
The name was free on PyPI and npm, and as a GitHub account.
The domains boxfork.dev, boxfork.ai and boxfork.io were free.
Nobody searched for the word, and the web pages with the word were not about software.
Thus a search for boxfork can find this project first.
A name that is also a common phrase cannot do this, because older pages hold that phrase.
The README, the description of the repository and its topics contain the words with the most searches: “AI sandbox”, “agent sandbox” and “code interpreter”. That text, not the name, brings the searches for these words.
Cost. The change touched 118 files before the first release.
boxfork.com belongs to somebody else.
We did not do a trademark search.
17. Clusters run on Kubernetes, with boxfork resources of their own
Section titled “17. Clusters run on Kubernetes, with boxfork resources of their own”Context. Versions 1 and 2 run on one machine. Users need more machines, Kubernetes, and machines in more than one cluster or cloud. Kubernetes already places work on nodes, counts GPUs, applies quotas and controls access.
Decision.
- One machine: the binary of decision 3 does not change.
- Kubernetes: an operator,
boxfork-operator, is a second binary in its own Go module. The core binary thus gets no Kubernetes libraries. - The operator has its own custom resources in the API group
boxfork.dev:Sandbox,SandboxSnapshotandSandboxPool. - Each
Sandboxis a pod with theRuntimeClassfor gVisor. Its GPUs come from the resourcenvidia.com/gpu. - A network policy blocks traffic between sandboxes and to the metadata service of the cloud.
- A node agent saves the files of a sandbox as an image in a registry of the cluster. A fork is a snapshot and the sandboxes made from it.
- An API service in the cluster speaks the HTTP API of boxfork. The SDKs, the CLI, the MCP server and the tool kit thus work with no change.
- A few machines without Kubernetes: install k3s, then the operator.
- More than one cluster or cloud: a control service,
boxfork control, has one instance and one SQLite file. The API service of each cluster connects out to it. The control service puts each sandbox in a cluster by its labels.
Reason. A scheduler of our own does again what Kubernetes does.
It also counts GPUs outside Kubernetes, which conflicts with the GPU plugin of Kubernetes.
Custom resources let a team use kubectl, its access rules and GitOps for sandboxes.
Other choices.
- A control service of our own with a daemon on each node, for machines without Kubernetes. Not selected: it does again what Kubernetes does.
- The
Sandboxresource of kubernetes-sigs/agent-sandbox, version 1.0.13 on 5 December 2026. The owner selected resources of our own: full control and no dependency on a different project.
Cost.
- A cluster needs Kubernetes, and the operator is a second binary to build, test and release.
- A pod starts slower than a container on Docker. Pools hide this time.
- Snapshots on Kubernetes need a registry.
- boxfork competes with kubernetes-sigs/agent-sandbox, which had 4,833 stars on 5 December 2026.
- The control service has one instance. If it stops, the sandboxes continue to run, but calls through it wait.