Cloudflare has native container support viaDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/withastro/flue/llms.txt
Use this file to discover all available pages before exploring further.
@cloudflare/sandbox. When you deploy Flue to Cloudflare Workers, each agent session can get its own isolated Linux container with a persistent filesystem, full shell access, and tools like git, Node.js, and curl pre-installed.
How it differs from other connectors
Most Flue connectors install a.flue/connectors/<name>.ts adapter file. The Cloudflare connector is different: Flue’s runtime already includes the wiring for @cloudflare/sandbox on the Cloudflare target. There’s no factory file to install. You declare the sandbox in wrangler.jsonc, add a Dockerfile, and call getSandbox() directly in your agent.
Setup
Add bindings to wrangler.jsonc
Declare the Durable Object binding, migration, and container image at your project root (alongside Any DO binding whose
package.json):class_name ends with Sandbox is automatically wired by Flue. You can name it anything — Sandbox, PyBoxSandbox, SupportSandbox — as long as the name ends in Sandbox.Add a Dockerfile
At the project root (the path your Pin the tag to match the
containers[].image points to):@cloudflare/sandbox version in your package.json — they’re versioned together. Add your own RUN steps to install extra tools:Multiple sandbox images
Different agents can use different container images. Declare a separate binding for each — everyclass_name must end in Sandbox:
Secure egress with outbound Workers
When an agent runs inside a container, it may need to call external APIs — GitHub, npm, internal services. Instead of injecting secrets as container environment variables (where the LLM could see them), use Cloudflare’s outbound Workers to intercept outgoing requests and inject secrets at the proxy layer:R2-backed virtual sandbox
If your agent only needs a searchable file store rather than a full Linux container, you can usegetVirtualSandbox from @flue/runtime/cloudflare to mount an R2 bucket as the agent’s filesystem. No container, no Dockerfile — just fast, cheap, persistent storage:
wrangler.jsonc:
Build and deploy
When to use the Cloudflare container sandbox
The Cloudflare container sandbox is the right choice when:- Your agents already deploy to Cloudflare Workers
- You need a full Linux environment close to your Workers edge logic
- You want session-persistent containers tied to a Durable Object ID
- You want zero-trust secret injection with outbound Workers
--target node or need a provider-managed sandbox that works across targets, see Daytona or E2B.