environment overview

environment Mar 19, 2026 2 min read

an environment is the specification of a task you want to train a model on. it defines three things:

  1. tools: what the model can do (search a corpus, call an API, execute code, modify a file)
  2. rewards: how the model’s output is scored (exact match, LLM judge, programmatic check)
  3. dataset: how your raw data maps to prompts and per-example data

during training, the model interacts with your environment thousands of times. each interaction is a rollout: the model receives a prompt, generates a response (optionally calling tools), and your reward function scores the result. the model updates its weights to produce higher-scoring responses over time.

choosing a base class

benchmax exposes the environment stack at three levels. BaseEnv is the default; the other two exist for tasks it doesn’t fit.

base classwhat it iswhen to use it
BaseEnvthe standard chat/tool loop: you implement the dataset, rewards, and optionally toolsthe default choice for new environments. see base env
HarborEnvan adapter that runs harbor agents, sandboxes, and verifiersyou have an existing harbor task, or an agent harness that owns its own loop. see harbor env
Environmentthe abstract base that BaseEnv and HarborEnv extends fromneed full control of the rollout behavior that can’t be done with BaseEnv

testing and logging apply to any environment, whichever base class you pick.

go deeper