> ## Documentation Index
> Fetch the complete documentation index at: https://docs.boxd.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Repo2RLEnv

> Turn a repository into verifiable RL tasks with Repo2RLEnv, then run every Harbor trial on its own isolated boxd machine.

![The repo2rlenv wordmark inside the boxd card.](https://mintcdn.com/azin/VQPmBjnB34yovRCi/images/boxd-x-repo2rlenv.png?fit=max\&auto=format\&n=VQPmBjnB34yovRCi\&q=85\&s=bd56008800445ea23cf4e3d0753ca0be)

[Repo2RLEnv](https://github.com/huggingface/Repo2RLEnv), by Hugging Face, builds verifiable RL environments for coding agents. It turns repositories, pull requests, agent trajectories and task seeds into [Harbor](https://docs.boxd.sh/use-cases/oss-integrations/harbor.md) tasks. Each task has an instruction, a starting environment, a verifier and a reference solution. Repo2RLEnv makes the tasks; Harbor runs agents against them.

boxd is one of the cloud sandboxes in Repo2RLEnv's [Run with Harbor guide](https://huggingface.github.io/Repo2RLEnv/guides/run-with-harbor/#run-in-a-cloud-sandbox) ([pull request](https://github.com/huggingface/Repo2RLEnv/pull/277)). Pass `--env boxd` and Harbor runs every trial on its own isolated boxd machine with Docker inside, so you can check and score tasks without Docker on your laptop.

## Set up

**1. Install Repo2RLEnv and Harbor**

With Python 3.12 or later:

```bash theme={"theme":"github-dark"}
pip install repo2rlenv
uv tool install 'harbor[boxd]==0.26.0'
```

Repo2RLEnv pins Harbor 0.26.0. The `boxd` extra installs the boxd Python SDK.

**2. Create an API key**

```bash theme={"theme":"github-dark"}
boxd auth keys create repo2rlenv --org <your-org>
export BOXD_API_KEY=bxd_...
```

Harbor creates the machines in the key's organization.

**3. Download a task**

Pull one task from a published Repo2RLEnv dataset on the Hugging Face Hub:

```bash theme={"theme":"github-dark"}
repo2rlenv pull FineEnvs/repo2rlenv-pr-runtime ./pr-runtime --task pallets__click-3004
```

`pallets__click-3004` is a `pr_runtime` task: the agent has to make failing tests in Click pass without breaking the passing ones. Drop `--task` to download the whole dataset.

**4. Check the task with the controls**

The oracle applies the reference solution and should score 1. Nop changes nothing and should score 0.

```bash theme={"theme":"github-dark"}
harbor run -p ./pr-runtime -a oracle --env boxd
harbor run -p ./pr-runtime -a nop --env boxd
```

```text theme={"theme":"github-dark"}
pr-runtime • oracle
┏━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━┓
┃ Trials ┃ Exceptions ┃  Mean ┃
┡━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━┩
│      1 │          0 │ 1.000 │
└────────┴────────────┴───────┘
```

Nop scored 0.000. Each control took under a minute, from creating the machine and building the task's image to deleting the machine.

**5. Run an agent**

```bash theme={"theme":"github-dark"}
export ANTHROPIC_API_KEY=<your-key>
harbor run -p ./pr-runtime \
  -a claude-code -m anthropic/claude-sonnet-4-6 \
  --ak max_budget_usd=2.00 \
  --ae ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \
  --env boxd
```

```text theme={"theme":"github-dark"}
pr-runtime • claude-code • claude-sonnet-4-6
┏━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━┓
┃ Trials ┃ Exceptions ┃  Mean ┃
┡━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━┩
│      1 │          0 │ 1.000 │
└────────┴────────────┴───────┘
```

Claude Code fixed the task in about 3 minutes, for \$0.33 of model spend as Harbor reports it (27 November 2026). The trial's logs, trajectory and reward are in `./jobs/`. Repo2RLEnv's guide explains [how to read them](https://huggingface.github.io/Repo2RLEnv/guides/run-with-harbor/#read-the-results).

## Make tasks from your own repository

Repo2RLEnv generates tasks on your computer, and Harbor runs them on boxd. The `pr_diff` pipeline needs no Docker and no model while it generates. It reads merged pull requests with the [GitHub CLI](https://cli.github.com), so log in first:

```bash theme={"theme":"github-dark"}
gh auth login
repo2rlenv generate --repo pallets/click --pipeline pr_diff \
  --pipeline-opt limit=3 --out ./tasks
repo2rlenv validate ./tasks --oracle
```

`limit` caps the candidates, so you can get fewer tasks than that. `validate` checks the task files only; nothing is built or run. `generate` reads the newest merged pull requests, so your tasks change as new ones merge. On 27 November 2026 this run gave one task, `pallets__click-3919`, out of three pull requests: one was docs only and one changed too many files.

A `pr_diff` task scores the patch against the merged one, partly with a model judge. Pass the judge's key to the verifier with `--ve`:

```bash theme={"theme":"github-dark"}
harbor run -p ./tasks -a oracle --env boxd --ve ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY
harbor run -p ./tasks -a nop --env boxd --ve ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY
```

The oracle scored 0.975 and nop 0.000. Without a judge key the trial is left ungraded, not scored 0, and Harbor reports it as `VERIFIER_FAILED`. For rewards from tests alone, use `pr_runtime` or Tasksmith; both need Docker or a remote worker to generate. [Choose a pipeline](https://huggingface.github.io/Repo2RLEnv/choose-a-pipeline/) compares them.

## How it works

* **One machine per trial.** Harbor creates a boxd machine, builds or pulls the task's image with the Docker daemon on it, runs the agent and then the verifier, copies the results back to `./jobs/`, and deletes the machine.
* **Every machine is [isolated](https://docs.boxd.sh/use-cases/sandboxes.md#cut-off-from-your-fleet-by-design).** It cannot reach your other machines, and it gets none of your connected integrations or agent logins. The machine has outbound internet, so the agent can reach its model API.
* **The task's network rules still apply.** Inside the task's container, Repo2RLEnv's guard blocks PyPI and GitHub on many tasks, `pallets__click-3004` among them, so the agent cannot download the published fix.
* **You choose what goes in.** Values you pass with `--ae` and `--ve` reach the agent and the verifier commands.
* **Harbor's boxd options work here.** Snapshots, region, machine size and the other options are on the [Harbor page](https://docs.boxd.sh/use-cases/oss-integrations/harbor.md#provider-options). Pass them with `--ek`.

## Limits

* **boxd runs the Harbor trials, not the generation.** Repo2RLEnv's own generation runs locally, with local Docker when it executes code. Tasksmith and the research recipes run their workers on Modal or Daytona.
* **No GPU.** A boxd machine has no GPU. Repo2RLEnv runs its GPU trials on Modal.
* **Your machine quota caps concurrency.** Each concurrent trial is one machine. Harbor runs 4 at a time unless you set `-n`. `boxd manage billing` shows your quota.
* **Controls first.** A generated task has passed nothing beyond its generator's checks. Run the oracle and nop on every dataset before you score an agent on it, as Repo2RLEnv's guide says.

## Read more

* [Run tasks with Harbor](https://huggingface.github.io/Repo2RLEnv/guides/run-with-harbor/), Repo2RLEnv's guide
* [Repo2RLEnv's docs](https://huggingface.github.io/Repo2RLEnv/)
* [Repo2RLEnv on GitHub](https://github.com/huggingface/Repo2RLEnv)
* [Repo2RLEnv datasets on the Hugging Face Hub](https://huggingface.co/collections/FineEnvs/repo2rlenv-verifiable-rl-environments-6aa82300d7494c050f50508d)
* [Harbor on boxd](https://docs.boxd.sh/use-cases/oss-integrations/harbor.md)
* [Reproducible RL environments](https://docs.boxd.sh/use-cases/reproducible-rl-environments.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.