← Blog
sandboxesai-agentsreinforcement-learning

RL environments for LLM agents: what they are and how to run them

Yura Dubinin
Yura Dubinin

Updated December 2026.

RL environments are the tasks, tools and scoring code that a model practices against during reinforcement learning. For an LLM agent, one environment is three things: a task written as a prompt, the tools the agent may use to work on it (a shell, a file system, a browser, an API), and a verifier that checks the result and turns it into a number called the reward. One attempt at one task is a rollout. Training needs thousands of rollouts, and each one needs a clean machine.

To try one, start an isolated machine on Lizard (lizard.build) with lizard sandbox create -t claude -s small --timeout 600000. That is a Firecracker microVM with its own kernel, 2 vCPU, 4 GB RAM and Claude Code installed, at $0.0162 an hour, billed per second (Lizard pricing, checked 15 November 2026). Below: what goes inside an environment, where to get ready-made ones, and what 1,000 sandboxed rollouts cost.

What is an RL environment for LLM agents?

A reinforcement learning environment for an LLM agent is a packaged task that a model can attempt many times and be scored on automatically. It holds the task description, the starting state (files, services, data), the tools the agent can call, and a verifier that returns a reward when the attempt ends.

The idea comes from classic reinforcement learning. In Gymnasium, the maintained fork of OpenAI Gym, an environment is an object with two methods: reset() returns the first observation and step(action) returns the next observation and a reward. CartPole and the Atari games work this way, one small action at a time.

LLM environments keep the loop and change the scale. The observation is text: a prompt, a tool result, a test log. The action is a tool call or a shell command. An episode can last hundreds of steps, and the reward often arrives once, at the end, when the verifier runs. NVIDIA's NeMo Gym README defines it this way: "An environment is the complete system an agent interacts with to complete a task. It consists of a dataset (tasks to solve), an agent harness (how the model interacts with the world), a verifier (task completion scoring), and state (per-task execution context)" (NVIDIA-NeMo/Gym, read 15 November 2026).

Run an environment with a fixed model and you have an evaluation. Feed the rewards back into training and you have reinforcement learning, which is why benchmark projects and training projects share formats.

What is inside an RL environment?

An RL environment has five parts once you count the program that runs the model and the number the verifier returns: a task, a harness, tools, a verifier and a reward. The names differ between projects.

PartWhat it isExample
TaskThe instruction and the starting state"Fix the failing test in this repository", plus the repository at a pinned commit
HarnessThe program that runs the model in a loop and passes tool callsClaude Code, Codex CLI, OpenHands, mini-swe-agent
ToolsWhat the agent can touchA shell, a file system, MCP servers, a browser
VerifierCode that inspects the final stateA test script, a diff against a reference, an LLM judge with a rubric
RewardThe verifier's output1 or 0, a score between 0 and 1, or several named scores

Harbor's task format shows the parts as files. A Harbor task is a directory with instruction.md, task.toml, an environment/ folder (usually a Dockerfile), a solution/ folder and a tests/ folder. Its docs say the tests/test.sh script "must produce a numerical reward in the environment at /logs/verifier/reward.txt or /logs/verifier/reward.json" (Harbor docs, Tasks, read 15 November 2026).

Prime Intellect's verifiers library uses different words for the same parts. A taskset holds the tasks, with their tools, metrics and rewards. A harness is "the program the model is run in, e.g. Claude Code, Codex, or mini-swe-agent". An agent is harness × model × runtime policy, and it produces one trace per rollout (verifiers docs, Overview, read 15 November 2026).

The verifier is the hard part. A model under training optimizes whatever the verifier measures. If the tests sit in a folder the agent can read, or the check only looks for an output file, the model learns to pass the check without doing the task. This is called reward hacking. The usual defenses are to keep tests out of the machine until the agent has stopped, to check behavior instead of file names, and to run a known-good solution and an empty attempt through the verifier before trusting it.

Where do RL environments come from?

Ready-made RL environments come from open collections, and six are worth knowing. Licences and versions come from each project's GitHub repository and docs, read on 15 November 2026.

