Skip to content

SPEC-030: Shared workspace

  • Status: Implemented
  • Milestone: v0.19 "Shared workspace"
  • Owners: lead maintainer

1. Purpose

The sandbox (SPEC-014) gives one agent a locked-down computer and checks what it leaves behind. Much of the work people want agents to do is done by more than one: a developer and a reviewer, a frontend and a backend, a writer and an editor, an analyst and a sceptic. People also want to compare agents on the same open task, and to see what each one actually built.

This spec adds a workspace world: one or more agents in one isolated computer, with a shared folder, any task, any tools the image provides, roles, messages between them, and a record of who changed what. The result is checked by commands, by a browser, by a judge, or by all three, and the files they made are kept, so a person can open them.

The person running it controls the computer: offline, online only to install, or fully online; commands that install or prepare anything before the agents start; services that run alongside them; root or not; ports to watch the work in their own browser; and a shell into the workspace during or after the run.

It MUST NOT be tied to one kind of task. These are all one scenario each, with no code: - two agents build a calculator in HTML, CSS and JavaScript, checked by clicking it in a browser; - a developer writes a command-line tool and a tester writes tests that try to break it; - an analyst turns a CSV file into a report, and an editor checks the claims against the data; - three agents fix a bug in a small project, which must pass its tests; - a writer drafts a README and a reviewer argues about it, judged by a model; - the same task given to four models, each in its own copy of the workspace, to compare them.

2. Terms

  • Workspace: the container and its shared folder /work, alive for one run.
  • Member: an agent in the workspace, with a role.
  • Turn: a member's go: one or more tool actions, ending when it passes, says it is done, or uses its actions for the turn.
  • Check: a test of the finished work: a command, a browser script, or a judge's question.
  • Output: a file from /work that is kept after the run, for people to open.

Keywords MUST, SHOULD and MAY follow RFC 2119.

3. Requirements

The world

  • WSP-001 The framework MUST ship a built-in world workspace. Its config MUST accept task (text, required: what the members must achieve), members (a map from agent ID to {role, brief}; default: every agent in the scenario, with no role), image (default python:3.12-slim), files, network, setup, start, root, ports, keep, checks, outputs, mode, turns, resources, timeouts, max_output_chars, pull and runtime, with the meanings below and, where they share a name with the sandbox, the sandbox's meanings and defaults (SBX-001). Any image that provides sh, tar, timeout and realpath MUST work, so any language or tool can be used.
  • WSP-002 The scenario MUST list one agent per member. agentplaykit check MUST report a member without an agent, an agent without a member, and a misspelled field with a "did you mean" hint, before anything runs.
  • WSP-003 With mode: together (the default) all members MUST share one workspace and one /work. With mode: apart each member MUST get its own copy of the workspace, made from the same files and setup, and work alone on the same task, so agents can be compared on an open task; the checks then run on each copy, and each member gets its own result.

