Running untrusted code on Cloudflare: DWL, codemode, Containers, and Sandbox compared
· 18 min read
Cloudflare now offers four distinct ways to run code you don't fully trust — user-submitted functions, LLM-generated scripts, plugin systems, or third-party integrations. They fall into two tiers that differ by orders of magnitude in startup time, capability, and cost:
- V8 Isolate tier: Dynamic Worker Loader (DWL) and codemode — millisecond cold starts, JavaScript/Python only, 128 MB memory
- Linux VM tier: Containers and Sandbox SDK — 2-3 second cold starts, any language or binary, up to 12 GB memory
We needed to understand all four for Lumenize Nebula, where vibe-coder-provided guards and validators run in DWL isolates, and heavier workloads like TypeScript type-checking may run in Containers. This post is what we learned.
