Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Figma 15 min read Deep dive mediumAdept

Server-side sandboxing: Containers and seccomp

Containers and seccomp offer lighter-weight sandboxing than VMs, but both shift much more configuration responsibility onto the user. Container escape risk depends on the runtime implementation, kernel primitives and configuration, and a sandboxed container still needs network, credential and data isolation to limit damage if compromised. Seccomp-only sandboxes suit pure-compute programs: Figma allows only writing to already-open file descriptors, exiting, memory allocation and fetching the time. Building allowlists with strace, restructuring programs so risky syscalls happen before untrusted input is processed, and maintaining brittle allowlists are the main costs, in exchange for very low overhead.

Related posts

  • Server-side sandboxing: An introduction

    Figma easyNovice

    Server-side workloads like image processing, parsing and thumbnailing often depend on memory-unsafe C++ libraries with histories of exploitable bugs (e.g. ImageTragick), so Figma isolates them with sandboxing rather than relying solely on preventing vulnerabilities. Three primitives are compared at a high level: VMs (Firecracker via AWS Lambda), containers (nsjail using namespaces, cgroups and seccomp), and direct seccomp syscall allowlists built with libseccomp for pure-computation workloads. Seccomp offers strong security and minimal overhead but high upfront development cost, while containers are easier to ship but have more security pitfalls. A questionnaire covering environment, isolation granularity, latency, cost, development effort and operational ownership helps teams choose an approach.

  • Server-side sandboxing: Virtual machines

    Figma mediumAdept

    VM-based sandboxing rests on two boundaries: the hypervisor, which is usually strong but exposes a large attack surface, and the VM's own permissions, which must be restricted through network limits, minimal service access and short-lived credentials so a compromised job can't do harm without escaping. VMs run unmodified workloads, including third-party software, but cost more in cold starts, orchestration complexity and money than containers or seccomp. Figma runs image fetching and link-preview processing (including ImageMagick) in AWS Lambda on Firecracker, outside its production VPC and with no special privileges. The gotchas they hit were the Lambda localhost runtime API, which an SSRF could abuse, accidental IAM or VPC privileges, initial 10-second latencies, and the account-wide Lambda concurrency quota.

  • Defense in Depth: How Replit Secures Every Layer of the Vibe Coding Stack

    Replit easyNovice

    Replit layers its security controls so that no single one is the last line of defense, from development sandboxes to production hosting. Internal services follow zero-trust principles: short-lived tokens and mTLS between service pairs. Sandboxes are seccomp-hardened Linux containers that are being migrated to microVMs, and Determinate Nix keeps dependencies patched. Dev and prod databases are separated with forkable snapshots, and an append-only git sidecar preserves history. A credential-injecting sidecar proxy keeps secrets and MCP OAuth tokens out of app code. Before publish, apps are scanned with combined SAST/SCA and LLM tooling, and each customer gets its own GCP project with Cloud Run and Cloud Armor.

  • Docker Sandboxes vs. Containers: Choosing the Right Isolation for AI Agents

    Docker mediumAdept

    Containers are isolated processes sharing the host kernel. Docker Sandboxes are microVMs with their own kernel, filesystem, network and private Docker Engine, designed for autonomous coding agents that accumulate state for hours and act on untrusted instructions. A container escape or a mounted Docker socket can expose the host. In a sandbox, an escape lands in a disposable VM, and network egress and credential injection are enforced by a host-side deny-by-default proxy. The tradeoffs are hypervisor requirements, more memory and disk, and some configuration through Kits and sbxenv.yaml. The recommendation: sandbox the agent and containerize the application it works on.

  • Comparing Different Approaches to Sandboxing

    Docker easyNovice

    AI agents need strong isolation because hallucinations and prompt injection can lead to destructive commands, and the common sandboxing options trade isolation against cost. chroot isolates only the filesystem and can be escaped by root processes. systemd-nspawn adds process and network isolation but is Linux-only. Containers need privileged mode for Docker-in-Docker, which weakens isolation, and full VMs like Lima cost about 4GB RAM and 30-60s boot per agent. MicroVMs with a dedicated guest kernel and gVisor's user-space syscall interception sit in between, and Docker Sandboxes is pitched as a cross-platform microVM option with hypervisor, network and per-sandbox Docker Engine isolation.

The quest for software engineering knowledge.

Look:
Layout: