7.0
热点
AI SCORE
编程提效2026-07-30 12:00
Vercel Sandbox支持单容器运行多个隔离Agent
Vercel Blog#Agent#Vercel
Editor brief · 编辑速览
Sandbox SDK新增多Linux用户隔离机制,允许多个Agent在同一沙箱中并行运行,简化多Agent系统开发。
Sandbox SDK新增多Linux用户隔离机制,允许多个Agent在同一沙箱中并行运行,简化多Agent系统开发。
@vercel/sandbox SDK 现在支持多个 Linux 用户和组,所以你可以在单个 Sandbox 中并行运行多个 agent。
每个 agent 作为其自己的用户运行,具有私有主目录。当需要协作时,组可以打开共享工作区。这使构建多 agent 系统变得更容易。
为每个 agent 调用 createUser;其命令和文件操作以该用户身份运行,用户无法读取、写入或列出彼此的文件。要设置共享目录,调用 createGroup 并将用户添加到其中。
1const sandbox = await Sandbox.create();2
3const coder = await sandbox.createUser("coder");4const reviewer = await sandbox.createUser("reviewer");5
6// Each user is isolated to its own home directory7const cmd = await coder.runCommand("whoami");8console.log(await cmd.output());9
10// Share work through a group directory11await sandbox.createGroup("project");12await coder.addToGroup("project");13await reviewer.addToGroup("project");
在单个 Sandbox 中运行多个隔离的 agent。
在 Vercel Sandbox 文档中了解更多信息。