The computer

  • WSP-004 network MUST choose the workspace's network: off (the default: no network at all, as in the sandbox, SBX-006), setup (the network is on while setup runs, then cut before any member starts), or on (the network stays on for setup, services and members, so agents can install packages, call APIs and browse). A run with the network on MUST say so in run_start, in the terminal before it starts and in reports, because what the agents fetch can change between runs and they can reach any site. Checks MUST run with no network unless a check sets network: on itself.
  • WSP-005 setup MUST accept a list of shell commands, run in order before any member starts, as root and with a writable system, so they can install anything the task needs (apt-get install -y nodejs, pip install pandas, cloning a project with the network on). A failing command MUST end the run with reason world_error, naming the command, its exit code and its output (SBX-015). Their output MUST be in the log.
  • WSP-006 start MUST accept a list of long-running programs to start after setup and keep running while the members work (a database, a web server, a mock API), each with a name, a run command and an optional ready command that must succeed before members start (for example curl -sf localhost:8000, retried up to timeouts.start_s, default 30 seconds). Members reach them on localhost. They MUST be stopped when the work ends, and a service that exits early MUST be reported to the members in their next observation.
  • WSP-007 Members MUST run as a non-root user with a read-only system and writable /work and /tmp (SBX-007), unless root: true, which lets members' commands run as root with a writable system (to install packages themselves). The container's other isolation MUST stay: dropped capabilities except those root: true needs, resource caps (SBX-008), nothing from the host shared (SBX-009), and removal at the end (SBX-010, unless keep, WSP-009).
  • WSP-008 ports MAY list ports of the workspace to open on the host, bound to 127.0.0.1 only, so a person can open what the members are building (a dev server) in their own browser while the run goes on. The terminal and the live page MUST print each address. Ports need network: on (cutting the network after setup closes them) and mode: together; check MUST report them otherwise.
  • WSP-009 A person MUST be able to give the workspace commands themselves: agentplaykit workspace exec RUN -- COMMAND runs one command in a running workspace and agentplaykit workspace shell RUN opens an interactive shell in it, where RUN is the run's log path or ID. What they change MUST be attributed to operator (WSP-014) and logged, so a run where a person stepped in is never mistaken for the agents' work alone. With keep: true the workspace MUST stay after the run, stopped but not removed, until agentplaykit workspace rm RUN or sandbox prune removes it, so its files and state can be inspected; agentplaykit workspace list MUST show the workspaces that exist.

Taking turns

  • WSP-010 In together mode, members MUST take turns in the order of members. A turn MUST allow up to turns.actions tool actions (default 5) and end early when the member sends pass or done. The work MUST end when every member has said done since the files last changed, when turns.rounds rounds have passed (default 10), or when a run or sandbox limit is reached (SPEC-004, SBX-008); the checks run in every case (SBX-003).
  • WSP-011 The tools MUST be the sandbox's (run, write_file, read_file, SBX-002) plus pass (end my turn) and done (I think the task is finished; another member's change undoes it). run MAY set background: true to start a long-running program, such as a web server that other members' commands can reach on localhost; background programs MUST be stopped when the work ends (SBX-011).
  • WSP-012 Members MUST be able to message each other with the message bus (SPEC-008), to everyone or to one member, with any action. chat: false turns this off, to see what members do with only the files to go on.

What each member sees

  • WSP-013 Each turn a member MUST see the task, its own role and brief, the other members' roles (not their briefs), the files in /work (names and sizes), the results of its own actions this turn, messages sent to it, and what changed since its last turn: each file created, changed or deleted, and by whom. It MUST NOT see a check before the work ends (SBX-011).

Who did what

  • WSP-014 The world MUST record every change to /work with the member that made it, including changes made by a member's commands, not only by write_file. At the end of each turn it MUST record what that turn changed (files, and lines added and removed for text files).
  • WSP-015 run_end.outcome MUST include, per member: tool actions, turns, files created and changed, lines added and removed, lines of another member's that it changed or removed, messages sent, turns passed without a change, and whether it said done.

Checking the work

  • WSP-016 checks MUST accept any number of checks, each of one kind:
  • run: a command, passed when it exits 0, as in the sandbox (SBX-011, SBX-012), optionally in another image (for example one with a test framework);
  • browser: open a file from /work (or a URL served by a serve command) in a headless browser, do steps (click, type, press a key, wait) and expect what the page shows (text of an element, a title, no errors in the console). It runs in its own isolated container with no network but the page itself, and needs no browser on the host;
  • judge: a question a judge evaluator (SPEC-010) answers from the final files and the conversation, with a score, as for any judged run. Every check MUST run after the work ends, in a fresh container that starts from the final files, with the sandbox's isolation (SBX-006 to SBX-009).
  • WSP-017 The outcome MUST be a team result in together mode: every member wins if every check that decides passes, and the score is the share of checks passed. Without any run or browser check the world MUST declare decided_by: "judge" (ENV-020). In apart mode each member is scored on its own copy, and the winners are the members with the highest score.

