Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

vercel-sandbox

БесплатноБез исполняемых скриптовНе проверен

Vercel Sandbox guidance — ephemeral Firecracker microVMs for running untrusted code safely. Supports AI agents, code generation, and experimentation. Use when…

vercelот vercel★ 356 звёзд на GitHub

Об этом скилле

CRITICAL: Always Use Correct @vercel/sandbox Documentation

Your knowledge of @vercel/sandbox may be outdated. Follow these instructions before starting on any sandbox-related tasks:

Official Resources

What changed in v2

The @vercel/sandbox@2 SDK and sandbox@3 CLI replace anonymous, ephemeral sandboxes with named, persistent sandboxes. Key differences from v1:

  • Sandboxes are identified by name (not sandboxId). Names are unique per project.
  • Sandboxes are persistent by default — when a sandbox stops, the SDK automatically snapshots it and restores the filesystem on the next resume.
  • A Session is a single running VM instance inside a sandbox. SDK calls like runCommand, writeFiles, etc. automatically resume a stopped sandbox.
  • New methods: Sandbox.getOrCreate, Sandbox.fork, sandbox.update, sandbox.delete, sandbox.listSessions, sandbox.listSnapshots, Snapshot.tree, defineSandboxProxy.
  • New params: name, persistent, tags, onResume, snapshotExpiration, keepLastSnapshots, L7 network policy matchers, forwardURL.
  • Pagination uses cursor-based iterators (async-iterable) instead of since/until.
  • Sandbox.list({ since, until }) → Sandbox.list({ cursor, namePrefix, sortBy, tags }).
  • v1 sandboxes are backfilled so the only required code change is using name instead of sandboxId.

Quick Reference

Essential imports:

// Core SDK
import {
  Sandbox,
  Session,
  Snapshot,
  Drive,
  Command,
  CommandFinished,
} from "@vercel/sandbox";
import { APIError, StreamError } from "@vercel/sandbox";

// For advanced network policy with credential brokering and L7 matchers
import type {
  NetworkPolicy,
  NetworkPolicyRule,
  NetworkTransformer,
} from "@vercel/sandbox";

// For implementing a request-forwarding proxy (forwardURL)
import { defineSandboxProxy } from "@vercel/sandbox/proxy";

// For timeouts
import ms from "ms"; // e.g., ms("5m"), ms("1h")

Default image: Sandboxes use vercel/sandbox/universal:latest, an Ubuntu-based image with Node.js 24, Bun, Python 3.14, coding agents, and common development and debugging utilities.

Creating Sandboxes

Basic Creation

import { Sandbox } from "@vercel/sandbox";

const sandbox = await Sandbox.create({
  name: "my-dev-env", // Optional, random if omitted. Unique per project.
  resources: { vcpus: 4 }, // 2048 MB RAM per vCPU
  ports: [3000], // Expose up to 15 ports
  timeout: ms("10m"), // Default: 5 minutes
  env: { NODE_ENV: "production" }, // Env vars inherited by all commands
  tags: { env: "staging", team: "infra" }, // Up to 5 key:value tags
  persistent: true, // Default: true. Auto-snapshots on stop, restores on resume.
  snapshotExpiration: ms("7d"), // Default TTL for snapshots. Use 0 for no expiration.
  region: "<region>", // Optional, defaults to iad1. Any Vercel region, e.g. sfo1, fra1, hnd1, syd1.
  failoverRegions: ["<region>"], // Optional, e.g. ["sfo1", "fra1"]. Must not include `region`.
});

console.log(sandbox.name);

Retrieve an Existing Sandbox

// Retrieve by name. The sandbox will resume automatically the next time
// you run a command.
const sandbox = await Sandbox.get({ name: "my-dev-env" });

Get-or-Create (Idempotent)

Sandbox.getOrCreate is the recommended pattern for long-lived sandboxes.

const sandbox = await Sandbox.getOrCreate({
  name: "my-workspace",
  // Runs only the first time the sandbox is created.
  onCreate: async (sbx) => {
    await sbx.writeFiles([
      { path: "README.md", content: Buffer.from("# Hello") },
    ]);
    await sbx.runCommand("npm", ["install"]);
  },
  // Runs every time the sandbox session is resumed (including after auto-resume).
  onResume: async (sbx) => {
    await sbx.runCommand({ cmd: "npm", args: ["run", "dev"], detached: true });
  },
});

Behavior:

  • If a sandbox with that name exists → resumes it and fires onResume.
  • If it does not exist → creates a fresh sandbox and fires onCreate.
  • If the sandbox exists but its snapshot expired → deletes the stale sandbox, re-creates it with the same name, and fires onCreate.

Re-warming on Resume

Use onResume to restart background services or rehydrate caches whenever a persistent sandbox's session is resumed:

const sandbox = await Sandbox.get({
  name: "my-workspace",
  onResume: async (sbx) => {
    await sbx.runCommand({ cmd: "npm", args: ["run", "dev"], detached: true });
  },
});

onResume also fires when a SDK call (e.g. runCommand, writeFiles) auto-resumes a stopped sandbox.

With Git Source

`

Полный SKILL.md на GitHub

Установить vercel-sandbox в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

.vercel.approversoverlay.yamlupstream/SKILL.md

FAQ

Что делает скилл vercel-sandbox?

Vercel Sandbox guidance — ephemeral Firecracker microVMs for running untrusted code safely. Supports AI agents, code generation, and experimentation. Use when executing user-generated or AI-generated code in isolation, or when streaming a sandbox desktop for graphical applications and computer-use agents.

Как установить скилл vercel-sandbox?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл vercel-sandbox запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить vercel-sandbox с