TechFabricTechFabricHarness
EcosystemSandboxes

Vercel Sandbox

Adapt @vercel/sandbox instances to Fabric sessions, so an agent deployed on Vercel executes code without leaving the platform.

This migration targets the upcoming connectors 3.0 and matching CLI release. Do not pair the published connectors 2.x generation with Vercel SDK 3.x.

fh add vercel
pnpm audit --audit-level=high
import { init } from '@fabric-harness/sdk';
import { Sandbox } from '@vercel/sandbox';
import { vercelSandbox } from '@fabric-harness/connectors/vercel';

const remote = await Sandbox.create({
  runtime: 'node24',
  timeout: 300_000,
});
const fabric = await init({
  sandbox: vercelSandbox(remote, { cleanup: true }),
});

The connector maps the Vercel 3.9 command object, async output readers, output streams, AbortSignal, file APIs, and lifecycle operations without exposing provider credentials to the model. The supported range is @vercel/sandbox >=3.9.0 <4.

Migrate from Vercel SDK 1.x

The provider-generation change is covered by a major connectors release. Upgrade the vendor SDK, refresh your application's lockfile, and audit again. The tested 3.9.0 graph resolves patched Zod 4.6.6 with the application policy below. Its CLI authentication dependency still pins Zod 4.1.11 without it. The old 1.x SDK pins Zod 3.24.4, affected by GHSA-mrhx-c7xc-m3w5; do not force a Zod major override or keep that old lockfile. A clean workspace audit does not audit your application.

Required application-root policy

The CLI recipe writes this explicit npm/pnpm policy before installing dependencies. For a manually managed application, apply it at the workspace root before installing @fabric-harness/connectors@^3.0.0 and @vercel/sandbox@>=3.9.0 <4:

{
  "overrides": { "zod@>=4.0.0 <4.6.6": "4.6.6" },
  "pnpm": { "overrides": { "zod@>=4.0.0 <4.6.6": "4.6.6" } }
}

This selects only vulnerable 4.x copies, not Zod 3. Refresh the application's lockfile and run npm audit --audit-level=high or pnpm audit --audit-level=high. An independent Zod 3 dependency still needs its own application or integration migration; this policy does not make it safe. Member-level overrides are ineffective. Conflicting overrides, unreviewed dependency rewrites, and unvalidated package managers fail before recipe files are written. The profile deliberately supports a narrow tested specification, not arbitrary versions. A refusal is not a claim that every other version is vulnerable.

Shell strings now run through sh -c with separate arguments. Fabric forwards the timeout to both the cancellation signal and Vercel's provider-side limit, retains cancellation while collecting command output, sends a bounded remote SIGKILL when an accepted command is aborted or times out, and normalizes provider-side command timeouts to exit code 124.

Vercel 3.x uses sandbox names. The portable ref's existing sandboxId field contains that name, and the receiving process reconnects by name:

import { registerStandardSandboxRefDecoders } from '@fabric-harness/connectors/sandbox-refs';

registerStandardSandboxRefDecoders({
  vercel: { connect: ({ sandboxId }) => Sandbox.get({ name: sandboxId }) },
});

New refs include providerData.sdkGeneration: 3. The standard decoder rejects unmarked refs, unsupported generations, and empty names with permanent INVALID_CONFIG before any provider request.

Before upgrading, drain and stop old SDK 1.x sandboxes using the old SDK, create replacements with SDK 3, and persist their new Fabric refs so each saved reference identifies the verified replacement resource and allows the old ID references to be retired safely. Alternatively, if your application owns a verified old-ID-to-name mapping, rewrite providerData.sandboxId to that name and set providerData.sdkGeneration to 3 in a backed-up, reviewed data migration. Never guess names or merely stamp old IDs with the new marker. Custom encoders used with the standard decoder must emit the marker too.

The runnable example defaults to a mock; native SDK protocol tests replace HTTP. Neither is credentialed certification.

Run assertSandboxCertification() from the sandbox connector guide in the deployment account. The live workflow writes the secret-free report as a CI artifact.