Skip to content

Environment interfaces: GEM, OpenEnv, verifiers and the environment hubs

optionalextendedfrontierpaperrubric 10/122025 · ~22 min

Zichen Liu, Anya Sims, Keyu Duan, …, Wee Sun Lee, Min Lin

Read first: Synthetic RL environments for agent training: a map · REINFORCE and the Policy-Gradient Theorem (Williams 1992; Sutton et al. 1999)

Status

TL;DR. By 2025, every lab and framework had its own environment format, so an environment written for one trainer could not be reused. Three efforts aim at an “OpenAI Gym for LLM agents”.

  • GEM (General Experience Maker; Sea AI Lab and collaborators, Oct 2025) is a Python library with a Gym API. It offers seven task categories (math, math with images, code, games from TextArena, QA, Reasoning Gym, and Docker terminal tasks), tools as wrappers, and asynchronous vectorized environments with autoreset. It ships baselines across 24 environments and integrates with five trainers.
  • OpenEnv (Meta-PyTorch and Hugging Face, Oct 2025; a multi-company committee by Jun 2026) is a protocol: reset(), step() and state() over HTTP/WebSocket to a Docker container, with MCP for tools.
  • verifiers and the Environments Hub (Prime Intellect, Aug 2025) are a library and a community hub. verifiers v1 (Jul 2026) separates the taskset, the agent harness and the runtime.

TextArena is a suite of text games that GEM and OpenEnv both wrap; AgentGym-RL is a related training framework with its own environments.

Who does what. The three projects standardize different layers, so start from responsibilities rather than APIs:

ResponsibilityGEMOpenEnvverifiers v1
Task and initial stateenvironment class / datasetinside the environment servertaskset
Executing actionsenvironment step(), tool wrapperscontainer behind step() over HTTP/WebSocketruntime (subprocess, Docker, remote sandbox)
Observationreturned by step()returned by step() / state()tool and model messages in the harness
Scoringinside the environmentoutside: OpenEnv is “not a reward framework”taskset
Agent loop and tracestrainer-sideclient/trainer-sideharness plus interception server
TrainerOat, verl, OpenRLHF, ROLL, RL2TRL, TorchForge, verl, SkyRL, Unslothprime-rl

verifiers v1 is therefore not simply another Gym-style wire API: the agent scaffold (harness) is part of what you choose, not part of the environment. Official docs: GEM, OpenEnv, verifiers.

GEM. Environments follow Gym: obs, info = env.reset(), then env.step(action) returns obs, reward, terminated, truncated, info. Wrappers change observations (for example, how history is shown). Tool wrappers (Python, search, MCP) turn single-turn datasets into multi-turn tool-use tasks. Adding a math, code or QA task means supplying a dataset; a terminal task needs a Dockerfile, instructions and tests.

Optional algorithm sidebar: turn-level returns. GEM argues for turn-level RL: REINFORCE with ReBN, where per-transition returns are normalized over the batch, At=(Gt−mean⁡(G))/std⁡(G)A_t = (G_t - \operatorname{mean}(\mathbf{G}))/\operatorname{std}(\mathbf{G}). GEM contrasts this with an episode-level GRPO baseline that broadcasts one normalized trajectory score to every action. GRPO can still aggregate dense rewards or use a discounted episode score; the distinction is turn-specific return-to-go and credit assignment, not whether those rewards are usable at all. InfiniteWeb, for example, trains GUI agents with GRPO on dense progress rewards.

OpenEnv. Environments define “tools, APIs, credentials, execution context” behind a typed client/server interface packaged as Docker images. They are shared on a Hugging Face hub and consumed by TRL, TorchForge, verl, SkyRL and Unsloth (pip install openenv-core). The June 2026 update calls it “a protocol layer, not a reward framework”. MCP is first-class, and OpenEnv interoperates with verifiers and harbor. The June 2026 announcement also proposed external-library integration, dataset-backed tasksets and automatic validation of environment quality. Follow the linked proposals rather than the announcement’s RFC numbers, which have since changed: see the RFC directory (auto-validation is RFC 008), PR 794 for external environment import and PR 795 for dataset-backed environments, both still open.

verifiers / Environments Hub. Environments are Python packages built with verifiers, published to the Hub and trained in prime-rl, with bounties for contributed environments. In v1 (verifiers 0.2.0):

  • A taskset holds data, tools and scoring.
  • A harness runs the agent: a ReAct loop, Codex, Terminus 2 and others.
  • A runtime provides start/stop/run/read/write in a subprocess, Docker or remote sandboxes.
  • An interception server sits between harness and model. It records traces as a message DAG, sets sampling parameters, and can rewrite tool responses “to mitigate reward hacks”.
  • A built-in Harbor taskset makes any Harbor dataset (for example Terminal-Bench 2) usable as a verifiers task; Prime Intellect reports training on ScaleSWE in this format.

