The Vercel provider runs Sandcastle agents inside Vercel Firecracker microVM sandboxes via theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/mattpocock/sandcastle/llms.txt
Use this file to discover all available pages before exploring further.
@vercel/sandbox SDK. Unlike the Docker and Podman providers, Vercel is an isolated provider: the sandbox has its own filesystem, so Sandcastle syncs your repository into the VM and extracts commits back to your host when the agent finishes.
This makes Vercel a good fit for CI pipelines, cloud-based workflows, or any situation where you cannot or prefer not to run a local container daemon.
Prerequisites
Install@vercel/sandbox as a peer dependency alongside Sandcastle:
VERCEL_TOKEN in your environment, or pass token directly to vercel(). In Vercel-hosted environments, VERCEL_OIDC_TOKEN is preferred and is read automatically by the SDK.
Import
Basic usage
Passvercel() as the sandbox option to run():
How isolated providers work
Isolated providers differ from bind-mount providers in two important ways:- Code sync in: Sandcastle copies your repository into the sandbox filesystem before the agent runs. This replaces bind-mounting, which requires direct filesystem access to the host.
- Commits out: After the agent runs, Sandcastle extracts the commits it created and applies them to the appropriate branch on your host.
head branch strategy is not available — you cannot write directly to the host working directory from inside a VM. The default branch strategy for isolated providers is merge-to-head.
You do not need to build a container image to use the Vercel provider. Each run creates a fresh ephemeral microVM.
Branch strategy
Vercel is an isolated provider, so it defaults tomerge-to-head. You can override this to use a named branch:
head strategy ({ type: "head" }) is not supported for isolated providers and will produce a compile-time type error.
Options
All options are passed tovercel():
Vercel access token. Falls back to the SDK’s default auth behavior, which reads
VERCEL_OIDC_TOKEN (recommended for Vercel-hosted environments) or VERCEL_TOKEN from the environment.The runtime for the sandbox (e.g.,
"node24", "node22", "python3.13"). Defaults to "node24".Shorthand alias for
runtime (e.g., "node-22"). When both runtime and template are set, runtime takes precedence.Resources to allocate to the sandbox. Each vCPU gets 2048 MB of memory.
Timeout in milliseconds before the sandbox auto-terminates.
Alias for
timeout, kept for discoverability. When both are set, timeout takes precedence.Array of port numbers to expose from the sandbox (up to 4).
The source of the sandbox — a git repo, tarball, or snapshot. Omit to start an empty sandbox (Sandcastle syncs your code in separately).
Network policy for the sandbox. Defaults to full internet access if not specified.
Vercel project ID to associate sandbox operations with.
Vercel team ID to associate sandbox operations with.
Environment variables to inject into the sandbox at launch time. Merged with env from the agent provider and the run-level
env option.