ProjectWhat you getHow it defines an environmentWhere rollouts run, per its docsLicence
Prime Intellect Environments Hub and verifiers (v0.4.1)A hub of community tasksets, the prime CLI, and the prime-rl trainerTaskset + harness + runtimesubprocess, docker or prime runtimes; prime (Prime Intellect's remote sandboxes) is the defaultMIT (verifiers)
NVIDIA NeMo Gym (v0.7.0)A library plus a hub of benchmarks and training environmentsDataset + agent harness + verifier + statePluggable sandbox providers: Docker, Daytona, ECS Fargate, Enroot, OpenShell, OpenSandbox, ApptainerApache-2.0
Harbor (v0.26.0) and Terminal-BenchA task format, a runner, a registry of benchmarksInstruction + environment + test scriptLocal Docker, or cloud providers through --env: Daytona, Modal, LangSmith, Blaxel, Novita Sandbox, Tensorlake, Runta, SailApache-2.0
SWE-benchReal GitHub issues with the tests that resolved them; SWE-bench Verified is a 500-problem subset confirmed solvable by engineersRepository at a commit + issue text + testsContainer images per taskMIT
OpenEnv40+ environments, documented on Hugging Facereset(), step() and state() over a WebSocketEach environment is a Docker imageBSD-3-Clause
GymnasiumThe classic RL API and reference environmentsreset() and step() in PythonIn processMIT

How they relate:

  • Harbor is the harness for Terminal-Bench. Its README calls it "a framework from the creators of Terminal-Bench for evaluating and optimizing agents and language models", and lists "Generate rollouts for RL optimization" among its uses. The Terminal-Bench site showed version 4.1 on 15 November 2026.
  • The formats are converging. NeMo Gym ships bridges to Harbor, OpenEnv and verifiers, and verifiers loads single-step Harbor tasks through a HarborTaskset class. A single-step task in the Harbor layout runs under Harbor, under verifiers and, through its Harbor bridge, under NeMo Gym.
  • The NeMo Gym README says when you do not need any of this: "If you're scoring model outputs with a stateless check and don't need scale or training, a script is probably sufficient."

Lizard is not in any of these provider lists. If you want one flag and no glue code, pick a sandbox provider your framework already supports.

Why do rollouts run in sandboxes?

Rollouts run in sandboxes because an agent changes the machine it works on, and three properties of RL depend on that machine being disposable.

Reset comes first. Every rollout must start from the same state, or rewards from different attempts cannot be compared. An agent that installed a package, edited a config file or left a server running has changed the state for the next attempt. Deleting the machine and starting a new one is the only reset that covers everything.

Isolation is the second. The agent runs commands a model wrote, and in training that model is rewarded for finding any path to a passing check. A container shares the host kernel with every other container on the host. A microVM gives each rollout its own kernel, so a rollout that breaks its machine breaks only that one. Our AI sandbox article compares the isolation options.

Parallelism is the third. One training step uses many rollouts of the same task, and one evaluation runs every task several times. The Terminal-Bench README runs its reference solutions with --n-concurrent 500 on Modal. Throughput is set by how many machines you can hold at once and how fast a new one is ready.

Forking a prepared machine helps with all three. Preparing an environment (clone the repository, install dependencies, start a database) often takes longer than the agent's turn. On Lizard, lizard sandbox fork <id> -n <count> starts new sandboxes from a copy of a prepared sandbox's files (the repository, the installed dependencies), so the setup runs once. Memory and running processes are not copied. Each fork boots fresh, so a database or server started during setup has to be started again in each fork. We checked on 1 December 2026: a fork of a Small sandbox had the file we wrote in the source and did not have the sleep 600 process we left running there. One call starts up to 100 copies (-n takes 1 to 100 in lizard sandbox fork --help, Lizard CLI 4.0.136).

How do you run a rollout in a sandbox?

A rollout in a sandbox takes five steps: create the machine, put the task in it, let the agent work, run the verifier, read the reward. We ran the sequence below on Lizard on 15 November 2026 with a toy task in the Harbor layout: an instruction.md asking for a word-frequency script, and a tests/test.sh that writes 1 or 0 to /logs/verifier/reward.txt.

Prerequisites: Lizard CLI, and a Claude token connected in the project the sandbox runs in (lizard agents add). On Lizard, agent credentials belong to a project.

# 1. One prepared sandbox: Small, 10-minute lifetime
lizard sandbox create -t claude -s small --timeout 600000 --json

# 2. Put the task in it (not the tests)
lizard sandbox exec <id> -- mkdir -p /workspace/task
lizard sandbox files put <id> instruction.md /workspace/task/instruction.md

# 3. Fork it: one copy of the prepared files per rollout
lizard sandbox fork <id> -n 2 --json

# 4. Run the agent in each fork
lizard sandbox prompt <fork-id> --agent claude \
  "Read /workspace/task/instruction.md and do exactly what it says. Stop when the file is written."

# 5. Only now upload the verifier, run it, read the reward
lizard sandbox exec <fork-id> -- mkdir -p /tests
lizard sandbox files put <fork-id> tests/test.sh /tests/test.sh
lizard sandbox exec <fork-id> -- sh /tests/test.sh
lizard sandbox files cat <fork-id> /logs/verifier/reward.txt

# 6. Delete every sandbox
lizard sandbox rm <id> -y

What happened in our run: both forks had the task file, Claude Code 2.1.286 wrote the script in about 6 seconds per fork, and the verifier wrote 1 in each. We also ran the verifier in the source sandbox, where no agent had worked, and it wrote 0.

Two things to know before you copy this:

  • We started the agent through the Lizard API, the same call lizard sandbox prompt --no-wait makes, and checked the CLI flags with --help. --agent claude is needed because the command's default agent is codex.
  • The claude template had no Docker binary when we checked. A Harbor task's Dockerfile cannot be built inside the sandbox; install the task's dependencies with a setup script in step 2, before the fork.

On the trial this runs with one change. A trial account runs 1 Small sandbox at a time, and a fork counts as another sandbox of the same size, so step 3 is refused while the source runs. Parallel forks need a paid plan, and every trial sandbox is deleted at most 1 hour after it starts (sandbox limits, checked 15 November 2026).

What do 1,000 rollouts cost?

1,000 rollouts of 10 minutes each on Small Lizard Sandboxes cost $2.70 in compute. Model tokens are a separate bill, and in our test run they were the larger one.

The inputs: 1,000 rollouts; one Small sandbox each (2 vCPU, 4 GB RAM, 20 GB disk) at $0.0162 an hour in US dollars; 10 minutes from create to delete, which is an assumption and not a measurement; per-second billing with idle time included; a paid Pro plan. Prices are from Lizard pricing, checked 15 November 2026.

The arithmetic: 1,000 × 10 minutes = 10,000 minutes = 166.67 hours. 166.67 × $0.0162 = $2.70.

Rollout lengthSandbox hours for 1,000Compute cost
2 minutes33.33$0.54
10 minutes166.67$2.70
30 minutes500$8.10

How long the batch takes depends on the plan, because Lizard limits running vCPU and a Small uses 2. With 10-minute rollouts run in full waves:

PlanPrice per monthvCPU at onceSmall sandboxes at onceWaves for 1,000Wall-clock time
Pro$19, with $19 of usage included4020508 hours 20 minutes
Pro 5x$99, with $99 included220110101 hour 40 minutes
Pro 20x$499, with $499 included1,200600220 minutes

Limits are from the sandbox limits page, checked 1 December 2026. The paid plans have no limit on sandbox starts. The trial does: 50 Small, 100 Mini and 100 Nano starts in total, where creates and forks count and resumes do not, so a 1,000-rollout batch needs a paid plan.

What the $2.70 leaves out:

  • Model tokens. In our toy run, Claude Code reported $0.0145 and $0.0284 of model usage for the two rollouts. Ten minutes of a Small sandbox is $0.0027. Even a 6-second task cost five to ten times more in tokens than a 10-minute machine does.
  • The source sandbox. It keeps running, and keeps using 2 of your vCPU, until you delete it or its lifetime ends. On Pro that leaves room for 19 forks at once, not 20.
  • GPU time for the trainer that consumes the rewards.
  • Egress beyond the allowance: Lizard includes 2 TB per account over a rolling 30 days, after which outbound traffic is blocked.

For other providers' hourly rates, see sandbox pricing per hour. For start times measured in our own benchmark, see E2B vs Daytona vs Modal.

FAQ

What is the difference between an RL environment and a benchmark? A benchmark is an RL environment run with a fixed model and a published task set. The parts are the same: tasks, a harness, tools and a verifier. Terminal-Bench and SWE-bench are benchmarks, and Harbor's README lists generating rollouts for RL optimization as a use of the same tasks.

What is the Harbor framework? Harbor is an Apache-2.0 framework from the creators of Terminal-Bench for evaluating and optimizing agents. A Harbor task is an instruction, an environment and a test script, and harbor run executes tasks locally in Docker or on a cloud sandbox provider chosen with --env.

What is NeMo Gym? NeMo Gym is NVIDIA's Apache-2.0 library for evaluating and improving models and agents with environments. Its README says it scales to thousands of concurrent environments and works with the RL framework of your choice. Version 0.7.0 was the latest on 15 November 2026.

Is an RL gym the same as an RL environment? Mostly. "Gym" comes from OpenAI Gym, now maintained as Gymnasium, where each environment exposes reset() and step(). Today "RL gym" usually means a collection of environments behind one interface, as in NeMo Gym.

Do RL environments need GPUs? The environment does not. Rollouts run on CPU machines, and the NeMo Gym README lists a GPU as not required for the library itself. The model that the agent calls and the trainer that updates it need GPUs, and they run outside the environment.

Can I run RL environments on the Lizard trial? You can run one rollout at a time. The trial allows 1 Small, 2 Mini and 2 Nano sandboxes at a time, in US regions only, and 50 Small, 100 Mini and 100 Nano starts in total (creates and forks count, resumes do not). Every trial sandbox is deleted 1 hour after it starts at the latest. Forking a running Small is refused on the trial, so parallel rollouts start with the first paid Pro invoice.

How many rollouts can Lizard run in parallel? Pro runs 40 vCPU of sandboxes at once, which is 20 Small sandboxes. Pro 5x runs 220 vCPU (110 Small) and Pro 20x runs 1,200 vCPU (600 Small).

Build with AI. Ship with Lizard

You don't need a platform team to go live. Your whole cloud, one CLI command away.

Start 7-day trial
Services
—
Add-ons
—
Deployments
—
Sandbox starts
—

We use cookies for essential site functionality and analytics. See our Cookie Policy.