Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Environment variables

You set

VariableRead byWhat
MIROIR_TOKENrunthe bearer token every route but /health requires; unset, anyone can act
MIROIR_AGENT_TOKENruna second bearer token, which opens /mcp alone, for an agent that calls it itself; needs MIROIR_TOKEN, and must differ from it
MIROIR_PORTrun, sandboxthe port to serve on; 8000 by default
MIROIR_SANDBOXrun, checkhttp://HOST:PORT of a sandbox, which enables run_code
MIROIR_LOG_BUDGET_MBrun, checkthe change-log size past which an episode faults, shared by the databases; 1024 by default
MIROIR_ENV_VERSIONrunthe version /metadata reports, such as the product image’s tag
SANDBOX_IMAGEsandbox/check.sh, python/tests/docker.shthe sandbox image to start

Miroir sets

VariableForWhat
MIROIR_WORLDbake and seed commandsthe world being baked
MIROIR_SHIFT_DAYStime.hookwhole days the timestamps move
MIROIR_SHIFT_DATE_DAYStime.hookcalendar days the dates move
MIROIR_EPISODE_DBcommand checksthe path of the episode database
MIROIR_DATABASE_URLcommand checksthe URL of the check’s app database, or the only one
API_<APP>the agent’s code in the sandboxeach app’s API, valid during one run_code call
MIROIR_POOLthe miroir pool commandthe pool’s name, to label what it starts

Every process and command also gets the manifest’s env, and a process its own env. None of them sees MIROIR_TOKEN or MIROIR_AGENT_TOKEN.