BackOffice Gym

About

BackOffice Gym is an open-source reinforcement-learning environment. An agent runs the operations desk of Juniper Goods, a fictional online home-goods store: support threads, refunds, replacements, restocking, a staff calendar and a written policy.

How an episode works

A task template and a seed generate a fresh store in PostgreSQL: customers, orders, payments, inventory, calendar and an open support thread. The agent gets 16 tools (8 to read, 7 to act, and submit) and at most 30 steps. The same task and seed always produce the same store.

How the reward is decided

When the agent submits, SQL checks read the final database state and compare it with the outcome the seed implies. Required checks are weighted. Forbidden checks (a change outside the task, a refund that breaks policy, obeying a fake instruction) set the reward to 0. No language model judges anything.

Ways in

from backoffice_gym import BackOfficeGym

with BackOfficeGym("http://127.0.0.1:8787") as env:   # pnpm api
    obs = env.reset("refund-window-trap", seed=7)
    result, done = env.step("read_policy")
    ...
    result, done = env.step("submit", {"summary": "declined per policy"})
    print(result["score"]["reward"])

Runs on this site were recorded with mcp-evals, then re-executed step by step: every replay reproduced its recorded reward exactly.

Limitations

Built by Shekhar Kumar · source on GitHub