Sandbox persistence is now GA
TL;DR · AI Summary
Vercel announces that its sandbox feature is now generally available, supporting automatic saving and restoring of filesystem state without manual management of snapshots.
Key Takeaways
- Vercel sandboxes have persistence enabled by default, requiring no manual manage
- Sandboxes can be created, retrieved, or resumed by name, with Vercel managing se
- Persistent sandboxes consume additional storage space, while non-persistent sand
Outline
Jump quickly between sections.
Vercel announces that its sandbox feature is now generally available, supporting automatic saving and restoring of filesystem state without manual management of snapshots.
By calling `Sandbox.create()` and setting the `name` parameter, you can create a sandbox with persistence enabled by default.
You can create an ephemeral sandbox by setting `persistent: false`.
Any call on a stopped sandbox, such as `runCommand()` or `writeFiles()`, will start a new session from the most recent snapshot.
Includes new features like `Sandbox.fork()`, `Sandbox.getOrCreate()`, `Sandbox.delete()`, etc.
Upgrade to the latest version of the SDK and CLI to use default persistent sandboxes.
Mindmap
See how the topics connect at a glance.
查看大纲文本(无障碍 / 无 JS 友好)
- Vercel 沙盒持久化功能
- 创建持久化沙盒
- 代码示例
- 创建临时沙盒
- 代码示例
- 恢复持久化沙盒
- 代码示例
- 其他改进
- Sandbox.fork()
- Sandbox.getOrCreate()
- Sandbox.delete()
- 开始使用
- SDK 升级
- CLI 升级
Highlights
Key sentences worth saving and sharing.
Vercel sandboxes have persistence enabled by default, requiring no manual management of snapshots.
Sandboxes can be created, retrieved, or resumed by name, with Vercel managing session startup and shutdown automatically.
Persistent sandboxes consume additional storage space, while non-persistent sandboxes discard their filesystems at the end of a session.
2 min read
May 26, 2026
Vercel Sandboxes now automatically save and restore filesystem state between sessions. Persistence is on by default, meaning no snapshots to manage or state to track manually.
Each sandbox has a durable, customizable name that acts as a unique reference in your project. You can create, retrieve, or resume a sandbox by name. Vercel spins sessions up and down automatically, without interrupting your workflow.
[Link to heading](https://vercel.com/changelog/sandbox-persistence-is-now-ga#create-a-persistent-sandbox)Create a persistent sandbox
When you call Sandbox.create(), persistence is enabled by default:
import { Sandbox } from "@vercel/sandbox";
// Filesystem is snapshotted automatically
const sandbox = await Sandbox.create({ name: "my-sandbox" });
await sandbox.runCommand("npm", ["install"]);
await sandbox.stop();Create a sandbox with persistence on by default
Each automatic snapshot consumes snapshot storage, which is billed separately from compute. For ephemeral workloads, opt out of persistence to minimize storage costs:
import { Sandbox } from "@vercel/sandbox";
const sandbox = await Sandbox.create({ persistent: false });
// Or update an existing sandbox
await sandbox.update({ persistent: false });Create an ephemeral sandbox
To opt out of persistence with the CLI, pass --non-persistent to sandbox create. Non-persistent sandboxes discard their filesystem when the session ends.
[Link to heading](https://vercel.com/changelog/sandbox-persistence-is-now-ga#resume-a-persistent-sandbox)Resume a persistent sandbox
Resuming is automatic. Any call on a stopped sandbox, like runCommand() or writeFiles(), starts a new session from the most recent snapshot.
import { Sandbox } from "@vercel/sandbox";
const resumedSandbox = await Sandbox.get({ name: "my-sandbox" });
// Automatically resumes the sandbox
await resumedSandbox.runCommand("npm", ["test"]);Automatically resume a stopped sandbox
[Link to heading](https://vercel.com/changelog/sandbox-persistence-is-now-ga#other-improvements)Other improvements
Sandbox.fork(): Create a new sandbox from an existing oneSandbox.getOrCreate(): Idempotent retrieve-or-create for long-lived sandboxesSandbox.delete(): Permanently delete a sandbox- Richer
sandbox.stop(): Returns snapshot metadata plus active-CPU and network-transfer totals - Lifecycle hooks:
onCreateandonResumehooks forcreate,get, andgetOrCreate - Tags: Assign custom properties to sandboxes for multi-tenant tracking
[Link to heading](https://vercel.com/changelog/sandbox-persistence-is-now-ga#get-started-)Get started
Upgrade to the latest version to create persistent sandboxes by default:
pnpm install @vercel/sandbox@latest # SDKpnpm install -g sandbox@latest # CLI
Learn more about persistent sandboxes in the documentation.