miroir

mcp
Security Audit
Pass
Health Pass
  • License — License: Apache-2.0
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 39 GitHub stars
Code Pass
  • Code scan — Scanned 12 files during light audit, no dangerous patterns found
Permissions Pass
  • Permissions — No dangerous permissions requested

No AI report is available for this listing yet.

SUMMARY

Turn a product into an agentic RL environment

README.md

Miroir 🪞

Turn a product into an agentic RL environment.

Miroir packages real applications into environments for training and evaluating agents.

Add a manifest and tasks to your product's Docker image. Miroir handles the rest: seeding data, resetting state between episodes, exposing APIs as tools through OpenEnv and MCP, and grading what the agent actually changed—including database rows, emails, and HTTP requests.

Quick start

Requirements: Docker with buildx and uv.

1. Build and verify

docker buildx bake acme-crm-env
docker run --rm --network none acme-crm-env check

This builds Acme CRM, a sample application with Postgres, Redis, a web server, a worker, and an MCP server. The check command replays every task's reference run and verifies its expected outcome.

2. Serve the environment

docker run --rm -d -p 127.0.0.1:8000:8000 \
  -e MIROIR_TOKEN=secret acme-crm-env

curl http://127.0.0.1:8000/health

3. Run an episode

Install the Python client:

uv venv && source .venv/bin/activate
uv pip install miroir

Reset an episode, execute an action, and inspect its outcome:

from miroir import Session

session = Session.lease(
    ["http://127.0.0.1:8000"],
    token="secret",
    wait_busy=False,
)

start = session.reset("pay-invoice")
print(start["instruction"])

step = session.step(
    "api_request",
    {"method": "POST", "path": "/invoices/4001/pay"},
)
print(step["observation"]["result"]["status"])

outcome = session.finish()
print(outcome["reward"], outcome["metadata"]["checks"])

session.close()

The episode receives a reward of 1 only if the invoice is paid.

Documentation

Gitea example — Unmodified Gitea with 144 tasks across 12 task families.

Build the documentation locally with mdbook serve docs.

Coding agents

Use the Miroir skill to build environments, write tasks, debug checks, and run training with coding agents.

Claude Code

/plugin install miroir --marketplace raphaelDkhn/miroir

Other agents

npx skills add raphaelDkhn/miroir

Contributing

See CONTRIBUTING.md. Report security issues privately, as
SECURITY.md describes.

License

Apache-2.0

Reviews (0)

No results found