Skip to content

SPEC-027: Play it yourself

  • Status: Implemented
  • Milestone: v0.16 "Play it yourself"
  • Owners: lead maintainer

1. Purpose

A person should be able to take a seat in any world: play tic-tac-toe against a model, chess against scripted/chess, or negotiate with an agent, in the terminal or in the browser. This is the quickest way to understand a world, to test a world you are writing, and to feel how strong a model is. The person gets exactly what a model gets (SPEC-002): the same observation, legal moves, messages and limits, and nothing more.

2. Terms

  • Human agent: the built-in agent human, which asks a person for each move.
  • Request: what the runner sends an agent for one move (SPEC-002): observation, legal moves (actions), rules, inbox, notes, limits and the last error.
  • Pending turn: a request the human agent has received and not yet answered.

Keywords MUST, SHOULD and MAY follow RFC 2119.

3. Requirements

The agent

  • HUM-001 AgentPlay MUST include a built-in agent human (ADP-004). Its config MAY set name (default "you"), which reports use as the model: the competitor key is human:<name> (RPT-002). It costs nothing, reports no tokens, and its capabilities MUST include human: true.
  • HUM-002 The human MUST be shown only what its request holds: the rules (once, at the start), the observation, the legal moves, the inbox, the notes and the last error. It MUST NOT be shown other agents' observations, reasoning or private messages while the run plays.
  • HUM-003 Input that does not name a legal move MUST be refused by the human agent itself, with the reason, and the person asked again; it MUST NOT reach the world or count as an illegal move. Input is read with the same parser as model replies (SPEC-025 REL-006), so 4, e4 and I play e4 all work. When the legal moves are a JSON Schema instead of a list, the reply MUST be checked against the schema the same way. In a workspace (SPEC-030 WSP-020) the person MAY type its tools as short commands: run <command>, read <path>, write <path> followed by the text and a line with only ., pass and done.
  • HUM-004 The person MAY send messages with a move when the world allows chat (MSG-001): one or more lines starting with > (terminal) or the message box (browser) are sent as public messages with the next move; >@id text sends to one agent.
  • HUM-005 The person MUST be able to resign: resign in the terminal or the Resign button in the browser. Resigning MUST end the run as a forfeit of that agent, as RUN-009 does, logged with the reason "resigned". Ctrl+C MUST stop the run as it does for any run.

In the terminal

  • HUM-006 Each turn MUST print the observation as a grid when the world declares a grid view (VWR-012), as preformatted text when it declares a text view, and otherwise as indented JSON. In a grid, an empty cell MUST show its index when the actions are integer indices into the grid (so tic-tac-toe shows the numbers to type), and . otherwise; the chess board MUST be labelled with files a to h and ranks 1 to 8, with the person's colour at the bottom. Then it MUST print new messages, notes and the last error; the legal moves (all of them up to 40, otherwise the count and "type ? to list them"); and a prompt naming the agent, for example your move (x):. ? lists the legal moves and rules prints the rules again.
  • HUM-007 When standard input is not a terminal, a run with a terminal human MUST stop before the first turn with the error code human.no_terminal, whose fix says to use --live to play in the browser.

In the browser

  • HUM-008 With play --live, the human MUST play in the live run page (VWR-019): on its turn the page shows the legal moves as buttons, makes grid cells clickable when the actions are integer indices into the grid (VWR-012), and offers a message box and a Resign button. For chess, clicking a piece and then a square MUST play the legal move between them, asking which piece to promote to when a pawn promotes.
  • HUM-009 While a human plays in the browser, the live server MUST NOT send the page other agents' observations, reasoning or private messages (HUM-002): it streams those events without the hidden parts, so they cannot be read in the browser's developer tools either. After run_end the full replay is shown as usual.
  • HUM-010 The live server MUST serve the pending turn only to its own page, at GET /<token>/turn, and accept a move only at POST /<token>/move with a JSON body {"agent", "step", "action", "say"?}. Every rule of VWR-024 still applies, and a POST MUST also be refused unless its Origin header is the server's own origin and its Content-Type is application/json, its body is at most 64 KB, and it is for a human agent's pending turn at that step. A refused move gets a 4xx answer with the reason, and changes nothing.
  • HUM-011 The live server MUST keep running while a human turn is pending; the rules of VWR-025 apply once the run ends.

