We want an AI agent to write a driving program on its own, one training turn after another. While it works, it must not be able to reach the internet or see another agent’s work. When a turn ends, its files must still be there for the next turn.
Four products do this. Each agent works inside a Vercel Sandbox, an isolated environment that we create for that agent alone. Sandbox Drives keep its files between turns. Workflow runs the host’s side of a turn and resumes it after an interruption. AI Gateway routes the model requests, which the host makes for the agent.
The agent cannot call any service itself. It writes a request as a file, and the host writes the reply as another file. The host is our own server, outside the sandbox. It calls the model, compiles the code and runs the tests.
The agent asks for outside work by writing files
The agent’s sandbox has no outgoing network access. Two kinds of request still have to leave it: requests to the model, and requests for tools that run on the host. Both go through a file mailbox. A request is a file that the host reads, and the reply is a file that the host writes back.
We make every outside call from the host. The agent still gets model calls and host tools, and it never holds the host’s service credentials. The agent’s sandbox explains the mailbox.
The agent’s files outlive its sandbox
When the agent’s sandbox has stopped, we create a new one in its place. The working files are still on the Drive, a storage volume that exists apart from the sandbox.
The Drive keeps the workspace and the agent’s home directory: its source, its analysis and its recovery notes. It keeps files, not running processes. So the agent’s prompt tells it to save its next steps. After an interruption, the agent recovers them.
A workflow keeps the turn moving
A turn is a period of work with a time limit. During it, the host has to keep reading the mailbox and doing what the agent asked. We use Workflow for that loop, because a workflow’s progress is saved and it can continue after a restart.
The workflow makes one pass over the pending work, sleeps 2 s and makes the next pass. The host saves a receipt for each completed request before it acknowledges delivery. A later pass can then deliver the saved reply. How a training turn runs follows this loop.
Compiling a program does not submit it
An agent can compile and test many programs during a turn. Neither step changes its current racer.
To compile, the host reads the Rust file the agent selected and passes the text to a separate compiler sandbox. That sandbox has no network access, and we do not mount the Drive there. The host inspects the WebAssembly that comes out and gives the agent an exact copy.
A test race runs on the host. When it is done, the agent can look at its results and its replay, then change its source.
Only an explicit submission that passes the host’s technical checks becomes the new final submission. Submitting a racer covers those checks.