Keeping the results

  • WSP-018 outputs MUST list files or patterns ("*.html", "src/**") to keep: after the run they MUST be copied to a folder next to the log (runs/<run>-files/, with one folder per member in apart mode), up to outputs_max_mb (default 10), and their SHA-256 recorded in run_end. By default nothing is kept but the log. Files from inside the container MUST be copied as plain files: no links, no permissions that run, nothing outside the output folder.
  • WSP-019 The viewer MUST show, for each turn, who acted, their actions and results, and the files they changed with the changes themselves; the file tree at any turn; the messages in the chat panel; and the check results. A kept HTML output MUST be viewable in the replay page in an isolated frame that cannot reach the network, the replay page or the host, so a person can try what the agents built. Images and text outputs MUST be shown as such.

People and reports

  • WSP-020 A person MUST be able to take a member's seat (SPEC-027), with the tools typed in the terminal or chosen in the browser, to work with agents or instead of one.
  • WSP-021 Reports MUST show, for workspace runs, the check results and a contribution table from WSP-015, and behaviour metrics (SPEC-021) MUST include, per agent: whether it said done when the checks then failed, and how often it undid another member's work.

Starting one

  • WSP-022 agentplaykit new workspace NAME MUST write a commented scenario with a task, two members with roles, an example of each check kind, and outputs, which check accepts and which plays with scripted agents and no key wherever a container runtime runs.
  • WSP-023 The framework MUST ship examples in examples/workspace/, each runnable with scripted agents and no key: a calculator in HTML, CSS and JavaScript by two members, checked in a browser; a command-line tool by a developer and a tester, checked by tests; and a CSV analysed into a report by an analyst and an editor, judged. A guide MUST show how to write a task of your own, every field with its default, what each member sees, and how to read the results.

4. Acceptance criteria

Requirement Test ID Notes
WSP-001..003 WSP-001..WSP-003 config fields and defaults; any image with the tools; agent and member mismatches reported by check; one shared /work together; separate copies apart
WSP-004..009 WSP-004..WSP-009 network off, setup-only and on, with the exact runtime arguments and the warnings; setup as root and its failures; services started, ready checks, early exits; members non-root unless root: true; ports on 127.0.0.1 only; exec, shell, keep, list and rm, with operator changes attributed
WSP-010..012 WSP-010..WSP-012 turn order and actions per turn; pass and done; done undone by a later change; rounds; background programs reachable and stopped; messages, and chat: false
WSP-013 WSP-013 changes since the last turn with their authors; briefs and checks never shown
WSP-014..015 WSP-014, WSP-015 changes by commands attributed; per-member counts, including undoing another's lines
WSP-016..017 WSP-016, WSP-017 each check kind; browser steps and expectations; checks unseen by members; team and apart outcomes; judge-decided without code checks
WSP-018..019 WSP-018, WSP-019 outputs copied, capped and hashed; nothing unsafe copied; the viewer's turn, file and preview panels, with the preview isolated
WSP-020..021 WSP-020, WSP-021 a person in a seat; contribution tables and behaviour metrics in reports
WSP-022..023 WSP-022, WSP-023 the starter checks and plays; the examples run; the guide's sections

Tests that need a container runtime or a browser image skip without one, and run in CI's sandbox job (as SPEC-014's do).

5. Examples

# calculator.yaml: two agents build a calculator together
agentplay: 1
name: calculator
seed: 1
world:
  use: workspace
  config:
    task: >
      Build a calculator web page in /work: index.html, style.css and app.js, with buttons for
      the digits, + - * /, = and C. It must work by opening index.html, with no network.
    members:
      ui: {role: frontend, brief: You own index.html and style.css.}
      logic: {role: logic, brief: You own app.js. Make 2 + 3 * 4 give 14.}
    network: on                 # ports need the network on (network: setup cuts it)
    setup:
      - pip install --quiet pytest
    start:
      - {name: web, run: "python -m http.server 8000 --directory /work"}
    ports: [8000]               # watch it at http://127.0.0.1:8000 while they build
    turns: {rounds: 8, actions: 6}
    checks:
      - name: adds
        browser:
          open: index.html
          steps: [{click: "text=2"}, {click: "text=+"}, {click: "text=3"}, {click: "text=="}]
          expect: {text: {selector: "#display", equals: "5"}}
      - name: looks like a calculator
        judge: Is the page laid out like a calculator, with a display and a grid of buttons?
    outputs: ["*.html", "*.css", "*.js"]
