Task Folder Format
Field names and defaults are Harbor’s (task.toml schema 1.4). To write your first task, start with
Author Task Folders. The contract for tests/ is on
Task Folder Verifiers.
Task folder layout
The dataset root may hold dataset.toml, task_data.py (the model that types task fields) and
verifier.py (a verifier for every single-step task without tests/). Do not edit the records Gym writes there
at prepare.
The folder name is the task ID, unique across the dataset. Task folders may sit up to six levels down. Hidden folders are skipped, and a task folder must not be a symbolic link.
gym eval run and gym dataset validate prepare the dataset, stamping each row with a digest of its task folder,
dataset settings and dataset verifier.py. The harbor Environment Server refuses a row whose digest no longer
matches, so prepare again after an edit. See Digests.
Task settings
These tables list every task.toml key Gym acts on. Gym reads other keys, such as schema_version, [metadata]
and source, without acting on them, except to refuse unsupported settings.
Top level
Like Harbor, Gym ignores unknown keys (logging each one) and reads the legacy spellings version, memory,
storage and allow_internet, which it never writes back.
[environment]
A task whose environment/ holds docker-compose.yaml runs as a group of sandboxes, one per service, on
OpenSandbox only; see Multi-Container Tasks.
[agent]
timeout_sec (default 28800) is the agent’s budget. user is the user the agent runs as; unset, the
Dockerfile’s final USER, else the image’s.
A numeric user is looked up by name in the image first. A bare numeric USER with no passwd entry runs as that
integer user ID on Docker and on OpenSandbox’s plain exec; other providers, and OpenSandbox’s PTY and bash sessions,
need a named user. A uid:gid pair runs only on Docker.
[verifier]
[solution]
env holds variables for the oracle’s solve.sh, resolved on the server’s host.
Dataset settings
dataset.toml holds Harbor’s [dataset] table, which Gym leaves to Harbor, and Gym’s [gym] table. Deployment
settings, such as the sandbox provider, never go here. The [gym] tables below are complete: Gym refuses any other
key in [gym], [gym.defaults] or [gym.tasks."<id>"].
[gym]
None of these keys enters a task digest.
[gym.defaults]
[gym.tasks.”task-id”]
Per-task overrides, keyed by folder name and applied before the multipliers. environment and verifier take any
key of the task’s table: env merges over the task’s own, verifier.environment merges field by field like
[environment] (or, on a task without one, creates it and so selects separate mode), and every other key replaces
it. verifier also takes the Gym-only inputs list (see
Sidecar inputs). artifacts adds entries after the task’s own.
Once dataset.toml sets a multiplier other than 1.0 or any override, every task’s digest includes the defaults
and its own (possibly empty) override, so adding the first such key, or removing the last, changes every digest.
harbor add, harbor remove and harbor sync rewrite dataset.toml without the [gym] table. Keep the
dataset in git and restore the table afterwards.
Dockerfile modes
Prepare puts each distinct environment/Dockerfile in one of three modes.
Pull and overlay mode read the base image’s configuration from its registry at prepare. A built image is named
hb__<hash> after Harbor’s content hash of environment/, so identical folders share one image. A task whose
build fails or is turned off is listed in skipped.json. A base image the registry cannot resolve, or a needed
build with no usable build tool, stops the whole preparation. To configure builds, see
Harbor image builds.
Compatibility with Harbor
Task folders use the Harbor task format. Gym runs them with its own harnesses and sandbox providers, so Harbor’s agents and trial runtime are not used. See Harbor Environment Server.
Supported features
- Single-step and multi-step tasks.
- Prebuilt images and every Dockerfile mode.
- Multi-container tasks with Compose. See Multi-Container Tasks.
- Shared and separate verification, with
reward.txtorreward.json. - Collect hooks and artifacts.
- Task MCP servers and skills, with a harness that supports them. See A task with its own MCP tool.
[environment.healthcheck], and the image’sENTRYPOINTandHEALTHCHECKwhen its configuration is on record.
Additional features
- The
[gym]table indataset.toml, for dataset settings such as the split, license and per-task overrides. - Python verifiers (
tests/verifier.py) and reference answers insolution/answer.md. - Typed task fields and parameterized tasks.
- Sidecar inputs for the verifier, with
[verifier].inputs. - Protection against a planted reward: before a shared verifier runs, Gym clears
/testsand/logs/verifier, apart from the sidecar inputs. Ship verifier helpers in the task’stests/folder. See How the verifier runs.
gym dataset publish --harbor writes a copy that Harbor can run. The copy leaves out the [gym] table, and
publishing refuses Python verifiers that read response or grade in separate mode, and tasks that share a
[task].name.
Current limitations
- Windows and TPU tasks are not supported.
- Network restrictions apply only to a verifier in separate mode, on OpenSandbox.
- Compose tasks run only on OpenSandbox.
- A task that seeds the agent with a transcript (
trajectory.json, orsteps/<first step>/trajectory.jsonin a multi-step task) runs only with the oracle.
What the loader refuses
The loader refuses a task with the reason in its message. gym eval run lists refused tasks in skipped.json and
stops unless you pass --skip-unloadable. gym dataset validate lists them as skipped: <reason> and exits 1.
When no task loads at all, it prints the error instead of a table and exits 2.
A tests/ folder with neither test.sh nor verifier.py loads. Unless a separate verifier’s image ships
/tests/test.sh, it scores 0 with harbor:missing_reward. For fixes, see
Task Folders.