How we built a secure, performant, multi-tenant cloud platform to run untrusted code
Deno Deploy runs untrusted JavaScript and TypeScript in pools of V8 isolates inside VMs called runners, split into a control plane for deployments and a data plane of edge regions. At deploy time, code is transpiled with swc, all dependencies are vendored and ordered breadth-first so they can be streamed into V8, and the bundle is replicated to regional buckets. Postgres stays off the critical path, and edge proxies keep an in-memory domain-to-deployment table. Requests arrive via Anycast, and the proxy picks a runner using heuristics over CPU and memory load. Isolation combines namespaces, cgroups, seccomp and a watchdog process, built against a five-point tenant threat model.
Related posts
- The Anatomy of an Isolate Cloud
Deno easyNoviceDeno Deploy runs untrusted user JavaScript in V8 isolates rather than VMs or containers, trading heavier isolation for much lower overhead and faster deploys. Traffic reaches 30+ edge locations via anycast, where a Rust runner process acts as an isolate hypervisor: it maps the Host/:authority header to a deployment, picks a TLS certificate via SNI, starts deployment processes on demand and terminates idle ones. Security is layered across a restricted custom Deno build, V8 sandboxing, one process per deployment, resource quotas enforced by the runner, separated control- and data-plane networks, seccomp syscall filtering, and Rust's memory safety.
- How security and tenant isolation allows Deno Subhosting to run untrusted code securely
Deno easyNoviceDeno Deploy and Deno Subhosting isolate untrusted tenant code using layered defenses mapped to a five-point threat model: per-deployment V8 isolates, a virtualized filesystem, and separate VPCs for ingress and outbound traffic. Each isolate runs in its own process on a restricted Deno runtime, inside Linux namespaces, with seccomp filters to detect unusual syscalls. For resource fairness, cgroups cap CPU, memory and I/O, and an internal WatchDog service kills isolates that exceed memory limits, block the event loop, or show abusive patterns such as crypto mining. The mechanisms are described at a high level, without configuration or implementation specifics.
- How immutable scripts in Deno allow Windmill.dev (YC S22) to build production-grade ops
Deno easyNoviceWindmill.dev, an open-source platform for building internal workflows and UIs from scripts, runs TypeScript on Deno because inline, version-pinned imports make each script a self-contained, reproducible file that is hashed immutably and stored in Postgres. Deno's opt-in permission model isolates untrusted code in a multi-tenant setting with less overhead than the NSJail sandboxing used for other languages. Dependency caching synced across workers via S3 gives roughly 15ms cold starts and about 30ms end-to-end runs for lightweight scripts, and the team plans to run Deno in-process to approach Lambda-level performance.
- Introducing Deno Sandbox
Deno mediumAdeptDeno Sandbox runs untrusted, often LLM-generated code in lightweight Linux microVMs on Deno Deploy that boot in under a second and are created via JavaScript or Python SDKs. Secrets never enter the VM: code sees a placeholder that an outbound proxy swaps for the real key only on requests to approved hosts, and egress allowlists block unlisted hosts at the VM boundary. Sandboxes can deploy straight to Deno Deploy with sandbox.deploy(), persist state with volumes and snapshots, and run with 2 vCPUs, 768 MB to 4 GB of memory and a 30-minute maximum lifetime. A later update says the product is no longer offered to new customers after Deno joined Cloudflare.
- Supabase Edge Runtime: Self-hosted Deno Functions
Supabase mediumAdeptSupabase Edge Runtime is an MIT-licensed, Rust-based web server built on deno_core that self-hosts Deno Edge Functions (TypeScript, JavaScript, WASM) without code changes. A hyper HTTP server forwards requests to a Main Worker V8 isolate, which can create sandboxed User Worker isolates with restricted APIs and configurable memory (default 150 MB) and wall-clock (default 60s) limits. It also powers `supabase functions serve` for serving all functions locally with hot reload and Deno Deploy API parity, and a Fly.io walkthrough shows how to deploy it. Planned uses include replacing Kong as an API gateway, scheduled functions, and custom platform globals.