vercel-sandbox
하는 일
임시 Vercel 클라우드 머신 안에서 agent-browser와 Chrome을 실행하는 방법을 보여 줍니다. Vercel에 배포된 앱에 브라우저 기능을 넣으려는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓Vercel 앱이 웹 페이지의 스크린샷을 찍어야 할 때.
- ✓격리된 임시 환경에서 실행되는 브라우저가 필요할 때.
- ✓여러 명령에 걸쳐 살아 있어야 하는 브라우저 세션이 필요한 경우.
스킬 링크
https://github.com/vercel-labs/agent-browser/blob/main/skill-data/vercel-sandbox/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“사용자가 입력한 URL의 스크린샷을 찍는 기능을 제 Next.js 앱에 추가해 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
앱은 작은 샌드박스 머신을 시작하고, Chromium에 필요한 것을 설치한 뒤, 그곳에서 브라우저 명령을 실행하고 나중에 머신을 종료합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Browser Automation with Vercel Sandbox
Run agent-browser + headless Chrome inside ephemeral Vercel Sandbox microVMs. A Linux VM spins up on demand, executes browser commands, and shuts down. Works with any Vercel-deployed framework (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.).
Dependencies
pnpm add @agent-browser/sandbox @vercel/sandbox
The sandbox VM needs system dependencies for Chromium plus agent-browser itself. The @agent-browser/sandbox helpers install them by default for fresh sandboxes and use sandbox snapshots (below) for sub-second startup. Pass installSystemDependencies: false only when the sandbox image already provides Chromium's required libraries.
Core Pattern
import {
createAgentBrowserSnapshot,
runAgentBrowserCommand,
withAgentBrowserSandbox,
type VercelSandboxSession,
} from "@agent-browser/sandbox/vercel";
async function withBrowser<T>(
fn: (sandbox: VercelSandboxSession) => Promise<T>,
): Promise<T> {
return withAgentBrowserSandbox(fn);
}
Screenshot
The screenshot --json command saves to a file and returns the path. Read the file back as base64:
export async function screenshotUrl(url: string) {
return withBrowser(async (sandbox) => {
await runAgentBrowserCommand(sandbox, ["open", url]);
const titleResult = await runAgentBrowserCommand<{ data?: { title?: string } }>(sandbox, [
"get", "title",
]);
const title = titleResult.json?.data?.title || url;
const ssResult = await runAgentBrowserCommand<{ data?: { path?: string } }>(sandbox, [
"screenshot",
]);
const ssPath = ssResult.json?.data?.path;
if (!ssPath) throw new Error("Screenshot did not return a file path.");
const b64Result = await sandbox.runCommand("base64", ["-w", "0", ssPath]);
const screenshot = (await b64Result.stdout()).trim();
await runAgentBrowserCommand(sandbox, ["close"], { json: false });
return { title, screenshot };
});
}
Accessibility Snapshot
export async function snapshotUrl(url: string) {
return withBrowser(async (sandbox) => {
await runAgentBrowserCommand(sandbox, ["open", url]);
const titleResult = await runAgentBrowserCommand<{ data?: { title?: string } }>(sandbox, [
"get", "title",
]);
const title = titleResult.json?.data?.title || url;
const snapResult = await runAgentBrowserCommand(sandbox, ["snapshot", "-i", "-c"], {
json: false,
});
await runAgentBrowserCommand(sandbox, ["close"], { json: false });
return { title, snapshot: snapResult.stdout };
});
}
Multi-Step Workflows
The sandbox persists between commands, so you can run full automation sequences:
export async function fillAndSubmitForm(
url: string,
data: Record<string, string>,
postSubmitWaitArgs: string[],
) {
return withBrowser(async (sandbox) => {
await runAgentBrowserCommand(sandbox, ["open", url]);
const snapResult = await runAgentBrowserCommand(sandbox, ["snapshot", "-i"], {
json: false,
});
const snapshot = snapResult.stdout;
// Parse snapshot to find element refs...
for (const [ref, value] of Object.entries(data)) {
await runAgentBrowserCommand(sandbox, ["fill", ref, value]);
}
await runAgentBrowserCommand(sandbox, ["click", "@e5"]);
// Pass an app-specific wait, such as ["--url", "**/checkout/complete"],
// ["--text", "Thanks"], or ["#confirmation"].
await runAgentBrowserCommand(sandbox, ["wait", ...postSubmitWaitArgs]);
const ssResult = await runAgentBrowserCommand<{ data?: { path?: string } }>(sandbox, [
"screenshot",
]);
const ssPath = ssResult.json?.data?.path;
if (!ssPath) throw new Error("Screenshot did not return a file path.");
const b64Result = await sandbox.runCommand("base64", ["-w", "0", ssPath]);
const screenshot = (await b64Result.stdout()).trim();
await runAgentBrowserCommand(sandbox, ["close"], { json: false });
return { screenshot };
});
}
MCP Server over stdin
For many MCP tool calls in one sandbox, startAgentBrowserMcp keeps one agent-browser mcp process running and sends requests over the sandbox command's stdin. It requires @vercel/sandbox 3.7 or later, and timeout (milliseconds) applies to each request and to close():
import { startAgentBrowserMcp, withAgentBrowserSandbox } from "@agent-browser/sandbox/vercel";
const snapshot = await withAgentBrowserSandbox(async (sandbox) => {
co
자주 묻는 질문
어떤 프레임워크와 함께 작동하나요?
스킬에 따르면 Next.js, SvelteKit, Nuxt, Remix, Astro 등 Vercel에 배포되는 모든 프레임워크와 작동합니다.
무엇을 설치해야 하나요?
프로젝트에 추가할 패키지 두 개가 나와 있습니다. agent-browser 샌드박스 도우미와 Vercel Sandbox 패키지입니다.
시작을 더 빠르게 할 수 있나요?
스킬은 시작을 빠르게 하는 샌드박스 스냅샷을 언급합니다.
상세 정보
작성자의 원본 설명
Run agent-browser + Chrome inside Vercel Sandbox microVMs for browser automation from any Vercel-deployed app. Use when the user needs browser automation in a Vercel app (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.), wants to run headless Chrome without binary size limits, needs persistent browser sessions across commands, or wants ephemeral isolated browser environments. Triggers include "Vercel Sandbox browser", "microVM Chrome", "agent-browser in sandbox", "browser automation on Vercel", or any task requiring Chrome in a Vercel Sandbox.
인기도
- GitHub 스타
- 45k
- 순위
- #6362
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
technical-writer
45k가이드, API 참조, 문제 해결 페이지 같은 개발자 문서를 명확한 구조와 정확한 예제로 쓰고 편집하도록 가르칩니다.
agentcore
45kAWS 로그인으로 AgentCore 클라우드 브라우저에서 브라우저 자동화를 실행하도록 돕습니다.
core
45k스냅샷과 요소 참조로 웹 브라우저를 제어해, 페이지를 열고 클릭하고 양식을 채우고 내용을 읽도록 에이전트를 가르칩니다.
derive-client
45k웹사이트의 네트워크 트래픽을 한 번 기록한 뒤, 브라우저 없이 내부 API를 호출하는 독립형 클라이언트를 만들도록 가르칩니다.
비슷한 스킬
openclaw-update
394k에이전트가 설치 방식에 맞는 방법을 골라 기존 OpenClaw Gateway를 업데이트하고, 세션이 계속 작동하도록 돕습니다.
diagnose-gateway
394k에이전트가 설정, 채널, 포트를 확인해 OpenClaw Gateway가 왜 실패하는지 찾되, 아무것도 바꾸지 않도록 돕습니다.
crabbox-apps
394k에이전트가 임시 클라우드 머신에서 앱을 열고 실행한 뒤, 그 화면을 채팅의 측면 패널에 보여 주도록 돕습니다.