agents:
  - {id: ui, use: ollama, config: {model: "qwen2.5-coder:7b"}}
  - {id: logic, use: anthropic, config: {model: claude-sonnet-5-5}}
evaluators:
  - {use: judge, config: {agent: {use: ollama, config: {model: "qwen2.5:7b"}}}}
# The same open task, four models, each alone: who builds the best one?
world:
  use: workspace
  config:
    mode: apart
    network: on                 # they may install whatever they want
    root: true
    task: Write a command-line todo app in Python, with tests.
    checks:
      - {name: tests pass, run: "cd /work && python -m pytest -q"}
      - {name: adds a todo, run: "cd /work && python todo.py add milk && python todo.py list | grep milk"}
    outputs: ["**/*.py"]
agents:
  - {id: a, use: anthropic, config: {model: claude-sonnet-5-5}}
  - {id: b, use: ollama, config: {model: llama3.2}}
  - {id: c, use: ollama, config: {model: "qwen2.5-coder:7b"}}
  - {id: d, use: human}
# while it runs, or afterwards with keep: true
agentplaykit workspace list
agentplaykit workspace exec runs/calculator-1.jsonl -- ls -la /work
agentplaykit workspace shell runs/calculator-1.jsonl
$ agentplaykit play calculator.yaml --live
setup: pip install --quiet pytest (network on for setup only)
started: web (ready) -> http://127.0.0.1:8000
...
finished: ui and logic win (2 of 2 checks passed) -> runs/calculator-1.jsonl
outputs -> runs/calculator-1-files/ (index.html, style.css, app.js)

member  actions  files  lines +/-  undid others  messages  said done
ui           19      2    +88/-12             3         7  yes
logic        23      1   +104/-31             0         9  yes

6. Open questions

  • An allow-list of sites: network is off, setup-only or fully on. Letting members reach only some sites (a package registry, one API) needs a proxy in front of the container, which the browser world will need too; a later spec could add network: {allow: [...]}.
  • Turns: round-robin turns are simple and fair. Members working at the same time on the same files need merging and locks; a later spec could add them.
  • Long tasks: a task of hours needs saved workspaces, so a run can stop and resume.
  • Larger teams: a lead member that assigns work to the others is a role and a brief today; structured task lists could come later.

7. Change log

  • 2026-12-04: Initial draft.
  • 2026-12-04: The computer (WSP-004..009): network off, setup-only or on; setup commands as root; services; root for members; ports; exec, shell and keep.
  • 2026-12-04: Accepted by the lead maintainer.
  • 2026-12-04: WSP-008 states that ports need network: on and mode: together; the first example uses network: on and the judge evaluator's real config.
  • 2026-12-04: Implemented in v0.19.0; every requirement has a test.

Changes to other specs on acceptance

  • SPEC-014: the sandbox's container, isolation and check machinery are shared with workspace; SBX-001 notes that the sandbox stays the one-agent form, and SBX-006 that the sandbox stays offline while a workspace may choose its network (WSP-004).
  • SPEC-011: a security note for network: on and root: true: the container is still isolated from the host and gets no keys, but agents can reach any site and change the whole container.
  • SPEC-001, ENV-018: the workspace world joins sandbox as an exception (it controls containers and writes outputs next to the log).
  • SPEC-003: run_end.outcome MAY carry members (WSP-015), checks of each kind and outputs with their hashes (WSP-018).
  • SPEC-005: check MUST report a scenario whose agents do not match a built-in world's fixed agents (today check accepts two agents for the one-agent sandbox, and only play catches it).
  • SPEC-007: agentplaykit new workspace NAME (WSP-022) and agentplaykit workspace list|exec|shell|rm (WSP-009).
  • SPEC-012: the turn, file and preview panels (WSP-019).
  • SPEC-013, SPEC-021: contribution tables and the workspace behaviour metrics (WSP-021).
  • SPEC-027: a person can take a workspace seat (WSP-020).