miroir
Turn a product into an agentic RL environment
Miroir turns a product's Docker image into Harbor environments that grade what an agent did to the real product: the database rows it changed, the emails and HTTP calls the product sent, and the answer it gave. Any change outside the task's scope counts as harm, reported next to reward. Harbor already runs agents, sandboxes and jobs. Miroir adds the two pieces it lacks: a product image with seeded data, and a grader that reads what changed below the product's API. You need Docker with buildx and uv. From a clone:
Summary extracted from the README.
Miroir 🪞
Turn a product into an agentic RL environment
Miroir turns a product's Docker image into Harbor
environments that grade what an agent did to the real product: the database rows it changed, the
emails and HTTP calls the product sent, and the answer it gave. Any change outside the task's scope
counts as harm, reported next to reward.
Harbor already runs agents, sandboxes and jobs. Miroir adds the two pieces it lacks: a product image with seeded data, and a grader that reads what changed below the product's API.
Quick start
You need Docker with buildx and uv. From a clone:
uv tool install harbor==0.26.0
docker buildx bake
harbor run -c fixtures/acme-crm/check.yaml --job-name quick-start
alias miroir='docker run --rm -v "$PWD:$PWD" -w "$PWD" miroir:dev miroir'
miroir check --tasks fixtures/acme-crm/tasks jobs/quick-start
This builds a small CRM with 7 tasks, then has Harbor run each task's reference solution, an agent
that does nothing, and probes: wrong solutions the grader has to catch. miroir check should end
with:
7 tasks, 21 trials, 7 skipped probe slots, 0 violations, 0 voids
The first build compiles Miroir (6 min 44 s on a 12-CPU Docker Desktop). The trials take under a minute.
How it works
miroir bakeseeds the product's data into its image duringdocker build.- Each Harbor trial starts that image next to the agent's container.
miroir runboots the product and moves its dates to the trial's day. The agent uses the product's own API. - When the agent stops,
miroir collectrecords the rows that changed and the emails and HTTP calls the product sent. miroir gradescores that record in Harbor's separate verifier, using the SQL checks and allowed changes in the task'stask.toml.
Tasks are plain Harbor task directories. miroir check fails when a grader rejects the reference
solution or lets a probe through, and miroir draft writes a first grading spec from reference
runs.
More
- Docs: wrap a product, write tasks, validate, train
- Gitea example: stock Gitea, three seeded companies, 120 tasks
- Skill for coding agents. In Claude Code:
claude plugin marketplace add raphaelDkhn/miroir, thenclaude plugin install miroir@miroir - Contributing, security, Apache-2.0