Skip to main content
LLMix

Agentic RL environments

Bespoke RL environments for training LLM agents.

Models learn agentic behavior inside executable worlds. LLMix builds the task state, tools, transition logic, resets, task distributions, verifiers, rewards, and rollout interfaces required for online post-training.

What an RL environment actually contains

An RL environment is not a workflow diagram. It is executable training infrastructure. It defines the task, observations, action space, tools, world state, transition dynamics, episode reset, success criteria, verifier, reward, and trajectory record.

Environment engineering supports the complete post-training program. LLMix can deliver the environment independently or use it as part of an end-to-end model-training engagement.

  1. Task generator

    produces the episode

  2. Observation → Policy → Action / tool call

    the model acts

    world state · transition · tools · reset

  3. Verifier + reward

    scores the behavior

  4. Trajectory store

    captured for training

Environment server architecture

Each environment runs as a service the training loop can drive: it accepts actions and tool calls, advances world state, returns observations, and exposes reset and replay. Deterministic seeds make failures reproducible and debuggable.

  • Stateful episode lifecycle with reset and recovery
  • Persistent and partially observable world state
  • Deterministic replay and controlled stochasticity
  • Configurable horizons and episode boundaries

Task generation and curricula

A fixed task list overfits quickly. Task generators produce distributions: procedural variants, difficulty schedules, adversarial cases, and hard negatives mined from the policy's own failures.

  • Procedural task generation
  • Difficulty schedules and curricula
  • Adversarial cases and hard-negative mining
  • Model-generated tasks with filtering
  • Balanced environment mixtures

Tool and resource servers

Agents learn the tools they train against. Sandboxes reproduce the semantics that matter: APIs and function calling, files, databases, terminals, and browser or application simulators, including permissions, injected failures, latency, and cost.

  • APIs and function calling
  • Files, databases, and terminals
  • Browser and application simulators
  • Resource permissions and tool-error injection
  • Latency and cost modeling

Verifier and reward interfaces

Success becomes learning signal through verifiers and rewards: exact programmatic checks, unit tests, state-difference comparisons, rubric judges, and learned reward models, composed into outcome and process rewards.

  • Exact and programmatic verifiers
  • Unit tests and state-difference checks
  • Rubric-based scoring and learned reward models
  • Process, outcome, and multi-objective rewards

Parallel rollout integration

Environments plug into the rollout system: parallel workers, policy-model serving, reward computation, trajectory capture and inspection, dataset export, and direct integration with the optimization loop.

  • Parallel environment workers
  • Policy-model serving integration
  • Trajectory capture, replay, and inspection
  • Dataset export and training-loop integration

Security and data boundaries

Environment work is scoped before data moves: what data enters the environment, where it runs, who can access trajectories, and what is retained. Sandboxes isolate tools and resources so training cannot touch production systems.

  • Scoped data boundaries and access control
  • Isolated sandboxes for tools and resources
  • Defined retention for trajectories and logs

The contract the training loop is written against

Every LLMix environment honors an explicit interface and produces structured trajectories, so rollout workers, verifiers, and trainers such as GRPO, PPO/RLOO, or RLVR-style loops integrate against a stable contract rather than against one environment's quirks. No single framework is assumed: the contract matters, not the library.

interface AgentEnvironment<State, Observation, Action> {
  /** Restore initial state for a task. Same seed, same episode. */
  reset(taskId: string, seed: number): Promise<Observation>;

  /** Apply one action and advance world state. */
  step(action: Action): Promise<{
    observation: Observation;
    reward: number;
    rewardComponents: Record<string, number>;
    terminated: boolean;
    truncated: boolean;
    info: Record<string, unknown>;
  }>;

  /** Full world state for replay, debugging, and verifiers. */
  snapshot(): Promise<State>;
}
The reference environment interface. Reset takes a seed so every episode replays exactly.
{
  "episode_id": "ep_00142",
  "task_id": "billing-dispute/hard/seed-771",
  "env_version": "1.4.2",
  "policy_checkpoint": "step_01800",
  "step": 7,
  "observation": { "rendered": "...", "tokens": 412 },
  "action": { "type": "tool_call", "tool": "refund_lookup", "args": {} },
  "tool_result": { "status": "ok", "latency_ms": 84 },
  "reward_components": { "task": 0.0, "invalid_call": 0.0, "step_cost": -0.01 },
  "terminated": false,
  "truncated": false
}
Per-step trajectory record: the training data pipeline, the debugging record, and the audit trail in one schema.

Environment delivery artifacts

  • Containerized environment with documented interfaces
  • Task generators, seeds, and curricula
  • Verifier and reward implementations
  • Rollout integration and trajectory tooling
  • Replay and debugging utilities

Environment questions, answered directly

Discuss the environment your capability needs.