How the sandbox is held in
A sandbox task runs your agent and its commands on Cloudflare, on a sign-in your Mac lends it. These are the walls around it, and what each one stops.
At a glance
- A sandbox task's agent runs on mux, in a Durable Object of its own. Every command runs in a container that holds no credential from your Mac.
- Your Mac lends the agent a sign-in for a set time, an access token or an API key, and never a refresh token.
- The container reaches the internet only through a gateway that forwards reads, and lets a push reach the task's own fork alone.
- Pro runs five tasks at once and 40 hours a month, Pro+ 12 and 300, and the 3-day trial one and 3 hours in all.
A coding agent that can run commands can also run the wrong ones. It can install a package with a hostile install script, follow a prompt injected into a README, or send a file somewhere it should not go. On your own laptop, every one of those runs with your keys, your SSH agent and your network.
A muxcode sandbox task moves the agent and its commands off the laptop. Your Mac lends the agent a sign-in for a set time, and none of your credentials reach the container. This post walks through where the line sits, and the walls that hold it.
Two halves, one task
The agent runs on mux and the commands run in a container beside it; your Mac only lends a sign-in.
The task’s agent runs in a Durable Object of its own: a small Cloudflare server that keeps the task’s state beside its container. The conversation is kept there, and each step is saved before the next, so the run outlives your Mac sleeping or losing the network.
The container runs the commands. It makes no model request, holds no credential from your Mac, and has nothing of muxcode installed in it.
Your Mac attaches to the agent over a socket, lends it a sign-in, and serves what only it can: your answers to the agent’s questions, and its gate’s answer to each call. While your Mac is attached, a command passes the gate at once; a host command, an MCP call or a write to shared Mac notes is refused. The agent’s model requests leave from the Durable Object on that loan.
So the question “what can the container reach?” has a short answer. It can reach its own files, the package hosts on one list for reading only, and its own fork.
Who may start one
Three checks run before a task gets a container, and a fourth guards every call after.
a plan with the sandbox?
asked before it copies anything
key plan role
a viewer is refused
hours left? sandboxes awake?
asked at a start, a wake, and before each command
All 5 sandboxes Pro runs at once are running. Stop one to start another, or see your plan for more.
The sentence names the cap you reached and what lifts it.
Its conversation, files and commands answer them as a missing task would. The task list still shows them that it exists and how it stands.
muxcode checks your plan first, before it copies anything, so a refused start leaves nothing behind. The sandbox Worker then checks the key, the plan and the caller’s role on every request. Viewers in a workspace cannot start a sandbox: running commands in a repository takes a member who can change it.
The mux API admits the start last. It checks your hours left and the sandboxes you have awake, and past either cap it answers 402 with one sentence that names the cap and what lifts it. It is asked again when a stopped task wakes, and the meter is checked before each command.
Whose task it is
A task belongs to the member who started it. Only that member can read its conversation, attach to its agent, read its files or run its commands. Anyone else gets 404 No such task. Other members of the workspace see that it exists and how it stands, and a teammate’s key gets no further. Knowledge you mean to share goes through workspace memory instead.
A cloud task runs without permission cards: its container is thrown away with it and holds none of your credentials, so a call that would need a card is refused, not put to you. From muxcode 1.0.6, Clef does not read a cloud task’s commands, and no bypass guard runs for it: whatever a command says, the gateway refuses an upload, a publish or a push the agent runs, as The network describes. In muxcode 1.0.5, while your Mac is attached, the bypass guard, a Clef reading you can switch off in Settings → Classifier, refuses a command Clef is sure would send data out or touch credentials.
A cloud task cannot run commands on your Mac, and is offered none of the MCP servers you set up in muxcode. Push and open a pull request from the app’s commit menu; a Cowork task opens its own draft, as Bringing the work home says.
The loan
Your Mac lends the agent a sign-in for a set time, and the task can spend it but never renew it.
ends when the provider says 5 min before: the agent asks again
lent again while your Mac stays attached
An account sign-in, such as ChatGPT or Claude, lends a short-lived access token. An API key is lent as it is, for 12 hours, and lent again while your Mac stays attached. No loan carries a refresh token, so the task can spend a sign-in but never renew it.
Loans are kept in the Durable Object’s storage, never in the container, and a stop or a delete clears them.
A loan runs out. Five minutes before it does, the agent asks for a new one. With no Mac attached, a chat turn waits until one attaches and lends, and a workflow run moves on only while your Mac is attached. A Cowork issue run is the exception: since muxcode 1.0.21 it runs on mux’s included model, needs no loan, and goes on with no Mac.
mux’s included model, DeepSeek V4.1 Flash on Pro and Pro+, needs no loan. The task’s agent reaches it with the task’s own ticket, billed to the member who started the task, so no key leaves your Mac or enters the container. A Cowork task runs on that model.
The files
Each task gets a workspace of its own on a fork that belongs to that task alone. The fork starts from your checkout as it stands, uncommitted edits included, as one commit with no history behind it; files named like credentials are left out.
Every path a request names must sit under /workspace or the agent’s home directory; anything else is refused, whatever the command asks for.
The repository names are never taken from a request. The sandbox builds each one from the workspace your key belongs to, so a request cannot name another workspace’s fork, even by guessing it.
One container
Every command runs in one Linux container per task, with real toolchains: Rust, Node, Go, Python, the JDK and PHP. The container is Cloudflare’s standard-3 size: 2 virtual CPUs, 8 GiB of memory and 16 GB of disk.
The task’s Durable Object starts it when the task starts or wakes, and every command sees the same files. A file call on a stopped task wakes the container for that call alone.
Every command is stopped after 30 minutes.
The network
The container reaches the internet through one gateway. It forwards reads from the hosts on its list, and git fetches and Git LFS downloads from GitHub. It lets a push reach the task’s own fork only while the task saves its work. Every other write, such as a push elsewhere or an npm publish, is refused, and so is every other host.
- A read from a host on the list forwarded
GET registry.npmjs.org/zod download-read
GET static.crates.io/crates/serde download-read
- A git fetch or a Git LFS download from GitHub forwarded
POST github.com/acme/ledger.git/git-upload-pack git-fetch
POST github.com/acme/ledger.git/info/lfs/objects/batch lfs-download
- The task's own fork: a fetch, or a push while the task saves its work forwarded, token added
POST the fork, git-upload-pack fork-fetch
POST the fork, git-receive-pack, from a save fork-push
- Any other write: a push, a publish, a push to the fork from a command refused
POST github.com/acme/ledger.git/git-receive-pack read-only-methods
PUT registry.npmjs.org/zod read-only-methods
POST the fork, git-receive-pack, from a command fork-push
- A host that is not on the list refused
GET paste.example.com/raw host-allowlist
The list is the package registries a project’s checks need: npm and Yarn, PyPI, crates, Go, Maven and Gradle, Packagist, GitHub and the Debian mirrors, plus the Node and Rust release hosts.
Authorization and cookie headers are removed from every request. The one credential the gateway adds is a five-minute token for the task’s own fork, on a request to that fork alone. A redirect comes back to the container and goes through the same check, so an allowed host cannot bounce a request to one that is not. Every decision is logged with the host, the method and the rule that answered it.
That is the point of reads only: a hostile install script can download, but it cannot upload or publish what it finds. A read can still carry data in its address, so the list holds only package hosts and GitHub.
The environment
Only the variables the app sends for the task reach a command. HOME, PATH and the temporary directory always come from the sandbox, so a request cannot point a command at a different toolchain.
The container holds no git credential: the gateway adds the fork’s token on the way out. The tokens your Mac uses to push the start and fetch the result are scoped to one repository, last 15 minutes, and never travel in a URL.
A task’s life
A task stops when it sits idle, saves its work on the way down, and stops for good at your month’s hours.
10 min by default: closes its link, stops nothing
10 min after its last work: stops it, the agent's work waits 20 min while a process it started runs
while it runs, the work in progress is also pushed every 5 min
90%: a warning 100%: the task stops
After 10 minutes without work, or 20 while a process the task started keeps running, mux stops a task: the work in progress is pushed to the fork, the container’s disk is saved, and the next command or prompt from your Mac wakes it. The agent’s work waits for that wake.
While the app is open, muxcode closes its link to a task that has been idle for 10 minutes; set that in Settings → Sandbox → Close idle sandbox links after, where 0 turns the timer off. Closing the link stops nothing: the agent’s run goes on, and mux’s own idle stop decides when the task stops.
While a task runs, its work in progress is also pushed to the fork every five minutes. A task stopped for 14 days deletes its files and its fork.
At 90% of the month’s sandbox hours, a warning appears; at the cap, the task stops.
Bringing the work home
Nothing reaches your repository until you choose to apply it. A Cowork task is different: it opens a draft pull request, below.
The task saves its work as a checkpoint: a commit on a branch of the fork. Your Mac fetches that branch with a 15-minute read token and shows you the change.
Apply changes stages the reviewed change on your branch. If the task’s branch or your own moved since you looked, Apply refuses until you review again. Commit, push and pull request then go through your own Git, from the app’s commit menu.
A Cowork task does more on its own, with no Mac. When its run completes, mux, not the container, writes the work as one commit on the commit the task started from, with your git name and email as its author, pushes it to a branch of its own on origin, muxcode/issue-<n>-<id>, and opens a draft pull request as the mux GitHub App. The App’s token covers that one repository, can write contents and pull requests but never workflows, and never enters the container or a log. Your working tree, index and branch stay as they were. The pull request carries only the files the run’s last gate read, each matched against what the gate recorded; a file changed since, or one the gate never read, stops it. A pushed branch runs your repository’s CI with its secrets, so Cowork holds back a change to what CI runs, such as CI and build files, tool settings, manifests, lockfiles, agent guides or anything in a hidden folder, for you to push. Nothing merges on its own.
Plans
The sandbox comes with the paid plans and the trial.
| Plan | Tasks awake at once | Sandbox hours |
|---|---|---|
| Pro | 5 | 40 a month |
| Pro+ | 12 | 300 a month |
| Pro trial, 3 days | 1 | 3 in all |
| Hobby | none | none |
In a team workspace, your own plan counts. On Hobby, or with Sandbox by default off in Settings → Models, tasks run on your Mac. See the plans.
What this adds up to
The worst a sandbox task can do is make a mess of its own fork. A Cowork task can also leave a draft pull request whose branch runs your CI, as Bringing the work home says.
- Its commands never see your sign-ins: the loan sits in the Durable Object’s storage, and the container, where every command runs, holds no credential at all.
- It cannot push anywhere but its own fork, or publish, because the gateway refuses writes. A Cowork task’s branch on origin comes from mux, through the mux GitHub App, after the run’s last gate; the container never holds the App’s token.
- It cannot touch another workspace, because every name it uses is built from yours.
- It cannot open a teammate’s task, because each task checks its owner on every call.
Read how muxcode works for the rest of the app.
The working where each number comes from
- Container size:
standard-3, 2 vCPU, 8 GiB memory, 16 GB disk, from the comment inapps/sandbox/wrangler.jsoncandinstanceTypeinalchemy.run.ts, read 7 October 2026. - 30-minute command cap:
EXEC_CEILING_MSinapps/sandbox/src/exec-stream.ts, read 7 October 2026. - No loan for the included model:
muxProviderinapps/sandbox/src/agent/models.ts,docs/markdown/billing.mdand muxcode’sCHANGELOG/1.079.md(lend_bynever lends it), read 28 October 2026. - Five-minute loan margin:
LEASE_MARGIN_MSinapps/sandbox/src/agent/leases.ts. 12-hour API key term:KEY_TERM_MSin muxcode’ssrc-tauri/src/harness/pi/login.ts. Every muxcode file named here was read in its source on 7 October 2026. - Five-minute fork token:
FORK_TOKEN_SECONDSinapps/sandbox/src/egress.ts, read 7 October 2026. Rule names and the host list:src/egress.tsandsrc/hosts.ts. The example repository paths in the gateway figure are made up. - 15-minute repository tokens for your Mac, the five-minute work-in-progress push and the 14-day deletion:
docs/markdown/sandbox.mdandapps/sandbox/PROTOCOL.md, 7 October 2026. The idle stop, 10 minutes after the last work or 20 while a Linux process runs on, and that it leaves the agent’s work waiting:SANDBOX_IDLE_STOP_MS,SANDBOX_IDLE_CEILING_MSandidleStepinapps/sandbox/src/lifecycle.ts, anddocs/markdown/sandbox.md, read 28 October 2026. - muxcode’s idle timer, 10 minutes by default and 0 to turn it off:
idle_stop_minutesin muxcode’ssrc-tauri/src/settings.rs. Since muxcode 1.0.9 it closes the Mac’s link and sends no stop (idle_actioninsrc-tauri/src/session/sandbox.rs), read at muxcode 1.0.19 on 28 October 2026. The setting’s name, Close idle sandbox links after since muxcode 1.0.20:SandboxSettings.tsxandsettingsCatalog.tsat commite8e813b2(muxcode 1.0.22), read 4 November 2026. - 402 and its sentence:
apps/api/src/billing/caps.ts; the quoted sentence is Pro’s for sandboxes awake, read again 28 October 2026. 404 No such task:apps/sandbox/src/index.ts, read 7 October 2026. The check on a wake and before each command:docs/markdown/billing.mdandsandbox.md. - Plan check before the copy:
require_paidin muxcode’ssrc-tauri/src/session.rs. - 90% warning:
METER_WARN_ATinapps/api/src/routes/sandboxes.ts, read 7 October 2026. - Apply refusals:
src-tauri/src/sandbox/cloud.rsandcloud/checkout.rsin muxcode. The gate’s answers for a cloud task:src-tauri/src/sandbox/agent.rs. - Plans:
PLAN_LIMITSandTRIAL_LIMITSinpackages/types/src/index.ts(Pro 5 and 40, Pro+ 12 and 300, trial 1 and 3, Hobby 0), read again 28 October 2026, andTRIAL_DURATION_MS, 72 hours, read 7 October 2026. On 7 October they read Pro 2 and 30, Pro+ 8 and 300. - Cowork’s commit, push and draft pull request: from muxcode 1.0.21, the mux GitHub App’s route and its per-repository tokens (
apps/api/src/github/app.ts) and muxcode’sautomation_pathinsrc-tauri/src/sandbox/issue/rules.rs, with muxcode’srelease/NOTES-1.0.21.md, read 2 November 2026. Before 1.0.21:openandsquashin muxcode’ssrc-tauri/src/sandbox/issue.rs, read 28 October 2026 at muxcode 1.0.19.