Enforcing network and credential policy

Isolating untrusted code inside a container boundary keeps it away from other processes on Figma servers, but it does not stop that code from sending information out over the network. A strict network allowlist was the obvious answer and was rejected as too blunt for AI workloads, which may need to search and read arbitrary pages on the internet.

Nimbus instead treats reads and writes differently. Teams can list hosts that are fully trusted through the namespace, allowing code to both read from and send data to them. For any destination outside that list, only read requests—GET, HEAD, or OPTIONS—are permitted, and only with no request body. That covers web search and page retrieval while blocking POST, PUT, or any request carrying a body to arbitrary endpoints. The policy for a running sandbox can also be updated dynamically.

For the policy to be portable, switching providers must not change runtime behavior or security posture, so Figma regularly tests every provider against the same expectations for networking, credentials, lifecycle behavior, observability, and failure handling. Where a provider offers built-in support for inspecting and controlling outbound traffic, Nimbus installs the policy there. Elsewhere it attaches a proxy sidecar—a second container running alongside the workload—and routes outbound HTTPS traffic through it, evaluating each request. Nimbus fails closed: a request does not proceed if the sidecar cannot be attached, the policy cannot be evaluated, or a credential cannot be decrypted.

Credentials follow a similar rule. Nimbus encrypts them before they enter the sandbox and substitutes the real value only immediately before the request leaves, and only when the destination is the intended one. Code attempting to send a credential elsewhere only ever holds the encrypted value.

Because every workload is held to the same security requirements, Nimbus can prepare sandboxes ahead of demand.

Sandbox network and credential policies control internet access, allowing GET requests, blocking POST requests, and replacing encrypted credentials with real credentials.

The economics and mechanics of warm capacity

Nimbus keeps a pool of already-running, unassigned sandboxes for each namespace rather than creating one when a request arrives. Compared with provisioning a fresh sandbox per request, warm pools cut provisioning latency by 90%. Because each pool holds several minutes' worth of sandboxes, it also absorbs provider outages of that duration. Combined with automated provider selection, the warm pool raised Nimbus's provisioning availability from 99% to 99.95%.

Two charts show sandbox availability rising from about 99% to nearly 99.99% and p99 readiness latency falling from about six to two seconds after enabling a warm pool.
Before and after values for availability and latency

The trade-off is that Nimbus must maintain the right number of healthy sandboxes as demand and provider conditions shift. Four mechanisms do that work.

Single-claim semantics without a global lock

Multiple Nimbus pods serve requests for the same namespace and draw from the same pool, so two pods must never claim the same sandbox—and consumers shouldn't queue behind a global lock. Nimbus enforces this in Postgres: a claim is one transaction that selects the oldest matching sandbox, skips rows already being claimed, removes the chosen row from the pool, and returns its connection details.

Demand-driven pool sizing

A fixed target is simple but impractical at Figma's scale; set too low, capacity runs out at peak, and set too high, money goes to unused sandboxes. Nimbus instead watches the rate at which sandboxes are claimed and resizes the pool dynamically, within lower and upper bounds defined per namespace.

Provider weighting by observed outcomes

Nimbus begins with configured weights per provider and then shifts the share of work each receives according to recent provisioning results, moving traffic toward healthier providers when one slows down or returns errors. Not every failure counts: a client cancellation is not evidence of a provider outage, rate limiting imposed by Nimbus itself shouldn't trip a provider circuit breaker, and ambiguous timeouts are treated differently from confirmed failures.

Continuous health verification

Every sandbox is checked continually, including warm capacity that hasn't been assigned; a Redis-backed queue tracks when each sandbox is next due. A single failed check or ambiguous provider response doesn't destroy a potentially recoverable sandbox—Nimbus waits for repeated failures before marking it unhealthy. Each check works as follows:

  • Nimbus tries to reach sandboxd. A response means the container is healthy: it's reachable and the Nimbus runtime inside it is functioning.
  • If sandboxd doesn't respond, Nimbus falls back to the provider's view of the sandbox.
  • A provider-confirmed termination is definitive, so the sandbox is marked unhealthy. If that sandbox still sits in the warm pool, Nimbus first claims its pool entry, so no request can receive a sandbox that is being deleted.

Validating the control loop with a simulator

These pieces form a control loop: Nimbus repeatedly inspects each warm pool and acts to keep the right count of healthy sandboxes available.

Nimbus monitors sandbox demand and health, replenishes a warm pool, removes unhealthy sandboxes, and shifts capacity toward healthy providers.

To test that loop, the team built a simulator that runs the same logic against expected production conditions—wiping a pool during a deployment, aging many sandboxes out simultaneously, or degrading several providers at once—and checks whether the controller recovers. This surfaced a subtle interaction. Routing signals originally reacted mainly to provider failures, so a provisioning request that was unusually slow but eventually succeeded still counted as a success. After dispatching a batch of requests, Nimbus waited for the whole batch before rechecking the pool; a slow provider thus kept draining the pool during the wait, still looked healthy when the batch completed, and could receive an even larger follow-up batch while the deficit grew.

Both sides were fixed. Slow-but-successful requests now reduce a provider's effective weight, steering new work toward faster providers, and provisioning has moved out of the control loop—Nimbus dispatches requests and immediately resumes observing the pool instead of waiting for them to finish.

Status and next steps

Future work includes expanding namespace adoption, improving autoscaling and provider weighting, and continuing to optimize latency and cost. The team is also exploring preserving a sandbox's working directory and restoring it into another warm sandbox, even one from a different provider.

Since launching internally in November 2025, Nimbus has become shared infrastructure for multiple product surfaces. Most product teams never learn which path served their sandbox, which provider created it, or which daemon kept its processes alive—by design. The automation reduces incidents: a provider outage can be rerouted to a healthy provider automatically instead of paging an on-call engineer every time. And because capabilities live in Nimbus rather than in any one provider, the infrastructure can keep evolving without changing the interface products build against—a foundation for future AI-powered experiences at Figma that need safe, interactive compute.