In v0, each VM-backed chat runs in a Vercel Sandbox. What does that sandbox isolate, and what can code running inside it still reach?
answer
- per chat, per owner, not production
- outbound network: open by default
- the project's Development variables
- every terminal process sees them
- permission modes govern commands only
basics
~20 sA v0 sandbox isolates each chat from other chats, other users and production. Inside it, code can reach the internet (Sandbox Network Policy defaults to allow-all) and the project's Development environment variables, which any terminal process can read.
solid answer
~50 sEach VM-backed chat gets its own **Vercel Sandbox**: files, environment variables and processes never cross between chats, the sandbox belongs to the chat's owner, and it is never the machine that serves the deployed app. Its filesystem persists between sessions. Inside it, though, the app, v0's `Bash` tool, the **Terminal** in the console and any pre-installed agent share the same access: outbound network under a **Sandbox Network Policy** that defaults to `allow-all` until a team owner changes it, and the connected Vercel project's **Development** environment variables (sensitive ones are not available to previews). v0's terminal **permission modes** — Ask, Auto (the default) and Full — decide which commands v0 runs without confirmation, but Full skips every `allow`, `ask` and `deny` rule, team rules included, and the built-in `rm -rf` deny pattern is a guard, not a boundary.
code
json · 5 lines{
"allow": ["Bash(pnpm test:*)", "Bash(pnpm lint:*)"],
"ask": ["Bash(git push:*)"],
"deny": ["Bash(curl:*)"]
}go deeper
Remember the three isolation boundaries — per chat, per owner, separate from production — and that the default network policy is allow-all.
Explain the lifecycle (persistent filesystem, 30-minute start, 24-hour cap) and the three permission modes, with Auto as the default and how rule specificity decides.
Name what the sandbox does not protect: the chat's own Development variables from any process in it, outbound traffic, and every rule once someone picks Full Permissions.
Set team policy: narrow the Sandbox Network Policy, keep production secrets out of Development variables, write team deny rules knowing Full mode bypasses them.
## What the sandbox is Since the v0 update the FAQ dates **February 4, 2026**, VM-backed chats run in a **Vercel Sandbox**: a lightweight virtual machine with a full Node.js environment, which replaced the older browser-based preview that could not run server code, API routes or real database connections. The sandbox holds the project files, runs the dev server behind the **Preview** tab, and executes commands — v0's own `Bash` tool and anything typed in the console's **Terminal** tab (the console also has a **Logs** tab for dev-server output). ## What it isolates | Boundary | What the sandbox page promises | |---|---| | **Per chat** | Each VM-backed chat has its own sandbox; files, env vars and running processes never cross between chats | | **Per user or team** | The sandbox belongs to the chat's owner; others reach it only if the chat is shared | | **From production** | Never the same machine as the deployed app; deployments run on separate Vercel infrastructure with their own environment variables | Lifecycle details matter when someone says "the sandbox is throwaway": - the **filesystem persists** between sessions for the same chat; - a pooled sandbox starts with a **30-minute** lifetime; while it is active, status checks and the agent's heartbeat add 10 minutes whenever five or fewer remain, up to an absolute cap of **24 hours** from creation; - an expired sandbox is recreated on your next visit; a new chat gets a new sandbox. ## What code inside it can still reach - **The network.** **Sandbox Network Policy** controls outbound hosts, and its default is `allow-all`. Team owners configure it from team settings. - **Environment variables.** Variables from the connected Vercel project — including those a database integration added — are available to the app and to every agent tool in the sandbox. The preview reads only the **Development** environment, and **sensitive** environment variables are not accessible to previews. - **Every process alike.** The pre-installed-agents page says an agent launched from the terminal has the same access as any process there: the codebase, files from the session, and the variables in the project's **Vars** panel. It advises treating the sandbox like a local development machine. ## Terminal permission modes v0's `Bash` tool runs inside the sandbox under one of three modes, set from the **+** menu in the composer and persisting across new chats: 1. **Ask Permissions** — `allow` rules run, `deny` rules block, everything marked `ask` or unmatched needs confirmation. 2. **Auto Permissions** (default) — the same rules, but for an unmatched command v0 decides whether to ask. 3. **Full Permissions** — skips permission evaluation entirely, including built-in, **team** and user rules. Rules live in **Settings → Agent Permissions**, in a **User** tab and a **Team** tab that only team owners edit, as `allow` / `ask` / `deny` arrays of `Bash(<pattern>)`. The most specific pattern wins regardless of scope, equally specific conflicts resolve to `ask`, and a compound command takes its most restrictive part. Two limits to state in a review: - the built-in deny pattern for commands starting with `rm -rf` is "a guard, not a complete sandbox safety boundary" — equivalent flag forms and some shell wrappers may slip past it; - a rule such as `Bash(curl:*)` governs commands v0 runs, not what the app's own code fetches over the network. ## Reading the boundary correctly The sandbox protects **other chats, other users and production** from what happens in a chat. It does not protect the chat's own secrets from code running in it, and it does not restrict the network unless a team owner narrows the policy. Why agent sandboxes and approval gates exist in general is a separate, product-neutral subject. ## Pre-installed agents in the same box v0 sandboxes ship with pre-installed coding agents started from the terminal. Their traffic goes through the **Vercel AI Gateway** by default, so model restrictions, the approved-subprocessor list and metering follow the team's configuration. They are **disabled by default for Enterprise** accounts until an admin opts in, and available by default otherwise. Bypassing the provided CLI wrapper, pointing an agent at personal API keys or installing other agents is outside the supported configuration, and Vercel has no visibility into that traffic — a point for any admin deciding whether to enable terminal agents at all.
- A team owner adds `Bash(curl:*)` to the Team deny list in v0. When does it not apply?When a member switches to **Full Permissions**, which skips built-in, team and user rules alike. It also covers only commands v0's `Bash` tool runs — app code fetching a URL is governed by the **Sandbox Network Policy**, whose default is `allow-all`. In Ask and Auto, a more specific `allow` pattern could still outrank it.
- Can a v0 chat's preview read the project's production database credentials?The preview reads only the connected Vercel project's **Development** environment variables, and variables marked sensitive are not accessible to previews. Whatever is in the Development environment, though, is readable by every process in the sandbox, including terminal commands and pre-installed agents.
- The sandbox blocks outbound network access by default
- The preview runs on the same machine as the production deployment
- Team deny rules still apply when a member chooses Full Permissions
- The built-in rm -rf rule makes destructive commands impossible
- A sandbox is wiped after every session
- Secrets in the Vars panel are hidden from terminal processes
Assumes v0's docs as fetched on 2026-10-04; Vercel Sandbox replaced the browser-based preview in the v0 update the FAQ dates February 4, 2026.