# How we secure Figma's multiplayer agent platform

> Source: <https://www.figma.com/blog/how-we-secure-figmas-multiplayer-agent-platform/>
> Published: 2026-12-02 20:11:39+00:00

**Recommendation:** Enforce agent permissions outside the sandbox in trusted infrastructure and scope each editor to a separate per-file sandbox, so prompt injection or bugs cannot reach other collaborators' credentials or MCP tools.
More in the playbook "Securing agents and AI tools": <https://wpnews.pro/playbooks/agent-security>

# How we secure Figma’s multiplayer agent platform

Sandboxing untrusted code is familiar, but giving it authority to act on behalf of a user in a shared file isn’t. Here’s how we isolate and limit agents in Figma Make and the Figma agent.

## Share How we secure Figma’s multiplayer agent platform

Illustrations by Pete Gamlen

Figma has long  In this three-part series, our security engineering team shares practical tips for deploying and operating application sandboxing techniques. First up: evaluating the many sandboxing options, and how to think about the trade-offs between them. Starting today, work with an agent that is built for Figma—directly on the canvas.[used sandboxing](https://www.figma.com/blog/server-side-sandboxing-an-introduction/) to contain untrusted workloads, but since ## Server-side sandboxing: An introduction

[introducing AI agents inside multiplayer files](https://www.figma.com/blog/the-figma-agent-is-here/), those untrusted workloads have had to do far more. Now untrusted workloads operate alongside multiple editors on a shared canvas and codebase—running generated code, calling connected tools through MCP servers, and modifying application assets on a user’s behalf.
## The Figma design agent is here

While we need to give an agent’s sandbox real authority to be useful, we also need to make sure it’s limited in what it can read, change, or disclose. Here’s how we secured Figma’s multiplayer agent sandbox platform by keeping every agent’s authority narrow, isolated, and enforced outside its sandbox. We’ll cover the credentials agents hold, what those credentials allow, where data can go, and how we keep collaborators’ authority separate.

## [Building agents for multiplayer files](#building-agents-for-multiplayer-files)

In a multiplayer file, multiple editors and their agents collaborate on the same canvas and code. In  Today, all Figma AI features and products are moving out of beta, including Figma Make—which is now available for everyone to try. Here’s how teams are using the prompt-to-app tool to dream bigger, move faster, and work better together. Figma’s AI products require tens of thousands of sandboxes to run untrusted code safely. That’s why we built Nimbus: a platform that makes sandboxes fast, reliable, and easy for Figma product teams and operators to manage.[Figma Make](https://www.figma.com/blog/figma-make-general-availability/), for example, one editor can prompt an agent to build or modify an application, and other editors in the file can open and run that shared code alongside their own connected tools. To keep each editor’s credentials and tools separate while sharing untrusted user- and agent-written code, our ## Prompt, prototype, perfect: Figma Make is now available to all users

[Nimbus](https://www.figma.com/blog/how-figma-manages-sandboxes-at-scale/) service gives every editor their own sandbox per file across our agentic products.
## How Figma manages sandboxes at scale

That leaves two threats for us to control:

1. A misaligned agent that acts against its own user’s intent through mistakes, bugs, or prompt injection—for example, uploading a file to a public file-sharing service while trying to help.
2. A malicious collaborator trying to use shared file content to reach another editor’s credentials or connected tools.

## [Controlling what an agent can do](#controlling-what-an-agent-can-do)

The first threat we focused on is agent misalignment. Since a misaligned agent can run arbitrary code inside its sandbox, we limit its capabilities and enforce authorization in trusted infrastructure outside the sandbox.

**Least privilege** is the principle of granting a user, process, or service only the minimum permissions needed to perform its intended task.

**Multi-tenancy** is an architecture where shared infrastructure serves multiple users while keeping their data and workloads isolated.

How agents use those capabilities changes how we think about least privilege. When trying to finish a task, agents will systematically probe every credential they can read and every API they can reach. Least privilege used to serve as a guardrail around deterministic application code in multi-tenant systems, but now it’s a hard requirement for agent systems, which tend to exhaust whatever capabilities they’re given.

### [Scoping agent credentials with FigJWTs](#scoping-agent-credentials-with-figjwts)

To do useful work, an agent needs to act on a user’s behalf by calling a model provider through our AI gateway or invoking a connected tool through its  Figma’s MCP server brings your design decisions into the tools where code gets written—so what gets built actually matches what was designed. Here’s what that unlocks for everyone who builds products.[Model Context Protocol (MCP)](https://www.figma.com/blog/the-tldr-on-mcp/) proxy. When we first built our agent platform, we needed to support agent harnesses that call models and tools from the same sandbox where they run code—without handing that untrusted environment the user’s Figma credentials, long-lived model provider keys, or MCP OAuth tokens.
## The TL;DR on MCP: Why context matters and how to put it to work

We achieved this with a credential we called the FigJWT, a signed JSON Web Token issued by our trusted backend services. A FigJWT works with standard authentication headers while expressing who the agent acts for, which workload it runs, and which file it can access. Figma’s AI gateway and other receiving services validate the FigJWT on every request and decide whether to authorize the action.

As we built more agent experiences, FigJWTs became the canonical way for sandbox workloads to reach our services. After a few months of organic growth, though, sandboxes with very different needs were sharing the same broadly capable token. An agent that needs LLM inference doesn’t necessarily need external tools, and two workloads calling our backend rarely need the same routes.

To tighten permissions without breaking live workflows, we instrumented consuming services to log which capabilities each FigJWT actually exercised. That telemetry showed where we could narrow access—for instance, the sandbox that builds cached Make previews only needed backend requests and never needed LLM inference, so its token could be restricted to those operations alone.

From there, we introduced token profiles and a set of granular capabilities to grant each profile. AgentControl, the service that coordinates agents, mints a FigJWT for each prompt with a profile identifying the workload’s permission set.

Example FigJWT claims (abbreviated):

```
{
  "sub": "user_123",
  "fileKey": "file_abc",
  "tokenProfile": "make-generic",
  "exp": 1767225600
}
```

Because the token is signed by the trusted issuer, code inside the sandbox can present it but can’t alter its claims or edit a local config to grant itself extra permissions. Consuming services enforce those profiles outside the sandbox using YAML policies. In its simplified form, the AI gateway maps each profile to its allowed capabilities:

```
profiles:
  make-generic:
    ai_gateway: [llm, mcp, backend]
  make-cached-preview:
    ai_gateway: [backend]
```

With this policy, cached-preview tokens cannot authorize inference or MCP requests. Access to Figma’s backend, Sinatra, is further narrowed by route policies—allowing the cached-preview profile on the thumbnail route, for example:

```
POST /api/internal/make/:file_id/thumbnail:
  - make-cached-preview
```

Tightening permissions on live workflows required a careful rollout. We ran new policies in shadow mode first, checked which real requests would’ve been blocked against each agent’s intended capabilities, and gradually enabled enforcement behind feature flags.

### [Limiting file access in the permissions system](#limiting-file-access-in-the-permissions-system)

To support Figma’s editing workflows, agents need to read and modify Figma files through our internal APIs. Because an agent acts on a user’s behalf, those permissions can span every file in the user’s plan—far broader than the single file an agent needs to access while working with a user. If a misaligned agent is steered off course by untrusted file content or makes a mistake, file scope limits its Figma API access to the active file.

We originally enforced file scope inside individual endpoints, but those checks left a gap. An endpoint could confirm that an *agent’s* token was scoped to file A, then call a helper that checked the *user’s* permission on file B. Because the user could access file B, the helper check succeeded even though file B was outside the token’s scope. We considered requiring every endpoint to declare whether it needs a file-scoped token, but that wouldn’t have closed the gap in shared helpers.

Instead, we moved file-scope enforcement to our pre-existing centralized permissions system, which uses  When our permissions system came apart at the seams, everything came to a halt. This is the story of how we fixed it while improving performance, accuracy, and developer ergonomics.[the permissions DSL we’ve written about before](https://www.figma.com/blog/how-we-rolled-out-our-own-permissions-dsl-at-figma/) to evaluate resource access. When an internal API request carries a FigJWT, we pass the token’s file scope into the permissions system alongside the user’s identity. Any downstream permission check—including checks inside helpers—automatically sees that scope and verifies that the requested file matches it.
## How we built a custom permissions DSL at Figma

For example, this policy denies all file permissions when a FigJWT is scoped to a different file:

```
class DenyAccessToOtherFiles extends DenyPolicy(PolicyResourceType.FILE) {
  applyFilter: ExpressionDef = and([
    [FigJwtClaims.fileKey, '<>', null],
    [File.key, '<>', { type: 'field', ref: FigJwtClaims.fileKey }],
  ])

  permissions = getAllPermissionsForResource(FilePermission)
}
```

If the token is scoped to file A, this policy denies access to file B, even when the user owns both. File scope only narrows a user’s existing Figma file permissions; separate controls govern what an agent can do through connected tools.

### [Controlling where data can go](#controlling-where-data-can-go)

A misaligned agent can also send data somewhere the user never intended. After ordinary requests to export assets, we saw agents try to upload files to public file-sharing services to give the user a link. Nobody was attacking the system—the agents were trying to be helpful—but this underscored why we couldn’t rely on intent alone to control egress.

We saw the same pattern with coding agents on our own engineers’ laptops. While working on routine tasks, agents searched home directories for private keys, suggested piping remote install scripts straight into a shell, and in one case, printed service credentials into a transcript while debugging. Prompt instructions telling agents to inspect scripts before running them didn’t hold. Just as our security teams needed external controls on laptops to restrict file access and flag risky commands, we needed to enforce outbound network controls outside the agent’s sandbox.

By default, Make and Figma agent sandboxes can send a request body only to hosts on their allowlist, such as package registries for pulling code dependencies. Requests to all other hosts are limited to `GET`, `HEAD`, or `OPTIONS` with no body and URLs capped at 10 KB—enough for read-only actions like web search and reading documentation, while blocking agents from uploading files to arbitrary servers.

In practice, these restrictions keep agents “on the rails,” but read requests can still leak small amounts of data per request through their URLs and headers. For Make and the Figma agent, organization admins who want stricter isolation can disable general internet access in the admin panel and only allow the hosts they choose and the small set of hosts agents need to operate.

Finally, we bound how long an agent can act. AI gateway FigJWTs expire after two hours, and sandbox lifetimes cap how long the environment itself stays alive.

## [Isolating credentials between collaborators](#isolating-credentials-between-collaborators)

Coding agents face a similar isolation problem: Collaborators work on a shared code repository, but each agent runs in its user’s own environment with access to their filesystem and credentials. In Figma, the shared state lives in a multiplayer file, and we give each user their own sandbox for that file.

The second threat we focused on is a collaborator using shared state in multiplayer files to reach another user’s authority: stealing their tokens, acting as them through connected tools, or accessing and exfiltrating their data.

It’s tempting to think a shared file should have a shared sandbox. Much of Figma’s infrastructure is multi-tenant: For example, our multiplayer service handles many users’ files in a shared, memory-safe service, and other services execute untrusted code in sandboxes such as `nsjail`. Agent sandboxes are different because they execute arbitrary code that collaborators can share and change, while also needing credentials and broader authority to act on the user’s behalf. If collaborators shared a sandbox, that code could read credentials from the shared environment and act as another user.

With separate sandboxes, agents can still collaborate on and commit changes to the same file using user-specific credentials. Every request draws from the driving user’s file permissions and credit budget, attributes file changes to that user, and stays bound by the permission and network controls above. The same separation applies to connected tools: For MCP servers that use OAuth, our AI gateway looks up the connection belonging to the user in the FigJWT, so an editor’s agent can only ever use that editor’s own OAuth connections.

Even with isolated sandboxes, editors can modify shared file contents that another editor’s sandbox will later load and run. Therefore, we need to carefully consider when a sandbox receives credentials and provide them just in time, as the user prompts the agent to act on their behalf.

In Figma Make, when a collaborator with edit access opens a file, we provision a sandbox so they can build and preview the application right away, but opening a file shouldn’t let collaborator-written code trigger LLM inference or MCP calls on their behalf. Instead of injecting those credentials when the sandbox starts, we supply them just in time with each user prompt.

### [Binding FigJWTs to their sandbox](#binding-figjwts-to-their-sandbox)

Isolating sandboxes keeps collaborators’ credentials separate, but a plaintext token inside a sandbox is still portable. Whether a FigJWT leaks through shared state or an agent mistake—or is copied out deliberately by a user—anyone holding it could authenticate to our AI gateway as that user and invoke their connected tools while the token remains valid.

Inference access has become a hot target for abuse across the industry, with copied credentials used to access models and resell access through proxy services—a pattern often called [“LLMjacking.”](https://cloud.google.com/blog/topics/threat-intelligence/llmjacking-monetizing-compromised-cloud-models) In our initial design, we exposed FigJWTs to sandboxes in an environment variable because we built on vendor infrastructure to move fast, and our sandbox providers didn’t yet support routing outbound HTTPS traffic through our own egress proxy. Over time, we noticed a pattern of new Figma accounts creating a Make file, copying FigJWTs from their own sandboxes, and reusing them outside the product against our AI gateway. Short token lifetimes and plan spend limits enforced by the AI gateway bounded each token, but rotating through new accounts and tokens still let that reuse continue.

We needed FigJWTs that only worked from the sandbox they were issued to. Since code inside the sandbox only needs to attach the token to outbound requests, it didn’t need access to the plaintext token at all.

To make that happen, we worked with our sandbox providers to route all outbound HTTPS traffic from sandboxes through our own egress proxy. Before delivering a FigJWT to a sandbox for model and tool calls, we encrypt it. The agent sends that encrypted token in its normal authentication header, and as the request leaves the sandbox, our external egress proxy decrypts it and swaps in the plaintext FigJWT before forwarding the request to the AI gateway for validation. Because the proxy runs outside the sandbox container, code inside the sandbox can’t inspect the plaintext token, tamper with the proxy, or alter its policy.

To stop copied tokens from working elsewhere, we bind each encrypted FigJWT to a single sandbox using authenticated encryption (AEAD), passing a sandbox-binding value from trusted infrastructure as associated data. Code inside the sandbox can’t change the binding value its proxy uses. If someone copies the encrypted token into another sandbox, that sandbox’s proxy has a different binding value and decryption fails, and sending it straight to the AI gateway fails too, because the ciphertext isn’t a valid FigJWT.

Once we rolled out encrypted, sandbox-bound tokens, the copied-token abuse stopped—and it hasn’t come back. Code running inside the original sandbox can still make authenticated requests, bounded by the workload, file-scope, and egress limits described earlier.

## [What we learned, and what’s next](#what-we-learned-and-what-s-next)

Building a collaborative agent platform turned out to be as much an infrastructure security effort as a product one. Enabling agents to work safely in multiplayer files required solving problems across sandboxing, credentials, permissions, and networking—and bringing infrastructure, product, and security teams together to adapt patterns we already knew worked. Network filtering we had built for Figma’s training environment shaped our agent egress controls, our capability policies mirror [IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html)-style workload permissions, and our authorization telemetry resembles [CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html)-style logging for understanding how agents exercise their authority.

Everything we’ve described was built within the constraints of a monolithic agent architecture. Today, the agent harness still runs inside the sandbox alongside generated code, which means the sandbox has to hold authority that the generated code itself doesn’t need.

###### We're hiring engineers!

Learn more about life at Figma, and [browse our open roles](https://www.figma.com/careers/).

Our next step is to give untrusted code less authority to begin with by moving the harness out of the sandbox, following what Anthropic calls [“decoupling the brain from the hands.”](https://www.anthropic.com/engineering/managed-agents) Separating the harness from the sandbox where generated code runs builds on the same principle that guided the rest of our design: keeping credentials and permission enforcement outside untrusted environments.

*Thank you to the Sandbox and Agent Platform teams and the infrastructure and security engineers across Figma who collaborated on this work. It was made possible by Adil Ahmed, Ava Dordi, Bashar Al-Rawi, Carl He, Catherine Han, Chen Luo, Dylan Visher, Emre Unal, Frannie Zlotnick, Ian VonSeggern, Jim Myers, Jordan Rodgers, Pratik Agarwal, and Reid Draper.*

Griffin is a security engineer on Figma’s Secure Frameworks team. He secures how the Figma agent and Figma Make run untrusted code, mostly by treating "ask the model nicely not to do that" as a non-starter.

Nick is a security engineer on Figma's Secure Frameworks team, where he works on AI agent sandboxing, authorization, and secure-by-default frameworks. He believes secure interface design > “make no mistakes.”

Max is a security engineer at Figma where he works on security across the board, with recent focuses on cloud and agent security.

## Create and collaborate with Figma

[Get started for free](https://www.figma.com/signup)