Results. GEM benchmarks GRPO, PPO, REINFORCE and ReBN across eight environments. GRPO is competitive on single-turn Reasoning Gym tasks but falls short on multi-turn GuessTheNumber and Sudoku; ReBN improves on vanilla REINFORCE throughout. In GuessTheNumber, smaller γ\gamma drives the turn count toward the binary-search optimum, log⁡250≈5.6\log_2 50 \approx 5.6. AgentGym-RL (Xi et al.; code) offers a modular RL framework over the earlier AgentGym environments. Its ScalingInter-RL schedule starts with short interaction horizons and lengthens them, and its agents match or beat commercial models on 27 tasks. TextArena’s paper reports 57+ competitive text games (single-player and multi-player) with online TrueSkill ratings (its repository now lists more); GEM and OpenEnv both wrap its games. The open Environments Hub launched on Aug 27, 2025.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Derive / compute

    GEM contrasts REINFORCE with Return Batch Normalization, A_t = (G_t − mean(G)) / std(G) over every transition in the batch, with an episode-level GRPO baseline that broadcasts one group-normalized trajectory score to every action. For a terminal reward of 1, compute the start-state returns of a 2-turn and a 5-turn success at γ = 0.9. How could a trajectory-level reward also prefer the shorter success, and what credit-assignment distinction would remain? Use GuessTheNumber (1 to 50) to show why γ < 1 favours binary search.

    What a strong answer covers
    • With reward only at the last turn, the return at the first turn is γ^(T−1): 0.9 for a 2-turn success and 0.9^4 = 0.6561 for a 5-turn success, so discounting prefers the shorter success.
    • A trajectory-level score can do the same: GRPO can be fed a discounted episode score (or a sum of dense per-turn rewards) and group-normalize it, so dense rewards and γ < 1 are usable in that sense.
    • What remains different is credit assignment: the episode-level baseline gives every turn of a trajectory the same advantage, while ReBN gives each turn its own return-to-go G_t = sum over k of γ^k r_(t+k), normalized across all transitions in the batch, so early and late turns get different coefficients.
    • In GuessTheNumber each extra guess multiplies the success return by γ, so the fastest reliable strategy, halving the interval, wins; GEM reports smaller γ drives turn counts toward log2(50) ≈ 5.6, whereas a max-turn limit only truncates and does not reward efficiency.
  2. Mechanism

    Compare how GEM, OpenEnv and verifiers (v1) divide responsibilities between the environment, the agent harness and the trainer. For each, say where the reward is computed and where tools run.

    What a strong answer covers
    • GEM: Python Gym API (reset, step returning observation, reward, terminated, truncated, info); tools such as Python, search and MCP are wrappers that turn single-turn tasks multi-turn; reward lives in the environment; integrates with Oat, verl, OpenRLHF, ROLL and RL2.
    • OpenEnv: a protocol layer, not a reward framework; reset, step and state over HTTP or WebSocket to a Docker container, with MCP as a first-class tool interface; external-library integration and dataset-backed tasksets are open proposals.
    • verifiers v1: taskset (data, tools, scoring), harness (the agent loop, e.g. a ReAct loop or Codex) and runtime (subprocess, Docker, remote sandboxes) are separate; an interception server proxies model calls, records traces and can rewrite tool responses.
    • Trend: separating the agent harness from the environment lets the same task be trained under different scaffolds, and the trainer only sees traces and rewards.
  3. Design

    You want to publish a BrowseComp-Plus-style deep-research environment once and have it used by verl, TRL and prime-rl users. Using these interfaces, specify what goes in the taskset, what runs in the container, what the step returns, and two protections against reward hacking.

    What a strong answer covers
    • Taskset: questions, gold answers and evidence-document ids as a Hugging Face dataset; metadata on difficulty and source for curriculum.
    • Container: frozen corpus plus index and a search and get-document server exposed as MCP tools; deterministic, resettable, no internet.
    • Step returns retrieved snippets or document text plus done and reward; reward is exact-match or a judge over the final answer, optionally with partial credit for evidence recall.
    • Protections: block network access and the gold files inside the sandbox; keep the judge outside the container and check answer-in-question leakage; log full traces for audit.

Done with this page?

Status