Vercel Sandboxes 正式 GA:安全运行不受信任代码

1 分钟阅读
2026 年 1 月 30 日
Vercel Sandboxes 现已正式可用(GA),提供一种用于安全执行不受信任代码的临时计算原语。
它让团队可以在不暴露生产系统的情况下,运行 AI Agent 生成的输出、未经验证的用户上传内容以及第三方代码。
每个 sandbox 都运行在与基础设施隔离的 Firecracker microVM 中,因此在 sandbox 内运行的代码会被阻止访问环境变量、数据库连接和云资源。
目前,v0、Blackbox AI 和 RooCode 等团队已在生产环境中使用 Sandboxes。
要快速启动一个可创建 Vercel sandbox 的简单 Node.js 应用,可使用以下代码:
import { Sandbox } from '@vercel/sandbox';const sandbox = await Sandbox.create();await sandbox.runCommand({ cmd: 'node', args: ["-e", 'console.log("Hello from Vercel Sandbox!")'], stdout: process.stdout,});await sandbox.stop();
或者也可以通过 CLI 打开交互式 shell 快速开始:
npx sandbox create --connect
你可以查阅文档快速上手,并查看其开源 SDK 和 CLI。

