On this page · 9 min
Why a fresh start decides whether your results mean anything
Take an agent that learns to fix a failing test in a repository. In the first run, the agent applies a partial patch and installs a package that changes the test setup. The environment gives a reward for a passing test. In the second run, the agent starts from that leftover state. The test passes, but for a reason the agent did not earn, and the reward is higher than it should be.
Two runs of the same policy now score differently, and nobody can say whether the policy improved or the starting state changed. The same thing happens in evaluation. If you compare two models on the same task and the second one starts from a dirty machine, the comparison measures the machine instead of the models.
Identical starts are what make a score mean something. Each episode has to begin from the same state, and whatever a run changes has to disappear before the next one starts.
What RL environments are
An RL environment is the world an agent acts in. It defines what the agent can observe, what it can do, and how its work is scored. The Scale guide to RL environments describes it as a controlled setting where an agent takes actions, observes what changes and receives a score, and where each run can be reset and inspected afterward.
The usual parts are:
- Task: the goal and the starting conditions, such as "make this test pass".
- Action space: what the agent can do. For coding agents this is usually shell commands, file edits and API calls, which is where tools fit.
- State: everything the environment holds at a given moment, including files, installed packages and running services. SuperAnnotate's guide often implements this as a container.
- Verifier: the check that scores the result. A good verifier looks for a real change in the system, such as a passing test or a file with the right content. A plausible-looking answer in text is not enough.
- Episode: one complete run from the starting state to a result. Each new episode is a fresh start.
The state is where drift comes from. An environment written down as a list of parts can still change between runs if its state is not saved and restored exactly.
What "identical start" means in practice
An identical start has three parts. The files are the same. The installed software is the same. The running processes are the same, so the same services are up before the agent begins. Miss any one of them and you get drift.
There are two ways to fail. The first is rebuilding from scratch each time: the environment is rebuilt from a script, and the script pulls new package versions or runs setup steps in a different order. The second is reusing the environment: the machine is kept, and the next run inherits whatever the last one left.
The fix is to prepare the starting state once, save it as a named artifact, and create a fresh copy from that artifact for every episode. When the episode ends, the copy is deleted. The saved artifact never changes, so every episode starts from the same place. Two details keep it honest. Pin the base image digest and every package version when you prepare the state, because an unpinned install is the most common source of drift. Then check the copy: list its files and running processes and compare them with the saved start before the first episode runs.
The four options, and how they differ
| Option | What starts identical | Setup cost | Does better | Costs you |
|---|---|---|---|---|
| Container image per episode | The image contents | Low. Build one image and start containers from it. | Simple, widely supported, runs many episodes in parallel. | Only what is in the image is fixed. Processes and state created at run time are not kept, and containers share the host kernel. |
| Warm pool with reset | Whatever the reset restores | Medium. You write and test the reset. | Very fast to hand out an environment. | A reset that misses one file or process reintroduces drift, and you must prove it is complete. |
| Snapshot restore | The saved state: files, installed tools and, for some providers, running processes | Medium. Prepare once, save, then restore per episode. | Keeps the prepared state exactly, including what is running. | Snapshot formats and limits differ by provider. |
| Managed environment platform | The vendor's environment and verifier | Low. You use their environments and runtime. | Ready-made tasks and verifiers, and a shared place to publish them. | Less control over where runs happen and how state is kept. |
The table compares approaches. Snapshot restore is the approach boxd takes, and E2B, Modal and Daytona each offer a version of it. Each option has providers that do it well, for example:
- Snapshot restore with a VM: E2B pauses a sandbox with its filesystem and memory, and each sandbox is a Firecracker microVM, a small virtual machine with its own kernel. Its Pro plan has a 24-hour limit on continuous running time. E2B has more regions than boxd and stated SOC 2 Type II and HIPAA BAA compliance, which matter for some buyers.
- Filesystem snapshots for long runs: Modal lets a sandbox run up to 24 hours, and its guide recommends filesystem snapshots to restore state into a later sandbox for longer work. Modal's memory snapshots are an alpha feature that stops the source sandbox when taken. Modal is the stronger choice when you need GPU sandboxes.
- VM snapshots in a sandbox platform: Daytona runs containers by default. Its VM sandboxes can only be created from existing VM snapshots, and stopping one clears its memory and keeps only the filesystem.
For the managed route, Prime Intellect's hub shares environments between teams and runs evaluation reports across them, which helps when you want other people to re-run your eval.
How to choose
Start with the question the environment has to answer. Then pick the simplest option that keeps the start identical.
- Text-only tasks, scored on the output. A container image per episode is enough. If the verifier only reads a string the model produced, you do not need a machine per run. Build the image once, pin its digest, and start a fresh container for every episode.
- Tasks that run tests or tools in a prepared repository or service, like the failing-test example above. Use snapshot restore. Prepare the state once, save it, and restore it for every episode. You need a machine here, because the agent installs, edits and runs things. Starting a boxd machine from a snapshot takes a median 0.46 s in Frankfurt and 0.73 s in New York, measured with the open-source aisandboxbench harness (github.com/opencoredev/sandbox-sdk) on 2026-11-10. A machine in standby, which is paused with its memory and open connections kept, resumes in under a millisecond. If your task needs GPU sandboxes, Modal is the better fit.
- Shared evals that other teams re-run. Use a managed platform if you accept less control over infrastructure. Keep your own snapshot of the state anyway, so you can show what each score was measured on.
- A warm pool. Use one only if you can prove the reset is complete. Test it by comparing the state after a reset with the saved start, file by file and process by process. If you cannot run that check, use snapshot restore.
Two rules apply to every option:
- Delete each episode's copy when the episode ends. Otherwise old state piles up, and the next run may start from a copy you forgot about. Give each machine a delete-after timer longer than your longest episode, with
--delete-afterset when you create it, so a run that hangs is still removed. - Save the starting state under a name and never overwrite it during a study. Saving under the same name replaces the snapshot, so use a new name for each version you want to keep. Save the prepared machine as a named snapshot with the snapshot command, which keeps the machine running, and start each episode's machine from that name with the new-machine command's
--from-snapshotflag. The command reference gives the exact syntax; check it before you script this.
If you run one environment on one machine and the results come out the same every time, you do not need any of this yet. Add a snapshot when the first two runs disagree.
The decision
Pick the simplest option that gives every episode the same saved start. For text-only verifiers, a container image is enough. For tasks that need a real machine, save the prepared state once and restore it for each episode, then delete each copy when its episode ends. Use a warm pool only when your reset check passes, and a managed platform when the eval must be shared and you accept less control. Record each snapshot's name, the script or recipe that built it, and the verifier's version, so anyone can re-run the eval from the same start.
To run RL environments that start identical every time on boxd, talk to us about your task, or get started with the quickstart and save your first snapshot today.
Frequently asked
- What is an RL environment?
- An RL environment is the world an agent acts in. It defines what the agent can observe, what it can do, and how its work is scored. It has a task, an action space, a state, a verifier, and episodes.
- How do you make an RL environment start the same way every time?
- Prepare the starting state once, save it under a name, and restore a fresh copy from that saved state for every episode. Delete the copy when the episode ends.
- Do I need a virtual machine for an RL environment?
- Not for text-only tasks scored on the output. A container image per episode is enough. A virtual machine or snapshot restore is needed when the agent installs software, edits files or runs services.
- What is the difference between a snapshot and a container image?
- A container image is a fixed set of files that containers start from. A snapshot saves a running or prepared machine's state, including its memory and running processes when the provider supports it, so a restored copy starts where the saved one stopped.



