Skip to content
Français

createVercelSandboxProvider

import { createVercelSandboxProvider } from "@elie-laloum/outpost/providers/vercel";

Create a remote provider on Vercel Sandbox; the optional @vercel/sandbox SDK loads on acquire. Each acquire creates a sandbox, Outpost uploads the repository and synchronizes changes back, and release stops the sandbox.

Complete example and detailed rules.

  • optionsOptional
    VercelOptions | undefined
    Vercel sandbox creation, workspace root, egress, environment and output retention settings.
  • options.egressOptional
    EgressPolicy | undefined
    Portable policy translated to Vercel’s firewall when the provider is created: domains match the TLS server name, allowCidrs grant IP access on their own and denyCidrs take priority. Setting create.networkPolicy too fails with code configuration.
  • options.createOptional
    NonNullable<(WithPrivate<((BaseCreateSandboxParams & ({ runtime?: RUNTIMES | (string & {}); image?: never; } | { runtime?: never; image?: (string & {}) | "vercel/sandbox/universal" | "vercel/sandbox/node:22" | "vercel/sandbox/node:24" | "vercel/sandbox/node:26" | "vercel/sandbox/python:3.14" | "vercel/sandbox/ubuntu" | "vercel/sandbox/arch"; })) | (Omit<BaseCreateSandboxParams, "source"> & { source: { type: "snapshot"; snapshotId: string; }; runtime?: never; image?: never; })) | (((BaseCreateSandboxParams & ({ runtime?: RUNTIMES | (string & {}); image?: never; } | { runtime?: never; image?: (string & {}) | "vercel/sandbox/universal" | "vercel/sandbox/node:22" | "vercel/sandbox/node:24" | "vercel/sandbox/node:26" | "vercel/sandbox/python:3.14" | "vercel/sandbox/ubuntu" | "vercel/sandbox/arch"; })) | (Omit<BaseCreateSandboxParams, "source"> & { source: { type: "snapshot"; snapshotId: string; }; runtime?: never; image?: never; })) & Credentials)> & WithFetchOptions) | undefined> | undefined
    Options passed to Sandbox.create() from @vercel/sandbox; Outpost adds the sandbox environment to env.
  • options.variablesOptional
    Readonly<Record<string, string>> | undefined
    Environment variables set for every command in the sandbox, as literal values. A key the agent also declares fails with code configuration.
  • options.rootOptional
    string | undefined
    Repository directory inside the sandbox, default /vercel/sandbox/outpost.
  • options.retainOptional
    number | undefined
    Bytes of output tail kept per stream, default 65536.
  • connectOptional
    ((config: VercelOptions["create"]) => Promise<Sandbox>) | undefined
    Replaces the default Sandbox.create() from @vercel/sandbox; receives the creation options with the network policy and env applied.

SandboxProvider

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

export declare function createVercelSandboxProvider(
  options?: VercelOptions,
  connect?: (config: VercelOptions["create"]) => Promise<Sandbox>,
): SandboxProvider;