Sandboxes
Where a session's files live and its commands run.
What a sandbox adds
A sandbox is the environment a session works in: a filesystem and a shell. Every session has exactly one. The sandbox you choose decides several things at once:
- The file and shell tools.
read,write, andeditact on its files, andbashruns commands in its shell. - Project instructions.
AGENTS.mdandCLAUDE.mdare found by walking up from its working directory. - Plugin tools. A plugin that works through the sandbox reaches the same files and shell.
Swap the sandbox and all of this moves with it. The agent, its tools, and your plugins stay the same.
Kinds of sandbox
| Kind | Drivers | Where the work happens |
|---|---|---|
| Local | local | Your folder and your shell. The default. |
| Virtual | memory, sqldb | An in-memory filesystem and an emulated bash. No real programs. |
| Remote | daytona, vercel | A separate machine in the cloud. |
Pick the one that fits the task. The wider the sandbox, the more the agent can read, change, run, and reach.
Choose a sandbox
Pass --sandbox-driver when you start a session:
codework run --sandbox-driver memory "Draft a README for a CLI tool"Leave the flag off when you continue a session with --session. The session keeps the sandbox it has. Editor sessions over ACP always use your local folder.
To move a session, or one of its threads, to another sandbox on a running server, use codework session relink with --sandbox-id. Without --sandbox-id, it moves back to local.
Reuse or attach
To start a new session in a sandbox CodeWork created earlier, pass --sandbox-id <id>. Its files are still there, and a stopped remote sandbox starts again.
To use a remote sandbox you created yourself, pass the ID the provider gave it, along with the driver:
codework run --sandbox-driver daytona --sandbox-provider-id <id> "Inspect the repository"CodeWork uses an attached sandbox but never stops it.
When sandboxes stop
CodeWork stops the sandboxes it creates:
codework runstops a sandbox it created when the run ends.codework servekeeps them running between sessions and stops them when the server shuts down.codework acpstops them when the editor disconnects.
Safety
CodeWork runs every tool without asking. The sandbox is the only boundary, and local has none: the agent can do
anything you can do from your shell. Plugin code runs inside CodeWork itself, so only install plugins you trust.