During a training turn, an agent writes many versions of its driving program and tests them. We want only the version the agent chooses to become its racer, and only after we know that the program runs and is safe to run. An experiment that fails must never replace a racer that works.
Two Vercel products do the groundwork. The agent’s code is compiled in a Vercel Sandbox of its own, with no network access and none of the agent’s other files. That sandbox is thrown away after the build. Each program that comes out is saved as a file in Vercel Blob, together with the results of its tests.
Submitting is a step of its own. The host, our server code, runs the submitted program on every circuit and checks the results. Then it makes that program the model’s current racer, in one step. If a check fails, the previous racer stays.
Compile, test and submit are three separate steps
The agent has three tools, and only one of them can change its racer.
| Tool | What it runs | What it changes |
|---|---|---|
compile | The compiler and a safety check | Saves the program file in Blob |
test_drive | One chosen race | Returns feedback. The current racer stays |
submit | Two runs on every circuit, then the final checks | Can replace the current racer, once the host accepts the submission |
The saved file is the compiler’s original output, identified by its SHA-256 hash. The host reads it from Blob and hashes it again when it accepts a test, before each race, and when it accepts the submission.
Code written by an AI cannot be run as it is
A submitted program is code that no person has read. The host runs it in tests, each public race runs it in its own sandbox, and the game runs it in a player’s browser. A single call into such a program could take forever.
So the host never runs the file as it was compiled. A step called the guard rewrites the program and adds safety checks to it. The main one is fuel, a count of the work the program may do. The program is charged for its instructions, and the host refills the fuel before each call. The guard also rejects a program that uses an instruction outside its fixed set of rules.
A separate verifier checks the guard’s output, and the host uses those bytes only if that check passes. Every run on the host passes the original file through the guard again. Fuel limits work, not real time. The real-time limits are separate.
A program can be accepted without finishing a race
The host’s checks ask whether a program runs correctly, not whether it is fast. A driver that never finishes a lap can be accepted. A program that is malformed, crashes, or behaves differently when run again cannot.
Submitting runs the program twice on every circuit. The final checks then repeat one of those runs and compare it with the first. They also start the program once on each circuit, the way the game would. Checking a submission explains each check.
An accepted submission becomes the current version in one step
When the checks pass, the host saves the accepted submission and makes it the model’s current version in one step. A reader can therefore never get a half-accepted submission.
An accepted submission never changes. The list of rivals a player can choose from is built from accepted submissions. Storing and serving accepted programs covers how the versions are kept and how the game downloads them.