Purpose and task boundaries
Make the intended task executable
An environment is the system through which an agent encounters task conditions and the consequences of its actions. For a coding task, it might include a repository, installed dependencies, command execution, and tests. The instructions describe the work; the environment makes that work possible. The Harbor RL recipe illustrates this separation by packaging instructions and executable task materials independently of the training harness.
A policy selects actions. Reinforcement learning, or RL, improves that selection using rewards: numerical feedback from interaction. Executing a policy collects experience; updating its parameters is a separate operation. Post-training and Alignment explains how learning uses that experience.
Begin with obligations, not the scoring function. In a small example, “repair CSV export” could mean preserving column order and escaping embedded commas while leaving the public interface unchanged. Merely producing a file would implement an easier task. State the required outcome, starting conditions, permitted modifications, and acceptance requirements before deciding how to execute or grade the attempt. Defining the permitted task develops this boundary.
Keep three claims separate throughout development: the implementation follows its specification; an agent performs well within that implementation; and the specification represents the intended external work. Correct execution does not establish the other two. This distinction becomes especially important when a simulator replaces external dependencies.
Separate interaction responsibilities
An observation is information supplied to the agent. An action is its requested operation. A transition is the resulting change in task state. In Gymnasium’s interface, reset initializes an attempt and returns its first observation; step accepts an action and returns an observation, reward, termination and truncation flags, and diagnostic information.
An episode is an attempt with declared starting and ending conditions. A trajectory records its ordered interactions. A rollout is execution that collects experience; it can cover a whole episode or only a segment. These concepts remain useful whether the implementation uses function calls, network services, or a framework that packages several responsibilities together.
| Responsibility | What it does |
|---|---|
| Agent | Uses observations and retained information to select actions. |
| Environment | Establishes state and resolves action-dependent consequences. |
| Runner | Coordinates execution, limits collection, and records interactions. |
| Verifier | Checks specified properties of the resulting evidence. |
| Learner | Uses experience and feedback to update policy parameters. |
For example, Harbor can run an agent against a task sandbox, retain its trajectory, and then verify the resulting state. That rollout need not train anything. The same task can later support training through a separate consumer of trajectories and rewards. Everything Is a Rollout develops this reuse; Agent Engineering covers action selection, while Evals and Benchmarks covers trial and grader responsibilities.
Turning points in reusable environments
Environment engineering combines several traditions: reasoning about sequential consequences, executing simulated worlds, and making experiments reusable and comparable.
| Turning point | Contribution |
|---|---|
| Bellman’s dynamic programming, 1952 — sequential decisions | Richard Bellman’s work at RAND expressed optimization as a first decision followed by the remaining problem, whose conditions depend on earlier outcomes. |
| SIMULA, 1966 — stateful simulation | Ole-Johan Dahl and Kristen Nygaard described processes, queues, and interleaved events in simulation time; the compiler had operated since January 1965. |
| RL-Glue, September 2009 — interchangeable components | Brian Tanner and Adam White separated agent, environment, and experiment programs, allowing implementations in different languages to interact. |
| Arcade Learning Environment, June 2013 — shared game testbeds | Marc Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling’s journal paper, following a 2012 preprint, exposed Atari games through a common emulator interface. |
| OpenAI Gym, April 27, 2016 — comparable tasks | The public beta supplied common environments to reduce comparison errors caused by differences in action sets or rewards. |
| WebArena, July 2023 — functional web tasks | Shuyan Zhou, Frank F. Xu, and collaborators introduced self-hosted websites with resets and outcome-based evaluation; the work was published in 2024. |
A shared interaction interface makes these environments easier to use, but does not make their worlds equivalent. Each still defines its own available information, action effects, and success conditions.
Observations and actions
Expose observations, not unrestricted state
The environment may need more information to advance the task than the policy is allowed to see. Partial observability means the agent receives an incomplete view of that state, so it may need to gather information before acting. This differs from omitting information the environment itself needs to compute consequences. The Markov assumption says that current state and action suffice to determine the distributions of the next state and reward. A Markov decision process (MDP) describes this interaction; a partially observable Markov decision process (POMDP) additionally distinguishes hidden state from the observations supplied to the agent. Kaelbling, Littman, and Cassandra’s formal account develops that distinction.
For an illustrative lookup task, an application holds orders and their delivery dates. The policy receives a request to find one date and can query the order service. The verifier separately holds the expected answer. Returning that answer in startup diagnostics would remove the intended discovery step. The private target is assessment material, not an observation the policy earned through the task interface.
Privileged information is information available to the environment, trainer, or grader but withheld from the policy. Gymnasium’s information dictionary can contain internal state and reward components; the interface does not decide which fields an application forwards to its agent. Make that forwarding rule explicit instead of passing every diagnostic value into the next model request.
Discovery and assessment use different paths
ExampleA private target would bypass the lookup if copied into the policy’s observation.
Read the diagram as text
- Order-service state. Stores delivery dates accessible through the task’s query interface.
- Permitted query result. An observation derived from service state, not the entire state.
- Policy. Uses the request and observed result to prepare its answer.
- Private expected answer. Assessment-only information; exclude it from policy diagnostics.
- Answer verifier. Compares the submitted answer with the private target.
- Order-service state → Permitted query result: Data: expose queried fields.
- Permitted query result → Policy: Data: allowed observation.
- Policy → Answer verifier: Data: submitted answer.
- Private expected answer → Answer verifier: Data: private reference.
Timing also limits what an observation establishes. A screenshot may omit offscreen content, and a tool response may describe state before another operation completed. Missing information is not evidence that the corresponding condition is false. Behavior under partial observation concerns what the agent should do next; Context Engineering concerns assembling the allowed information into model inputs.
Define what one action does
The action space declares possible operations and arguments. A discrete action chooses among alternatives; a continuous action supplies a value within a range; a structured action combines an operation with named arguments. Those declarations are only the beginning. The execution contract must also state prerequisites, authority, side effects, invalid-action behavior, and when the next observation becomes available.
In Gymnasium’s Taxi example, the global space contains six actions, but walls and passenger location constrain useful choices at a particular state. An action mask marks currently valid choices for the selector. It is not an authorization mechanism: execution must still enforce permissions. Request envelopes and operation-level authorization explain the separate checks.
Granularity determines which decisions remain with the agent. A coarse operation can encapsulate several lower-level interactions; a keystroke interface exposes them. Terminus uses an interactive terminal through tmux rather than separate specialized editing and execution tools. This permits interaction with an ongoing session, but leaves more session management to the agent. Its external agent process is another design choice, distinct from action granularity. Terminus design.
Time and applied actions
| Execution model | Consequence for the interface |
|---|---|
| Control interval | DeepMind Control advances several physics substeps between agent decisions, then obtains reward and observation. Action frequency and integration frequency differ. |
| Discrete-event simulation | SimPy advances through scheduled events. Equal-time events execute in scheduling order, so tie-breaking can affect consequences. |
| Asynchronous command | Starting a process, observing progress, stopping it, and confirming completion require distinct feedback. |
ALE sticky actions, examined by Machado and colleagues in 2017, sometimes repeat the previous applied action instead of the new request. With stickiness probability 0.25, the tested memorization-based agent degraded substantially relative to deterministic execution; tested observation-responsive agents were less affected. The perturbation exposes reliance on action history rather than feedback. ALE evaluation study.
Episode boundaries and restoration
Separate endings from collection cutoffs
Termination reaches an ending defined by the task. Truncation stops collection for an external reason. A finite-horizon task ends at its own deadline; a continuing task may merely be sampled in bounded segments. After an external cutoff, learning may estimate remaining reward, called bootstrapping; after true termination there is no task continuation to estimate. For a fully observed finite-horizon task, remaining time belongs in the observation. Gymnasium’s time-limit explanation develops this distinction; Post-training covers its learning consequences.
| Event | Meaning |
|---|---|
| Task success | A specified success condition was established. |
| Terminal task failure | A task-defined unsuccessful ending occurred. |
| External cutoff | Collection stopped; the task need not be terminal. |
| Cancellation | Execution was stopped by request; preserve known effects. |
| Environment failure | Execution conditions failed; an ordinary task verdict may be unavailable. |
| Model final response | The agent signaled completion; verify the required outcome separately. |
Keep the true successor
Gymnasium’s SameStep resets immediately: reward and ending flags belong to the old episode, but the returned observation starts the next. Use info["final_obs"] as the old action’s successor. NextStep resets on the following call; exclude that reset-only entry from transitions. Autoreset modes.
One SameStep return contains two episodes
| Field in one SameStep return | Episode owner | Field assignment → saved destination |
|---|---|---|
observation | B · initial observation | → Start B’s next transition |
reward | A · rA | → A’s reward |
terminated | A · task-defined ending | → A’s terminated flag |
truncated | A · external cutoff | → A’s truncated flag |
info["final_obs"] | A · final observation | → A’s true successor |
Save A’s last transition:(oA, aA, rA, info["final_obs"], terminated_A, truncated_A)
The ending flags remain separate; neither alone means success. oB is not the successor of aA. NextStep’s reset-only entry is excluded as described in the text.
Restore the declared starting conditions
Reset establishes a valid starting state. Selecting a fresh start from an initial-state distribution differs from restoring one particular snapshot, a saved state intended to support continuation. Clearing conversation history performs neither operation on an external application. Harbor’s multi-step tasks illustrate the distinction: application state can persist while each stage starts a fresh agent conversation.
Snapshot sufficiency depends on the continuation claim. MuJoCo 3.6.0 requires integration inputs, including solver warmstart accelerations, for exact continuation. Restoring positions alone is insufficient, and dependent quantities must be recomputed after manual state changes. Its exact-reproducibility claim is bounded to the same version and computational architecture. A scene that looks restored may therefore evolve differently on the next step.
| State | Reset obligation |
|---|---|
| Files and database contents | Restore the declared fixture, including effects not visible in the main artifact. |
| Processes, queues, clocks, caches | Restore, stop, or deliberately retain each dependency that can change subsequent behavior. |
| Agent memory | Declare whether a new attempt may retain prior observations or learned task-specific information. |
| External operations | Do not assume local restoration reverses effects or stops work outside its boundary. |
| Concurrent attempts | Prevent mutable state from one trajectory changing another trajectory’s conditions. |
A seed controls a random sequence, not the rest of the world. Distinguish recreating an initial random sequence from restoring the generator at a particular point, and preserve relevant dependencies alongside it. Gymnasium’s checker tests seeded reset and step behavior where determinism is expected; such checks do not restore external state. See snapshot boundaries and warm reuse.
Reset between attempts should not erase every difficulty within an attempt. If deployment requires recovering from a slow load or stale tab, silently restarting whenever it occurs removes the recovery problem from training. Expose the disturbance and available recovery actions when that behavior is part of the task; classify failures of the experimental apparatus separately.
Rewards and verification
Make reward timing express the objective
Return accumulates rewards under a stated convention. For an episode with transitions, is the reward after transition , and discounts later rewards. Sparse feedback may arrive only at completion; intermediate feedback arrives earlier. A final outcome does not identify which earlier choices helped.
Consider an undiscounted example: two successful paths earn the same terminal reward of 1, but take two and four transitions. Adding 0.1 per transition makes their returns 1.2 and 1.4, favoring the longer path. Charging 0.1 instead gives 0.8 and 0.6, favoring speed. Either modification changes the objective, not merely feedback frequency.
Shaping and endpoints
Reward shaping adds guidance during execution. In potential-based shaping, a designer assigns each state a number , called its potential, to provide that guidance. The added reward depends on the change in potential, not simply on visiting a high-potential state. With the same discount used in the return, the intermediate terms cancel when accumulated. The 2017 episodic analysis explains why the potential left at the episode’s endpoint still matters.
Intermediate potentials cancel. For a fixed start, zero potential at every true terminal state leaves only a constant, preserving comparisons of complete returns under this construction. Nonzero terminal potentials can change preferred behavior. Setting only the last shaping reward to zero is different and generally breaks the cancellation. An external cutoff must not silently become a true terminal state.
Intermediate feedback cancels; endpoints remain
Two fixed paths share start S with Φ(S)=1 and end at different true terminal states. Path A takes two transitions; B takes three. Base rewards and transitions stay fixed.
Preferred complete return: base A · shaped A. A − B: base 0.18, shaped 0.18.
Path A · 2 transitions → true terminal TA
Potentials: 1 → 2 → 0. Base rewards: 0, 2.
| t | Fₜ = γΦ(next) − Φ(current) | γᵗ × applied Fₜ |
|---|---|---|
| 0 | 0.9 × 2 − 1 = 0.8 | 1 × 0.8 = 0.8 |
| 1 | 0.9 × 0 − 2 = -2 | 0.9 × -2 = -1.8 |
Φ(s1): +1.8 from t=0; -1.8 from t=1 — cancel
- Base return
- 1.8
- Applied shaping sum
- -1
- Shaped return
- 0.8
Unmodified endpoint formula: −1 + 0.92 × 0 = -1. This equals the directly accumulated shaping sum.
Path B · 3 transitions → true terminal TB
Potentials: 1 → 2 → 3 → 0. Base rewards: 0, 0, 2.
| t | Fₜ = γΦ(next) − Φ(current) | γᵗ × applied Fₜ |
|---|---|---|
| 0 | 0.9 × 2 − 1 = 0.8 | 1 × 0.8 = 0.8 |
| 1 | 0.9 × 3 − 2 = 0.7 | 0.9 × 0.7 = 0.63 |
| 2 | 0.9 × 0 − 3 = -3 | 0.81 × -3 = -2.43 |
Φ(s1): +1.8 from t=0; -1.8 from t=1 — cancel
Φ(s2): +2.43 from t=1; -2.43 from t=2 — cancel
- Base return
- 1.62
- Applied shaping sum
- -1
- Shaped return
- 0.62
Unmodified endpoint formula: −1 + 0.93 × 0 = -1. This equals the directly accumulated shaping sum.
Zero terminal potentials shift both complete returns by −Φ(S) = −1, regardless of intermediate potentials or path length. An external collection cutoff is not a true terminal state.
Keep hard limits outside negotiable reward tradeoffs. A penalty for an unauthorized action does not prevent taking it when another reward outweighs the penalty. The execution harness can instead reject the action or require a human handoff. Returning credit through a trajectory explains learning from rewards; bounded autonomy explains constraints on what may happen.
Check properties before assigning reward
A verifier checks a specified property using designated evidence. The rule converting its verdict into reward is separate. A database query can establish stored state; executable tests can establish behavior on supplied cases; a trajectory check can examine required confirmation or prohibited intermediate effects. Choose the evidence from the requirement rather than assuming the final answer contains everything needed.
| Requirement | Evidence | Possible assessment |
|---|---|---|
| Correct reservation exists | Authoritative database state | Pass or fail on the specified fields. |
| Confirmation preceded booking | Ordered user and action events | Pass or fail; unresolved if required events are absent. |
| User received required details | Delivered response | Separate content assessment. |
| Assessment executed correctly | Verifier execution status | Checker error is not an ordinary task failure. |
τ-bench’s 2024 paper explicitly notes that its final-state reward can pass despite a missing confirmation. That illustrates false acceptance: approving behavior that violates the intended requirement. False rejection is the converse—rejecting valid work. Checking private helper names copied from a reference patch can reject another correct implementation. A reference solution demonstrates a path, not necessarily the only acceptable path. τ-bench.
Human review can reveal defects in both requirements and acceptance rules. The May 2026 SpatialBench verification report describes experts independently reconstructing analyses. Choices such as normalization and neighborhood radius produced defensible numerical differences that restrictive graders could reject. Reviewing their working notebooks helped separate bad analysis from ambiguous instructions and narrow tolerances.
Use executable checks where a property can be tested directly, and calibrated human or model judgment where interpretation remains necessary. Retain unresolved assessments and checker errors instead of silently mapping them to zero. Also declare which diagnostics reach the policy: private grading evidence and useful corrective feedback serve different purposes. See feedback sources, requirement-matched checks, and model-judge validation.
Protect the score and its evidence
Reward hacking earns high scores without satisfying the intended task. It need not alter the checker. In OpenAI’s December 2016 CoastRunners report, an agent repeatedly circled respawning targets, collecting points while crashing and never finishing the race. The game’s intact scoring rule rewarded the wrong behavior. Protecting its implementation would not have repaired the objective.
The reward-tampering analysis distinguishes two other paths. Reward-function tampering changes the mechanism computing reward. Reward-input tampering changes what that mechanism observes without achieving the intended outcome. Modifying scorer code and fabricating the evidence it reads therefore require different defenses. A transition bug is another possibility: an implementation may permit consequences the task rules never intended.
| Placement | Useful access | Boundary to protect |
|---|---|---|
| Shared task environment | Working directory, installed tools, environment variables | The agent may have changed dependencies used by the checker. |
| Separate verifier environment | Declared artifacts and explicitly transferred evidence | Required state may be missing; transferred artifacts remain untrusted inputs. |
Harbor’s task documentation makes these two arrangements concrete. Separate execution can protect the verifier’s dependencies, but a test that trusts an agent-written “success” file still checks the wrong authority. Likewise, hidden solutions leaking into policy-visible files invalidate a task without modifying its final tests. Preserve authoritative outcomes and inspect relevant action records; trajectory judgment complements enforcement rather than replacing it.
Stronger optimization can uncover weaknesses that ordinary trials miss. Experiments on reward-model overoptimization found proxy scores increasing while an independent model-based quality measure eventually declined. This does not imply that more optimization always hurts; it means score improvement cannot validate the score itself. Proxy failures and independent enforcement develop the broader mechanisms.
Environment validation
Test the environment independently
Test environment obligations before interpreting policy performance. A scripted action sequence can exercise a transition without requiring a capable model. A reference solution supplies a positive control; an unchanged starting state or deliberately invalid solution supplies a negative control. If both pass, or both fail, investigate the fixture and verifier before adjusting the policy. From Agent Traces to Agent Simulations describes treating benchmark tasks as software with their own continuous-integration checks.
| Claim | Discriminating check |
|---|---|
| Reset establishes its fixture | Compare relevant state against explicit postconditions after prior mutations. |
| Transitions implement the action contract | Execute known valid and invalid requests; inspect effects and returned observations. |
| Observations respect information limits | Check policy-visible fields and files for private targets or undeclared state. |
| Episode boundaries are recorded correctly | Exercise task endings, external cutoffs, and reset behavior separately. |
| Verifier distinguishes selected outcomes | Require known-valid work to pass and known-invalid work to fail. |
| Episodes are isolated | Mutate one concurrent attempt and verify another attempt’s relevant state is unchanged. |
Gymnasium’s environment checker checks observation-space membership and repeated seeded behavior, including observations, rewards, and ending flags. These are conformance checks; they do not prove solvability or reward validity.
An invariant is a property required to remain true. It supplies an oracle for generated tests: if a read-only action promises not to change database contents, varied read requests can be checked against that promise. A metamorphic test checks a specified relationship between executions, such as unchanged behavior after renaming an irrelevant identifier. The relationship must genuinely preserve the task. Generating many inputs without such a rule does not establish correctness. Focused testing explains these methods.
After conformance and known-outcome checks, repeated agent runs can characterize observed difficulty and variability. Keep setup failures, verifier failures, and task failures distinct. Only then does a low success rate become useful evidence about the agent rather than an unexplained mixture of broken infrastructure and difficult work.
Task exposure and curricula
Choose coherent task distributions
A task distribution is the rule selecting goals, starting states, conditions, and constraints across attempts. Training exposure, development cases, protected evaluation, and intended deployment need not share the same mixture. Representative sampling estimates performance on an intended population; a stress collection emphasizes rare consequential conditions. Keep those purposes separate, as explained in sampling the intended work.
Procgen, introduced by Cobbe and colleagues at ICML 2020, varied game layouts, assets, entities, and timing. Its generalization protocol trained on finite sets of levels and tested unseen levels from the generator. That measures something narrower than transfer to a new task family. An ablation also found that progress through a familiar level sequence could conceal poor performance when the sequence changed. New seeds and meaningful new coverage are different claims. Procgen paper.
Variation must preserve coherence. Changing a starting page, account state, or available resource can make previously valid instructions impossible. Generate related pieces together and validate their relationships. Prime Intellect’s General Agent generates instructions, databases, tools, reference solutions, and verifiers. Its structural controls require the initial database to fail verification and a replayed reference solution to pass. This establishes one accepted path, not exhaustive verifier coverage.
A useful coverage ledger names task families and consequential conditions, then records whether each combination is included in training, reserved for assessment, excluded as invalid, or still uncovered. More samples of an included combination do not fill an uncovered one. If recognizing an impossible request is an intended capability, specify and check that outcome explicitly. Generated-task coverage and assessment independence explain how to keep related examples and their solutions from crossing the wrong boundary.
Change exposure without moving the goal
A curriculum changes training exposure through a schedule or an adaptive selection rule. Bengio and colleagues’ Curriculum Learning, published in 2009, described distributions that initially emphasize easier examples and progressively introduce harder or more varied work. The final target remains distinct from the temporary exposure used to reach it. Their findings motivated this strategy without establishing that easy-to-hard ordering always helps. Curriculum Learning.
Difficulty is relative to a policy and a feedback scheme. Uniform failure can provide little distinction among attempts; uniformly easy tasks may provide little new learning signal. Measure competence on declared checks rather than assigning difficulty from episode length alone. A fixed schedule is simple but cannot respond to uneven progress. Adaptive selection uses measured outcomes to change exposure, while retaining earlier tasks can help detect and limit forgetting.
Reverse Curriculum Generation, by Florensa and colleagues in 2017, changes starting states rather than the goal. Episodes begin near a supplied goal, then expand outward as the policy improves. Short random-action runs generate nearby feasible states, and selection favors intermediate success rates. Earlier useful starts remain in the mixture. Evaluation uses the original start distribution, not merely the easier training starts. The method requires the ability to reset to selected states. Reverse curriculum paper.
Change training starts, keep evaluation fixed
S = selected training start; P = proposed start; G = fixed goal. Gray lines are feasible connections. Dashed arrows are short random-action proposals, not guaranteed acceptance.
PAIRED provides a contrasting adaptive mechanism: an environment designer is rewarded for a performance gap between two agents. This seeks tasks one can solve while the other struggles, instead of rewarding a generator simply for making both fail. It does not guarantee solvability or deployment relevance. PAIRED’s environment-design formulation makes the generator’s objective explicit.
A rising training score can result from presenting easier work. Keep an independent evaluation mixture fixed while comparing curricula, and report whether improvement is measured per interaction or per elapsed training time: an adaptive generator can spend additional work selecting useful tasks. Matched comparisons separate improved capability from changed exposure.
Simulation and transfer
Choose how consequences are produced
The environment interface does not determine how consequences are produced. A simulator generates task evolution under specified assumptions. An emulator executes a represented machine or system. An application-backed environment instead runs the task’s software, often with controlled fixtures and isolated dependencies. A world model learns to predict transitions. These approaches can expose similar interfaces while preserving different effects.
| Approach | Response to a new action | Main boundary |
|---|---|---|
| Application-backed execution | The installed software executes it; WebArena uses functional websites. | Selected software, fixtures, and dependencies differ from unrestricted production. |
| Emulation | The represented machine executes it; ALE uses the Stella emulator. | Machine behavior and game-specific reward extraction define the task. |
| Engineered simulation | Implemented rules or mocks generate consequences. | Only modeled state changes and dependencies are represented. |
| Fixed recorded playback | No general response exists for an action absent from the recording. | Observed history does not specify alternative outcomes. |
| Learned dynamics | A model predicts an action-conditioned successor. | Prediction errors may create consequences unavailable in the target system. |
A bounded application environment can combine actual databases, service containers, snapshots, and mocks. Choose which parts to replace according to the behavior being tested. Running the original agent harness can reduce orchestration mismatch, but it does not by itself make external dependencies resettable or eliminate reward hacking. Bring-your-own-harness training explores that tradeoff.
Recorded playback has a precise limit. If a recorded action confirmed a draft, its next observation might show a submitted record. Replacing that action with cancellation while retaining the submitted observation does not simulate cancellation. A counterfactual execution must recompute downstream states and observations under the changed action and controlled external conditions. A restorable checkpoint plus an executor can branch; a transcript alone generally cannot. Simulation and replay explains the resulting evaluation boundary.
Learned prediction adds flexibility but also exploitable error. Ha and Schmidhuber’s World Models reported a controller finding movements that stopped simulated monsters from firing—an exploit unavailable in the original game. The relevant test was behavior after transfer, not predicted return alone. World Models provides the example; the World Models chapter develops learned dynamics and accumulated prediction error.
Validate fidelity for the intended use
Simulation fidelity is faithfulness to specified task-relevant properties. NASA-STD-7009B distinguishes implementation verification from empirical validation against the world for an intended use. Correct simulator code answers the former; comparisons with external reference behavior address the latter. Identify relevant observations, transitions, timing, permissions, and other actors before choosing a realism target.
The required fidelity depends on the failure under investigation. Text interactions may suffice while iterating on a voice agent’s workflow or tool selection. Interruptions require timing-sensitive audio interaction; accent and background-noise failures require the corresponding audio conditions. Simplifying one component test does not replace end-to-end testing. From Self-driving to Autonomous Voice Agents explains this task-relative choice.
Domain randomization varies assumed conditions during training. Tobin and colleagues’ 2017 visual-localization study varied textures, lighting, cameras, and distractors, then tested on real tabletop images. Distractor variation mattered for real clutter. This demonstrated usefulness for a particular perception task without requiring one photorealistic training scene. Randomization cannot supply a mechanism the simulator omits, and chosen ranges do not establish real event frequencies. Physical transfer is developed in Robotics.
Validate interactions and learned behavior
| Comparison | What stays fixed | Supported conclusion |
|---|---|---|
| Humans versus simulated users | Agent and task protocol | Whether the simulator reproduces relevant interaction outcomes and failure patterns. |
| Training with different simulators | Starting assistant and training procedure | Whether the changed simulator produces better behavior on an independent downstream assessment. |
The January 2026 Lost in Simulation study compared humans and simulated users with a fixed GPT-4o agent on 18 adapted retail tasks. Error was not uniformly optimistic or pessimistic: simulation overestimated some outcomes and underestimated others. Plausible individual messages therefore did not establish faithful agent–user interaction.
A separate May 2026 training study held the starting assistant and training procedure fixed while changing the user simulator. People preferred the writing assistant trained with a simulator fine-tuned on human conversations; the role-playing-simulator variant was not statistically distinguishable from the starting assistant. This supports a bounded conversational-preference result, not objective productivity or general tool-use success. Keep uncertainty and transfer limits attached to the actual outcome measured.
Experience and controlled change
Preserve the meaning of each transition
An environment release includes more than its base implementation. Wrappers transform the effective interface: actions before execution, observations after execution, rewards, or reset behavior. Gymnasium’s documented action-rescaling example exposes values in [0,1] while the underlying environment accepts [-1,1]. Recording only the base environment name loses the meaning of the action supplied by the policy. Preserve wrapper configuration and order. Gymnasium wrappers.
| Record | Meaning to preserve |
|---|---|
| Environment release | Task definitions, initial assets, transitions, dependencies, wrappers, access rules, and budgets. |
| Exposure configuration | Sampler, task family, selected initial conditions, and curriculum stage. |
| Attempt and transition | Episode identity, step order, observations, requested and applied actions where they differ, and ending reason. |
| Learning and assessment | Applied policy identity, reward components, verifier identity, verdict, and feedback validity. |
Record alignment specifies which action and reward belong with each observation. Reinforcement Learning Datasets (RLDS), a format for storing episodes and steps, places an observation beside the action taken from it and the reward resulting from that action. The final record preserves the last observation, but no further action leaves it, so its outgoing action, reward, and discount fields are invalid. The reward for reaching that observation remains valid in the preceding record. Separate last-record and terminal-state markers distinguish the end of collection from the end of the task.
Three records preserve two transitions
| Record | Observation | Outgoing action | Resulting reward | Outgoing discount | is_first | is_last | is_terminal |
|---|---|---|---|---|---|---|---|
| 0 | o0 | a0 | r1 | d0 | true | false | false |
| 1 | o1 | a1 | r2 | d1 | false | false | false |
| 2 | o2 | invalid | invalid | invalid | false | true | true |
Transition 0: [record 0: o0, a0, r1] + [record 1: o1]
Transition 1: [record 1: o1, a1, r2] + [record 2: o2]
Exactly three records describe two transitions. d0 and d1 are the stored outgoing discount fields; the discount for the valid transition into true termination can be zero. The final record’s outgoing fields are invalid, not zero. A truncated last record can have is_last=true and is_terminal=false.
TorchRL’s MultiCollector can tag frames with the policy version actually applied by a worker. One batch may therefore contain multiple versions; a parent’s update counter is insufficient. Padded or preempted entries need validity masks or removal, not interpretation as ordinary experience. A valid zero reward, missing feedback, and an invalid row are different states. Their training implications belong in Post-training.
GSO’s changelog illustrates why these details affect comparisons: it added deceptive-optimization detection in November 2025, changed iteration budgets and evaluation settings in April 2026, and restricted network access in July 2026 after observing upstream-solution fetching. Familiar repository tasks thus remained recognizable while the effective experiment changed. Identifying the system that ran provides the broader provenance pattern.
Regrade, rerun, or retrain
When an outcome is surprising, first locate the responsible boundary: policy choice, task specification, transition implementation, observations, or verifier. Reproduce the consequential behavior and repair that boundary. SWE-Marathon’s task-development account describes repeated agent trials, inspection, and repairs to both shortcuts and verifiers. A local repair then needs broader regression checks, because fixing one case can change other behavior.
Regrading reassesses a saved attempt. Rerunning generates new behavior. Harbor regrade starts a separate verifier over captured artifacts and writes a new trial linked to the original. It requires the artifact bytes needed for assessment and does not support multi-step regrading in the documented workflow. A transcript or old score cannot reconstruct uncaptured state.
| Change | What old evidence can answer | Required work for the new claim |
|---|---|---|
| Post-hoc checker correction; complete artifacts retained | How the revised checker assesses the old attempt. | Regrade while preserving the original assessment. |
| New process requirement; necessary events were not recorded | Only the previously recorded properties. | Run fresh trials with the missing evidence captured. |
| Changed observations, transitions, permissions, or visible feedback | What happened under the old interaction contract. | Execute again to observe behavior under the new contract. |
| Changed training rewards or curriculum | Possibly revised scores for historical behavior. | Train under the intervention and independently evaluate the resulting policy. |
Preserve old releases and compare baseline and candidate on matched tasks, access, budgets, and assessment rules. If both policy and environment change, a score difference alone cannot identify which change caused it. Once inspected cases guide repairs, treat them as development or regression evidence rather than untouched assessment. See matched comparisons, preserved assessments, and change decisions.
A useful environment makes each conclusion traceable: what task was attempted, what information and actions were available, what actually changed, what was checked, and what remains unknown. That is what allows repeated interaction to become meaningful learning and evaluation rather than repeated optimization of an accidental task.
Open questions
Verifier coverage remains difficult for open-ended work: acceptance rules must admit defensible alternatives without rewarding shortcuts. Progress would combine independently attempted solutions, invalid controls, and calibrated judgments to expose both rejection and acceptance errors.
Simulator validation must account for the behavior optimization discovers, not only familiar interactions. A simulator can appear accurate on collected traces while offering exploitable alternatives. Progress would test policy-induced behavior against independent target-system outcomes.
Adaptive task generation must balance learnability with relevance. Solver-conditioned difficulty can produce useful training exposure while drifting from the intended workload. Progress would demonstrate gains on a fixed independent distribution alongside retained skills and the cost of generating and selecting tasks.
Long-horizon environments need sufficient restoration and assessment evidence without pretending every external effect is reversible. Progress would make reset scope and missing evidence explicit, then show which continuation and regrading claims remain reproducible.
































