Cloudflare Computer: How to Cut AI Agent Sandboxing Costs by 80%
The default way to sandbox AI agents is to keep a full Linux container alive for every agent. Cloudflare Computer proposes a split: the Workspace Durable Object (with a SQLite VFS) owns authoritative project state; ordinary reads, searches and edits run in a Worker isolate via workspace.fs and just-bash; real Linux operations like npm install and build start a container on demand, and a post-command pull synchronizes changes back. Using a small Vite site as the test case, the author shows code for switching backend between worker-shell and container, and warns that exitCode 0 alone is not durability — sync.status must be 'complete'. A cost model projects that dropping container duty cycle from 100% to 10% reduces monthly cost from ~$36.83 to ~$7.53 (79.6%), while node_modules is deliberately kept disposable. A strong read for engineers building coding agents, sandboxes, or durable workspaces.