Running

  • HUM-012 agentplaykit play <scenario> --human [ID] MUST replace agent ID (default: the first agent) with {use: human}, keeping its id. An unknown ID MUST be a CLI error that lists the agent IDs. agentplaykit play --human with no scenario MUST play the built-in demo with the person as o against scripted/minimax. A scenario MAY also use use: human directly.
  • HUM-013 A run with a human agent MUST NOT apply the default limits.max_seconds; a limit the scenario sets explicitly still applies. --runs N MUST play the N games one after another, with the same person.
  • HUM-014 A human agent MUST be refused, before anything plays, by experiments (SPEC-019), benchmark runs (SPEC-020), tournaments and model check, with the error code human.not_here and a fix that says to use play. They play many games, often in parallel, and measure agents, not people.
  • HUM-015 The run log MUST record the human like any agent: run_start.agents has use: "human", its name as the model and capabilities.human; its actions carry no reasoning. A log with a human MUST be readable by every existing tool (view, report, evaluators); no log field is required for it.

Docs

  • HUM-016 A "Play it yourself" guide MUST show playing tic-tac-toe in the terminal and chess against scripted/chess in the browser, explain what the person can and cannot see, and list the terminal commands.

4. Acceptance criteria

Requirement Test ID Notes
HUM-001..005 HUM-001..HUM-005 scripted input: competitor key, cost 0, only the request shown, refused input asked again and never logged as illegal, messages, resign as a forfeit
HUM-006..007 HUM-006, HUM-007 grid and JSON output, move list cut at 40, ? and rules; no terminal
HUM-008..011 HUM-008..HUM-011 server: turn and move endpoints, wrong origin, content type, size, step, agent and token; browser test plays tic-tac-toe to the end and checks hidden events
HUM-012..015 HUM-012..HUM-015 --human with and without an ID, the demo, no default time limit, refused in experiments, bench, tournaments and model check; reports and view read the log
HUM-016 HUM-016 the guide's sections

5. Examples

agentplaykit play --human                         # tic-tac-toe in the terminal, you are o
agentplaykit play examples/chess/vs-level-1.yaml --human white --live
tic-tac-toe: you are o. Get three in a row.

   0 | 1 | 2
   3 | x | 5
   6 | 7 | 8

legal moves: 0 1 2 3 5 6 7 8
your move (o): 4
  4 is not a legal move; legal moves: 0 1 2 3 5 6 7 8
your move (o): 0
agents:
  - {id: white, use: human, config: {name: tejas}}
  - {id: black, use: scripted/chess, config: {level: 1}}

6. Open questions

  • Two people at one keyboard (both seats human) works in the terminal; in the browser the page could ask which seat is playing. Not in this version.
  • A per-move clock for the human (chess time controls) could come later as a limit.

7. Change log

  • 2026-12-04: Initial draft.
  • 2026-12-04: Accepted by the lead maintainer.
  • 2026-12-04: HUM-006 prints a text view as text, with SPEC-028.
  • 2026-12-04: HUM-003 adds short commands for workspace tools, with SPEC-030.
  • 2026-12-04: Implemented in v0.16.0; every requirement has a test.

Changes to other specs on acceptance

  • SPEC-007: play --human [ID] (HUM-012).
  • SPEC-009, ADP-004: the built-in human agent.
  • SPEC-012, VWR-024: the live server also answers GET /<token>/turn and POST /<token>/move when a human plays (HUM-010).
  • SPEC-004: no default time limit with a human (HUM-013); the forfeit reason "resigned".
  • SPEC-019, SPEC-020: experiments and benchmarks refuse a human agent (HUM-014).
  • SPEC-023: the error codes human.no_terminal and human.not_here.