moca · harness + sandbox · v0.11.0

Moca: the harness and the sandbox

moca runs AI coding agents safely and at scale. It has two capabilities. The harness runs the agent itself, in long-lived sessions on a warm worker pool. The sandbox service runs the agent's commands while the agent stays on your laptop. Both use the same relay, the same sandbox workers and one control plane. Press Next for one step. Press Prev to go back one step. The wire box below the stage shows the messages of the current step. The messages stay until you move on. Use the tabs to change the flow.

‹ moca docs · written pages: Brain and hands, Sessions and turns, Sandboxes and tiers

request / data control / token lifecycle / lease end result

The decision

Keep the agent's commands away from the agent's process. The two capabilities differ only in where the agent runs. The harness keeps the agent in a warm worker. The sandbox service keeps it on your laptop.

This is the positioning on the moca overview. Use one capability alone, or both together on one control plane with the combined profile.

Which one do I want?

  • Sandbox service: a coding agent on your laptop edits and tests code without running anything on the laptop; get a reviewable patch back.
  • Harness: run many agent sessions on a few warm processes, resumable after a restart; dispatch units of work over HTTP.
  • Both: with SH_ROUTE_PROFILE=combined, one deployment serves sessions and sandboxes from one template store.

What the harness keeps

session
append-only log in Redis, resumable by sessionId
turn
one exchange; POST /v1/turn (alias /turn)
lease
short-lived Redis entry, heartbeat, 60 s expiry
affinity
a session stays on its sandbox, so the workspace is still there
worker
one process serves many sessions, up to SH_TURNS_PER_WORKER

The shared parts

  • One relay. Sandbox workers dial out and hold an Attach stream, so no sandbox needs an inbound route.
  • Two tiers for both capabilities: a container, or a fresh Firecracker microVM per Exec.
  • One control plane. SH_ROUTE_PROFILE picks harness, sandbox or combined.

Two different sandboxes

A harness session runs its tools in the harness's own sandbox. A sandbox-service workspace is a separate thing. mocactl sbx commands neither see nor manage a harness session's sandbox.

Not a fit today: a sandbox service on your laptop (it needs OpenShift and a KVM host), scheduled dispatch (no P6 design yet, #536), and a hosted service (moca is self-hosted only).