Best sandbox · Parallel agents
The best sandbox for running AI agents in parallel
Updated
Running several agents, or several attempts by one agent, at the same time is the fastest way to a working answer, if each one starts from the same prepared state and none can disturb the others. kosa8 forks a running sandbox into live copies with memory and processes intact, so setup is paid once; kosa8 explore runs one command per copy and keeps the fastest that succeeded, and agents can fork their own machines through MCP.
01What parallel agents need from a sandbox
Parallel work fails in two ways. Agents that share a directory or a machine trip over each other's files, ports and processes. Agents that each get a fresh machine repeat the slow setup (cloning, installing, warming a server) once per agent, and drift apart because they did not start from the same state.
What helps is a cheap copy of a finished environment: same files, same packages, same running processes, separated at the kernel.
02Checklist for choosing one
- Copies of a running machine. Not just files: memory and processes too.
- Real separation. Each copy its own kernel, disk and network rules.
- Setup paid once. Copies inherit the prepared state.
- A way to compare outcomes. Exit codes and timings per copy.
- Keep the winner, drop the rest. Automatically, so machines do not pile up.
- Agent-driven branching. Agents can fork their own sandbox as a tool.
- A clean parent. Checkpoint it so it can be rewound later.
03How kosa8 meets it
Prepare once, checkpoint, then branch. Every plan carries sandboxes, checkpoints, rewind and forks; kosa8 explore needs Pro and governance Team, and the plan sets how many forks run at once (see pricing).
kosa8 sandbox create web --memory 2048 kosa8 sandbox run web node:22 npm ci kosa8 checkpoint web --label "before experiments" kosa8 explore web --image node:22 \ --variant "npm test" \ --variant "npm test -- --experimental-vm-modules" kosa8 fork web -n 3 --prefix try
kosa8 explore forks once per --variant, runs each as sh -c in its own copy at the same time, prints each exit code and duration, and keeps the fastest successful branch (--keep-all keeps every one). kosa8 fork makes copies without running anything, for long agent sessions you drive separately. From Python:
from kosa8 import Kosa8Client client = Kosa8Client() result = client.sandbox("web").explore(["npm test", "npm test -- --babel"], image="node:22") print(result.winner, [(b.name, b.exit, b.duration_ms) for b in result.branches])
Agents connected with kosa8 mcp serve get sandbox_fork and sandbox_explore as tools, so they can branch their own machine.
04When another option fits better
- Git worktrees. For agents that only edit files,
git worktree addgives each its own working directory with nothing to install. They share one host and one set of processes. - Containers from one image. Bake the setup into an image and start a container per agent. Each starts from the image, not from a running state, and shares the host kernel.
- Hosted sandboxes for big fan-out. If you need hundreds of copies at once and have no machine that large, a hosted provider's fleet may fit; kosa8 Cloud runs up to 1,000 sandboxes at once on the Scale plan.
05FAQ
What is the difference between kosa8 fork and explore?
kosa8 fork makes N live copies and runs nothing. kosa8 explore forks once per variant, runs each variant in its own copy, reports the results and keeps the winner.
Do forks keep running processes?
Yes. A fork restores the whole machine, memory, processes and disk, from one snapshot of the parent, so a warm server or a loaded interpreter is present in every copy.
How many forks can run at once?
Each fork is a microVM with its own memory, so the machine's RAM sets the ceiling, and your plan sets how many copies run at once; past that, overage is optional.
Can agents fork themselves?
Yes, through MCP: kosa8 mcp serve exposes sandbox_fork and sandbox_explore.
06Get started
Install kosa8 on a Mac, Linux or Windows (WSL2) machine, or make an account and run the same sandboxes on kosa8 Cloud.
07Sources
- kosa8 docs: Try several ideas at once
- kosa8 docs: Fork and explore (TypeScript SDK)
- kosa8 docs: Checkpoints and rewind
- kosa8 command reference
Related
- How do I try several AI agent approaches in parallel?
- How do I run SWE-bench-style evals in parallel sandbox forks?
- How do I build an RL environment rollout loop on sandboxes?
- How do I undo what an AI coding agent did?
- All best-sandbox pages
Updated 2026-11-14