tboulet

Regact

Reasoning · Game · Act

A framework for running coding agents on games they have never seen.

Regact is the research framework behind ModAct. A code-writing agent is given an unknown game, a workspace and a controlled way to interact with the game. The agent, the game and the experiment protocol are separate, interchangeable parts, so the same setup compares agents, models and protocols.

How a Regact run is organised A coding agent (Codex, Claude Code or Alan Code) works in a sandboxed workspace whose filesystem and network are confined. It writes a controller, and under ModAct a world model, then calls framework commands over a localhost bridge. Regact runs the selected protocol, plain acting or ModAct, and executes the controller in an isolated process against the real problem: ARC-AGI-3, PuzzleScript, Baba Is You, MiniGrid or Sokoban. The conversation, tool calls, frames and world model are recorded, and the run can be replayed in the viewer. SANDBOXED WORKSPACE OS sandbox: filesystem and network confined CODING AGENT Codex Claude Code Alan Code writes CODE controller.py world_model/ under ModAct FRAMEWORK COMMANDS RunController UpdateCodeWorldModel run my controller validate my model game source hidden; internet blocked except the agent's own model API localhost REGACT runs the protocol vanillaplain acting ModActmodel, then act ISOLATED PROCESS the controller, from a frozen copy of the code no workspace, no dataset, no network actions observations PROBLEM the real game ARC-AGI-3 PuzzleScript Baba Is You MiniGrid Sokoban its source is hidden from the agent RUN RECORD conversation · tool calls · frames · world model every run is saved and can be replayed in the viewer How a Regact run is organised A coding agent (Codex, Claude Code or Alan Code) works in a sandboxed workspace whose filesystem and network are confined. It writes a controller, and under ModAct a world model, then calls framework commands over a localhost bridge. Regact runs the selected protocol, plain acting or ModAct, and executes the controller in an isolated process against the real problem: ARC-AGI-3, PuzzleScript, Baba Is You, MiniGrid or Sokoban. The conversation, tool calls, frames and world model are recorded, and the run can be replayed in the viewer. SANDBOXED WORKSPACE OS sandbox: filesystem and network confined CODING AGENT Codex Claude Code Alan Code CODE controller.py world_model/ under ModAct FRAMEWORK COMMANDS RunController UpdateCodeWorldModel game source hidden; internet blocked except the agent's own model API localhost REGACT runs the protocol vanillaplain acting ModActmodel, then act ISOLATED PROCESS the controller, from a frozen copy of the code no workspace, no dataset, no network actions observations PROBLEM the real game ARC-AGI-3 PuzzleScript Baba Is You MiniGrid Sokoban RUN RECORD conversation · tool calls · frames · world model replayable in the viewer
One Regact run. The agent works in a confined workspace and acts on the game only through the controllers it writes, which the framework runs in an isolated process. Everything is recorded.

Agents

who writes the code

The agent is the program that writes the code. Regact drives three coding agents: Codex and Claude Code, the two command-line agents, and Alan Code, my open-source agent, which can also run open-weight models served locally through an OpenAI-compatible endpoint.

The choice of agent is independent of the experiment: the protocol supplies the instructions and the commands, so any agent can run any protocol, with any model it supports.

Sandbox and controllers

learning the game by playing it

A coding agent runs arbitrary code, so nothing would stop it from reading the game’s source and hard-coding an answer. Regact runs it inside an OS sandbox (bubblewrap on Linux, seatbelt on macOS): the agent sees its workspace and the runtime it needs, not the game files, and its network is limited to the connections it is allowed, such as its own model’s API. A run fails rather than proceed unconfined, and the confinement rules can be checked on any machine with one command.

The agent never touches the game directly. It writes controllers: Python code that the framework runs in a separate, more restricted process, from a frozen snapshot, without access to the agent’s workspace, the recorded data or the network. The framework plays the controller’s actions in the real environment and records every transition; the agent reads that experience back through a read-only data API.

Problems

the games

  • ARC-AGI-3The ARC-AGI-3 games: colour-grid games whose rules the agent has to discover by playing.watch this run
  • PuzzleScriptGames from the puzzlescript.net gallery, run on the original engine. Each game is its own short set of rewrite rules.
  • Baba Is YouThe campaign levels of Baba Is You, where the rules are word blocks on the board and pushing them changes the rules.watch this run
  • MiniGridSmall symbolic grid worlds, including BabyAI levels with missions given in language.watch this run
  • SokobanBox-pushing puzzles from DeepMind’s Boxoban levels, where a box pushed into a corner is lost for good.

Protocols

how the agent learns

plain acting
The vanilla protocol. The agent reads its recorded experience, writes a controller and runs it in the real game, as often as its budget allows.
ModAct
The cwm protocol. The agent must first write a world model that reproduces all its recorded experience, and every action of its controllers is checked against the model’s prediction. How ModAct works.

Both protocols share the same environment management, data, controller execution and limits, so a comparison measures the effect of requiring a validated world model, and nothing else in the harness.

Recorded runs

everything can be replayed

Every run is recorded: the agent’s conversation and tool calls, the framework’s feedback, every observation the game produced and, under ModAct, each version of the world model with its validations and counterexamples.

The viewer replays it all. Follow the conversation, load the real trajectory of a controller next to its result, step through the frames, and compare the runs of a benchmark side by side. The benchmarks I have run are listed there.