You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: assets/lab/environments/AGENTS.md
+107-4Lines changed: 107 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
> Managed by Prime Lab. Do not edit this file directly.
4
4
> `prime lab setup` and `prime lab sync` refresh it. Put project-specific agent guidance in workspace-root `AGENTS.local.md`; agents should read that file after this one if it exists.
5
5
6
-
This file mirrors the "Tasksets" documentation page.
6
+
This file mirrors the "Tasksets" and "Multi-agent environments" documentation pages.
7
7
8
8
---
9
9
@@ -30,7 +30,7 @@ The command also supports:
30
30
- Use this to create custom tools which are installed into supported harnesses via MCP.
31
31
-`-U`, `--add-user` — also scaffold a `vf.User` simulator at `servers/user.py`
32
32
- Use this to simulate a user interacting with the model. Not all harnesses support user simulation.
33
-
-`-H`, `--add-harness` — also scaffold a custom `vf.Harness` at `harness.py`, selectable via `--harness.id <name>`
33
+
-`-H`, `--add-harness` — also scaffold a custom `vf.Harness` at `harness.py`, selectable via `--env.agent.harness.id <name>`
34
34
- Prefer a built-in harness unless the model needs to run inside a custom program.
35
35
36
36
Most tasksets do not need specific tools, user simulations or custom harnesses.
@@ -116,7 +116,7 @@ class AdditionConfig(vf.TasksetConfig):
116
116
task: AdditionTaskConfig = AdditionTaskConfig()
117
117
```
118
118
119
-
These values can be overridden with `--taskset.num-tasks` and `--taskset.task.tolerance`, or with the equivalent TOML fields.
119
+
These values can be overridden with `--env.taskset.num-tasks` and `--env.taskset.task.tolerance`, or with the equivalent TOML fields (`[env.taskset]`).
120
120
121
121
## Lazy and infinite tasksets
122
122
@@ -241,4 +241,107 @@ class JudgeTraceTaskset(vf.Taskset[JudgedTask, SetConfig]):
241
241
]
242
242
```
243
243
244
-
To override the judge model, set `taskset.task.judge.model` in your config (it is a string).
244
+
To override the judge model, set `env.taskset.task.judge.model` in your config (it is a string).
245
+
246
+
## Beyond one agent
247
+
248
+
One eval rollout doesn't have to be one agent run: agents, the control flow between
249
+
agents, and cross-agent rewards are the environment's job — see
For the single-agent case none of this is machinery the user sees: `SingleAgentEnv`
306
+
declares one `agent` (`--env.agent.harness.id codex`, `--env.agent.max_turns 20`),
307
+
`run()` is `await agents.agent.run(task)`, and the episode carries exactly one
308
+
trace.
309
+
310
+
The run's `[env]` block is the whole run — the env is the encompassing entity,
311
+
composing three separately-chosen concerns:
312
+
313
+
-**`env.taskset`** — *what to solve*: the seed rows every rollout starts from,
314
+
their data, their per-trace judgement (`--env.taskset.id`, or the positional
315
+
`eval <taskset-id>`).
316
+
-**each agent's `harness`** — *how that LLM interfaces with the world*: the
317
+
program driving model calls, tools, a runtime — pinned per agent, never a
318
+
run-wide flag.
319
+
-**the env itself** — *the control flow between agents*: who runs, in what order,
320
+
judged how across the finished set (`--env.id`).
321
+
322
+
### Reusable envs: `--env.id`
323
+
324
+
An interaction pattern that isn't specific to one dataset — n attempts, a judge, a
325
+
modeled user — is its own plugin, paired with any taskset from the CLI:
326
+
327
+
```bash
328
+
uv run eval gsm8k-v1 --env.id best-of-n --env.n 8
329
+
uv run eval my-task-v1 --env.id agentic-judge --env.judge.harness.runtime.type docker
330
+
```
331
+
332
+
The same pairing as TOML — `env.id` plus one `[env.<agent>]` block per agent — is
333
+
checked in as `configs/agentic_judge.toml` (`uv run eval @ configs/agentic_judge.toml`).
334
+
335
+
`--env.id` resolves like every plugin id — a bundled env (below), a local package
336
+
exporting an `Environment` subclass via `__all__`, or a Hub `org/name[@version]` —
337
+
and its `EnvConfig` surface typed on the CLI (`--env.<agent>.*`, `-h` renders
338
+
them). Empty (the default) keeps the taskset's own story: the env its package
339
+
ships (a *recipe* env like `code_golf_v1`, where the interaction is intrinsic to
340
+
the data), else `SingleAgentEnv`. An explicit id wins over a bundled recipe env.
341
+
342
+
Bundled envs (`verifiers/v1/envs/`):
343
+
344
+
| id | agents | what it does |
345
+
| --- | --- | --- |
346
+
|`best-of-n`|`agent`|`--env.n` independent attempts per rollout; its metrics mark the argmax-reward sibling (`best`) and whether any reached `--env.threshold` (`pass_at_n`) — rejection sampling and pass@k. A single-agent env keeps the single-agent name, so `--env.agent.*` flags compose unchanged. |
347
+
|`agentic-judge`|`solver`, `judge`| agent-as-judge: the solver plays the task; a code-executing judge agent verifies the finished attempt with real execution, always in its own sandbox, never on the host. The judge's task mirrors the solver task's world (same image, a fresh box in its original state) with the graded transcript uploaded (`/tmp/transcript.md`/`.json`). The verdict channel is a file: the judge writes `{"score": 0-10, "reasoning": ...}` to `/tmp/verdict.json` in its box, scraped onto its trace while the box is alive and validated STRICTLY onto the solver's trace as the `judge` reward — a missing, malformed, or off-scale verdict fails the rollout instead of clamping. The judge must land in a container: pin `--env.judge.harness.runtime.type docker\|prime`, or construction refuses. A judgement that needs no execution belongs on the plugged tier (`env.taskset.task.judges`), not on an agent. |
0 commit comments