---
title: Vercel Sandbox vs HubSpot Sandbox
description: Compare Vercel Sandbox with HubSpot sandbox accounts, pick one for each marketing operations task, and run AI-generated scripts against HubSpot without exposing your API token.
keywords: ["Vercel Sandbox","HubSpot sandbox","marketing operations","AI-generated code","credentials brokering"]
url: "https://vercel.com/kb/guide/vercel-sandbox-vs-hubspot-sandbox"
published: 2026-11-30
last_updated: 2026-11-30
authors: Ben Sabic
related_resources:
  - title: "Vercel Sandbox vs E2B"
    url: "/kb/guide/vercel-sandbox-vs-e2b"
    description: "Compare Vercel Sandbox and E2B as AI agent sandboxes, including isolation, persistence, network controls, SDKs, and deployment regions."
  - title: "Run a marketing team from Slack with eve"
    url: "/kb/guide/marketing-team-eve"
    description: "Team of five marketing agents built on eve. The lead routes work to specialists that write long-form into Notion, queue social posts in Typefully, run email in Resend, and audit for SEO, with approvals for anything irreversible."
  - title: "How Vercel Drives work and how to use them"
    url: "/kb/guide/vercel-drives"
    description: "Learn how Vercel Drives give Vercel Sandbox persistent, shareable storage, and how to create, mount, snapshot, fork, list, and delete a drive."
install_vercel_plugin: npx plugins add vercel/vercel-plugin
search_with_vercel_cli: npx vercel@latest kb search "<query>"
read_with_vercel_cli: "npx vercel@latest kb inspect vercel-sandbox-vs-hubspot-sandbox"
---

[Vercel Sandbox](https://vercel.com/docs/sandbox) runs untrusted or AI-generated code in a Firecracker microVM. [HubSpot's sandbox](https://knowledge.hubspot.com/account-management/deploy-sandbox-changes-to-production) gives marketing operations and revenue operations teams a separate account with supported configuration copied from production, so they can test CRM changes before using them in the live account.

Use HubSpot sandboxes to test properties, pipelines, workflows, forms, and automated marketing emails before deploying new supported assets to production. Vercel Sandbox runs scripts with time limits and a network policy. On Pro and Enterprise, credentials brokering keeps API tokens outside the sandbox.

The two can support the same contact-cleanup job. Run the script in Vercel Sandbox against a HubSpot sandbox account, inspect its proposed changes, and test approved updates there before authorizing a separate production run.

## How Vercel Sandbox and HubSpot sandboxes compare

HubSpot uses "sandbox" for more than one [kind of account](https://developers.hubspot.com/docs/getting-started/account-types). Standard sandboxes copy supported assets from a production account. Development sandboxes are lightweight environments for building apps and extensions. Developer test accounts are separate accounts that can't sync data with other accounts.

In the tables below, "HubSpot sandbox" means a standard sandbox. HubSpot no longer supports legacy standard sandboxes as of April 30, 2026.

### Purpose and contents

Vercel Sandbox is an [AI sandbox](https://vercel.com/i/what-is-an-ai-sandbox). It isolates running code in a [microVM](https://vercel.com/i/microvm-vs-container), a small virtual machine with its own kernel. HubSpot's sandbox isolates configuration changes and test records.

| Concern             | Vercel Sandbox                                                                                                                                               | HubSpot sandbox                                                                                                                                                                                                                                                                                          |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| What it isolates    | Code. Each sandbox is a Firecracker microVM with its own kernel, filesystem, and network.                                                                    | Configuration and test data. The sandbox is a separate HubSpot account with a copy of your production account's features and supported assets.                                                                                                                                                           |
| Starting contents   | An empty workspace on the default `vercel/sandbox/universal` image, which has Node.js 24 and Python 3.14, or a Git repository, tarball, or snapshot you name | Supported assets copied from production at creation, including properties, pipelines, workflows, forms, automated marketing emails, sequences, playbooks, and templates. Optionally, the 5,000 most recently updated contacts, with up to 100 associated deals, companies, and tickets for each contact. |
| What it leaves out  | Everything you don't put in it. No CRM data or credentials arrive unless your code supplies them.                                                            | All Service Hub and Revenue Hub assets, reporting and dashboards, most account settings, connected apps and integrations, non-automated marketing emails, and custom code action secrets                                                                                                                 |
| Route to production | None. Your application decides what to do with a command's output and files.                                                                                 | Deploy to production moves new supported assets, up to 300 changes for each deploy. Edits to assets that were copied from production can't be deployed.                                                                                                                                                  |
| Plan                | Hobby, Pro, and Enterprise                                                                                                                                   | Enterprise subscription to Marketing Hub, Sales Hub, Service Hub, Data Hub, Content Hub, Smart CRM, or Revenue Hub                                                                                                                                                                                       |

HubSpot lists [what copies to a sandbox](https://knowledge.hubspot.com/account-management/production-assets-eligible-to-copy-to-a-sandbox) and [what deploys back](https://knowledge.hubspot.com/account-management/assets-eligible-to-be-deployed-to-production). Unsupported dependencies can prevent workflows and segments from copying. Playbooks and website pages can copy with unsupported components omitted.

Contact, company, deal, ticket, and custom object records get different IDs in the sandbox account, so look records up by a property such as email.

### Lifecycle and limits

Your code starts and stops Vercel Sandbox sessions within a time limit. Create a HubSpot sandbox from your production account, then recreate it regularly to reflect current configuration, as HubSpot recommends.

| Concern          | Vercel Sandbox                                                                                                                             | HubSpot sandbox                                                                                                                            |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
| How many         | 10 running at once on Hobby. 10,000 on Pro and Enterprise.                                                                                 | One standard sandbox and one development sandbox for each production account at a time. Additional standard sandbox capacity is available. |
| How long it runs | 5 minutes by default. Extend a session to 45 minutes on Hobby or 24 hours on Pro and Enterprise.                                           | HubSpot's sandbox pages describe no session or time limit.                                                                                 |
| What persists    | The filesystem, which Vercel snapshots when a session stops. `persistent: false` discards it. Running processes aren't restored on resume. | Assets copy from production when the sandbox is created, and the contact copy is a one-time sync                                           |
| Size limits      | 4 vCPUs and 8 GB of memory on Hobby, 8 vCPUs and 16 GB on Pro, 32 vCPUs and 64 GB on Enterprise                                            | Workflows enroll up to 100,000 records a day across the account. Imports accept up to 200,000 records for each listed object.              |

Vercel's duration limit applies to each session. Resuming a [persistent sandbox](https://vercel.com/docs/sandbox/concepts/persistent-sandboxes) starts a new session with a fresh time limit and the same saved files.

### Code execution

In HubSpot, code runs in [custom code actions](https://developers.hubspot.com/docs/api-reference/latest/automation/workflow-actions/custom-code-actions) inside workflows and in [serverless functions](https://developers.hubspot.com/docs/apps/developer-platform/add-features/serverless-functions/reference) inside app projects. Workflows that use custom code actions copy to a HubSpot sandbox, so you can test them there. The table compares Vercel Sandbox with custom code actions.

| Concern         | Vercel Sandbox                                                                                                            | HubSpot custom code action                                                                  |
| --------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| Where code runs | In a Firecracker microVM you create on demand                                                                             | In a serverless function that HubSpot manages on AWS Lambda, as a step in a workflow        |
| Languages       | Any runtime in the image, or one you install. The default image has Node.js 24 and Python 3.14.                           | JavaScript on Node.js, or Python, which is in beta                                          |
| Time limit      | 5 minutes by default, up to 45 minutes on Hobby or 24 hours on Pro and Enterprise                                         | 20 seconds                                                                                  |
| Memory          | 2 GB for each vCPU, up to 8 GB on Hobby, 16 GB on Pro, or 64 GB on Enterprise                                             | 128 MB                                                                                      |
| Packages        | Install from public registries such as npm or PyPI while the network policy allows it                                     | The libraries HubSpot lists for each runtime version                                        |
| Secrets         | Credentials brokering, on Pro and Enterprise, adds them to outbound requests at the firewall, so the code can't read them | Environment variables that the code reads, with a combined length of up to 1,000 characters |
| Availability    | Hobby, Pro, and Enterprise                                                                                                | Data Hub Professional or Enterprise                                                         |

Custom code actions that exceed the time or memory limit end in an error. On developer platform version 2026.03, HubSpot's project serverless functions are JavaScript, accept npm packages, and time out after 15 seconds.

### Security and credentials

Vercel Sandbox's boundary is the microVM, and its [firewall](https://vercel.com/docs/sandbox/concepts/firewall) controls what leaves it. HubSpot's boundary is the account, which has its own users.

| Concern         | Vercel Sandbox                                                                                                                                                                                                             | HubSpot sandbox                                                                                                                                 |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Boundary        | The microVM. Processes in it can't access other sandboxes or the host.                                                                                                                                                     | The separate account holds test records and configuration. Outbound webhook calls can still reach production services.                          |
| Outbound access | Allow all by default. You can deny all, or allow only listed domains and address ranges.                                                                                                                                   | Production integrations aren't connected automatically. HubSpot recommends connecting the sandbox version of each integration.                  |
| Credentials     | On Pro and Enterprise, brokering rules add a secret to matching requests after they leave the sandbox. [Sandbox Credentials](https://vercel.com/docs/sandbox/concepts/credentials), in beta, does this for npm registries. | Custom code action secrets aren't copied. Set them up again in the sandbox.                                                                     |
| Who gets in     | Callers with the project's [Vercel OIDC token](https://vercel.com/docs/sandbox/concepts/authentication), or an access token with the team and project IDs                                                                  | Super Admins, Partner admins with elevated access, and users with Developer tools access are copied by default. You add other users separately. |

Secrets in a sandbox's environment are visible to the code that runs there. Brokering keeps the secret outside, but the code can still make any request the rule authorizes, so scope both the HubSpot token and the rule to the task. Vercel Sandbox runs on infrastructure that maintains [SOC 2 Type II certification](https://vercel.com/docs/sandbox/concepts/security), and snapshots are encrypted at rest.

## Manage sandboxes with SDKs and CLIs

You can control Vercel Sandbox with the [TypeScript SDK](https://vercel.com/docs/sandbox/sdk/javascript), [Python SDK](https://vercel.com/docs/sandbox/sdk/python), or [CLI](https://vercel.com/docs/sandbox/sdk/cli).

You manage a HubSpot sandbox from HubSpot or the [HubSpot CLI](https://developers.hubspot.com/docs/developer-tooling/local-development/hubspot-cli/commands/account-commands). Authenticate the production account and make it the CLI default, then create a sandbox:

```bash
hs sandbox create
```

Choose a standard or development sandbox when prompted. From an existing HubSpot project directory, upload the project to the sandbox account. Replace `sandbox` with its name in your CLI configuration:

```bash
hs project upload --account=sandbox
```

The upload creates a build and deploys it automatically when auto-deploy is enabled, as it is for new projects. Test the project in the sandbox before uploading to production. After review, replace `main` with the production account's CLI name and upload without deploying:

```bash
hs project upload --account=main --skip-auto-deploy
```

Review the production build, then deploy it separately with `hs project deploy --account=main`. These commands move app code. Supported CRM configuration moves through HubSpot's deploy-to-production workflow.

## Where Vercel Sandbox goes deeper

### Sessions measured in minutes and hours

Sessions extend to [45 minutes on Hobby or 24 hours on Pro and Enterprise](https://vercel.com/docs/sandbox/pricing#runtime-limits), which leaves room for a full contact export, a model call, or a build. You set the vCPU count for each sandbox, and each vCPU comes with 2 GB of memory.

### Credentials the code can't read

On Pro and Enterprise, [credentials brokering](https://vercel.com/docs/sandbox/concepts/firewall#credentials-brokering) adds a header, such as `Authorization`, to outbound requests for a domain you allow. The secret never enters the sandbox, so code inside it can't print or send it elsewhere. Rules can match the request path, method, query parameters, and headers, and you can replace the policy during a session without restarting the process. [Notion Workers use the same mechanism](https://vercel.com/blog/notion-workers-vercel-sandbox) to run code from third-party developers and agents.

### Preview URLs and persistent workspaces

Expose up to 15 ports when you create a sandbox, and each port gets [its own public URL](https://vercel.com/docs/sandbox/examples/expose-a-port). Sandboxes also save their filesystem when a session stops, unless you opt out, so an agent can return to the same named sandbox and find its files. For data that should outlive any one sandbox, [mount a Vercel Drive](https://vercel.com/kb/guide/vercel-drives).

## Where HubSpot sandboxes go deeper

### A working copy of your portal

HubSpot's sandbox starts with your object schemas, associations, property validation rules, pipelines, and pipeline stages. Workflows, forms, and automated marketing emails copy when everything they depend on is supported. Vercel Sandbox holds only the files and API responses your code brings in.

### Deploy to production

After testing, a Super Admin deploys new supported assets from the sandbox to production. The eligible types are standard and custom object configuration, automated marketing emails, email footers, forms, segments, and workflows. HubSpot detects conflicts, which you resolve before the deployment proceeds, and workflows arrive in production switched off.

Only new sandbox assets can be deployed. Changes to a workflow copied from production stay in the sandbox, and a deployment can't be canceled once started.

### Email tests that reach only sandbox users

HubSpot's sandbox sends marketing emails and one-to-one test emails only to contacts whose address matches a sandbox user. Other recipients receive nothing, so you can test a nurture workflow before enrolling production contacts.

### Development sandboxes and test accounts for apps

Development sandboxes require Enterprise and copy CRM object definitions when created through the CLI. Each standard account can create up to 10 developer test accounts, with 90-day trials of many Enterprise features.

Renew trials from the test-account management page. API renewal requires an OAuth token from an app in the same developer account and a call within 30 days of expiration. [Configurable test accounts](https://developers.hubspot.com/docs/developer-tooling/local-development/configurable-test-accounts) let you choose each hub's tier.

### HubSpot's own automation and agents

Custom code actions run inside the workflow that needs them, and Breeze Assistant can write one from a prompt. [Agent Hub](https://knowledge.hubspot.com/ai/understand-agent-hub) is one workspace for HubSpot's Data agent, Prospecting agent, and Customer agent and for custom agents, which [HubSpot's catalog](https://legal.hubspot.com/hubspot-product-and-services-catalog) labels Beta. It requires HubSpot Credits. Agent Hub workflows copy to a sandbox, but they can't be deployed back to production, so HubSpot recommends recreating a tested change in production.

## Plan capacity and usage

Check that your HubSpot account includes the sandbox and workflow features needed for the task. Review the [account types](https://developers.hubspot.com/docs/getting-started/account-types) and [product catalog](https://legal.hubspot.com/hubspot-product-and-services-catalog) for eligibility.

[Vercel Sandbox usage](https://vercel.com/docs/sandbox/pricing) includes active CPU, provisioned memory, sandbox creations, data transfer, and snapshot storage. CPU billing excludes time waiting for network responses, but memory remains provisioned throughout the session. Set a timeout and stop the sandbox when the work finishes.

## Choose by workload requirements

Use a HubSpot sandbox when the task depends on HubSpot configuration or test records. Add Vercel Sandbox when it needs code execution with its own runtime, resource limits, or network policy. Offline analysis and draft previews can use Vercel Sandbox without a HubSpot sandbox account.

| Requirement                                                        | Product fit                                             | Reason                                                                           |
| ------------------------------------------------------------------ | ------------------------------------------------------- | -------------------------------------------------------------------------------- |
| Test a new workflow, property, pipeline, or form before production | HubSpot sandbox                                         | Copies your configuration and deploys new assets back                            |
| Send test marketing emails that reach only your own users          | HubSpot sandbox                                         | Email sends only to contacts whose address matches a sandbox user                |
| Build or test a HubSpot app or UI extension                        | HubSpot development sandbox or test account             | Made for app projects, with `hs project upload` to move code                     |
| Run an AI-generated script against CRM data                        | Vercel Sandbox, calling a HubSpot sandbox account first | MicroVM isolation, with the token held outside the sandbox on Pro and Enterprise |
| Run a job that needs more than 20 seconds or 128 MB                | Vercel Sandbox                                          | Sessions of up to 24 hours on Pro and Enterprise, and 2 GB for each vCPU         |
| Share a generated landing page for review                          | Vercel Sandbox                                          | Public URL for each exposed port                                                 |
| Analyze an export with outbound access denied                      | Vercel Sandbox                                          | `deny-all` network policy, which also blocks DNS                                 |

## Get started with Vercel Sandbox

Before you begin, make sure you have a [Vercel account](https://vercel.com/signup), the [Vercel CLI](https://vercel.com/docs/cli), and Node.js 22.19 or later. The Python examples need Python 3.11 or later. Sandbox is free on Hobby within its usage quotas.

> **Note:**
>
> Credentials brokering uses [transformation rules](https://vercel.com/docs/sandbox/sdk/javascript#allow), which are available on Pro and Enterprise. On Hobby, you can run the attribution analysis and the preview example, which don't inject a token.

Create a [service key](https://developers.hubspot.com/docs/apps/developer-platform/build-apps/authentication/account-service-keys) in the HubSpot test account your code will call. Under **Development > Keys > Service keys**, select `crm.objects.contacts.read`. You need Super Admin or Developer tools access to create the key.

Existing private app tokens also work when they have this scope, but HubSpot no longer allows new legacy private apps. Use a developer test account if you don't have access to a standard sandbox.

From a new directory, run the Vercel CLI and choose **Create a new project**:

```bash
vercel link
```

Add the HubSpot token to the project's environment variables, and select the Development environment when the CLI prompts you:

```bash
vercel env add HUBSPOT_SANDBOX_TOKEN
```

Pull environment variables and a development OIDC token into `.env.local`. Rerun this command after 12 hours to refresh the token:

```bash
vercel env pull
```

Install the SDK and the tools that run TypeScript locally:

**pnpm**

```bash
pnpm add @vercel/sandbox dotenv @types/node tsx typescript
```

**yarn**

```bash
yarn add @vercel/sandbox dotenv @types/node tsx typescript
```

**npm**

```bash
npm install @vercel/sandbox dotenv @types/node tsx typescript
```

**bun**

```bash
bun add @vercel/sandbox dotenv @types/node tsx typescript
```

Save this as `index.ts`. It creates a sandbox, writes and runs a Python file, then stops the session. Each run counts toward your plan's usage:

```typescript
import { config } from 'dotenv';
config({ path: '.env.local' });

import { Sandbox } from '@vercel/sandbox';

async function main() {
  const sandbox = await Sandbox.create({ persistent: false });

  try {
    await sandbox.writeFiles([
      { path: 'hello.py', content: "print('Hello from Vercel Sandbox!')\n" },
    ]);

    const result = await sandbox.runCommand('python3', ['hello.py']);
    console.log(result.exitCode, await result.stdout());
  } finally {
    await sandbox.stop();
  }
}

main().catch(console.error);
```

The first two lines load the Vercel OIDC token from `.env.local`. `persistent: false` discards the filesystem when the session stops. Leave it out to keep the files in a snapshot for the next session.

Run the script:

```bash
pnpm tsx index.ts
```

The script prints `0` and `Hello from Vercel Sandbox!`.

## Five marketing use cases for Vercel Sandbox

Have generated code produce a result you can inspect before changing CRM data or publishing content. For HubSpot calls, use a sandbox or developer test account with credentials kept separate from production.

### Clean up HubSpot contacts with AI-generated scripts

For contact deduplication or normalization, have generated code report the records and values it would change. Run the dry run in a microVM with read access to HubSpot contacts and no token in its environment. The marketing operations owner reviews the report before approving updates.

#### Broker the HubSpot token at the firewall

The policy uses a transformation rule, so it needs a Pro or Enterprise plan. Create `hubspot-policy.ts`. Its first rule adds the token to `GET` requests under `/crm/v3/objects/contacts`, the path that [HubSpot's Contacts API](https://developers.hubspot.com/docs/api-reference/legacy/crm/objects/contacts/guide) uses to list contacts. Its final rule answers every other request to the domain with `403`:

```typescript
import type { NetworkPolicy } from '@vercel/sandbox';

export function readOnlyContactsPolicy(token: string): NetworkPolicy {
  return {
    allow: {
      'api.hubapi.com': [
        {
          match: {
            path: { startsWith: '/crm/v3/objects/contacts' },
            method: ['GET'],
          },
          transform: [{ headers: { Authorization: `Bearer ${token}` } }],
        },
        { response: { statusCode: 403 } },
      ],
    },
  };
}
```

User-defined policies deny traffic to every domain you don't list. The firewall evaluates a domain's rules in order, and the first match handles the request.

HubSpot's [date-versioned API](https://developers.hubspot.com/docs/api-reference/latest/crm/objects/contacts/guide) uses paths such as `/crm/objects/2026-09/contacts`. Match the policy prefix to the path your script calls.

Create `cleanup.ts` to upload the generated script and apply the read-only policy:

```typescript
import { config } from 'dotenv';
config({ path: '.env.local' });

import { readFile } from 'node:fs/promises';
import { Sandbox } from '@vercel/sandbox';
import { readOnlyContactsPolicy } from './hubspot-policy';

async function main() {
  const token = process.env.HUBSPOT_SANDBOX_TOKEN;
  if (!token) throw new Error('Set HUBSPOT_SANDBOX_TOKEN');

  const sandbox = await Sandbox.create({
    persistent: false,
    timeout: 10 * 60 * 1000,
    networkPolicy: readOnlyContactsPolicy(token),
    tags: { team: 'marketing-ops', target: 'hubspot-sandbox' },
  });

  try {
    await sandbox.writeFiles([
      { path: 'cleanup.py', content: await readFile('./generated/cleanup.py') },
    ]);

    const result = await sandbox.runCommand('python3', ['cleanup.py']);
    if (result.exitCode !== 0) {
      throw new Error(await result.stderr());
    }
    console.log(await result.stdout());
  } finally {
    await sandbox.stop();
  }
}

main().catch(console.error);
```

The token stays in your process and in the firewall rule. Keep it out of `runCommand()` arguments and the sandbox's `env`, because code in the sandbox can read both.

#### Have the model write a dry run

Ask the model for a script that reports the changes it would make. This example, saved as `generated/cleanup.py`, finds contacts whose email address has uppercase letters. It sends no `Authorization` header, because the firewall adds one:

```python
import json
import urllib.request

URL = "https://api.hubapi.com/crm/v3/objects/contacts?limit=100&properties=email"

with urllib.request.urlopen(URL) as response:
    contacts = json.load(response)["results"]

proposed = []
for contact in contacts:
    email = (contact["properties"].get("email") or "").strip()
    if email and email != email.lower():
        proposed.append({"id": contact["id"], "email": email.lower()})

print(json.dumps({"checked": len(contacts), "proposed": proposed}, indent=2))
```

Run it:

```bash
pnpm tsx cleanup.ts
```

The JSON report lists how many contacts were checked and which changes are proposed. This script reads up to 100 contacts; to process all pages, follow `paging.next.after` from each response. Other HubSpot API requests and writes receive `403` without a token attached.

#### Use the same policy in Python

For Python, save the equivalent read-only policy in `hubspot_policy.py`:

```python
from vercel.sandbox import (
    NetworkPolicy,
    NetworkPolicyMatcher,
    NetworkPolicyRequestMatcher,
    NetworkPolicyResponse,
    NetworkPolicyRule,
    NetworkPolicyTransform,
)


def read_only_contacts_policy(token: str) -> NetworkPolicy:
    return NetworkPolicy.custom(
        allow={
            "api.hubapi.com": [
                NetworkPolicyRule(
                    match=NetworkPolicyRequestMatcher(
                        path=NetworkPolicyMatcher.starts_with(
                            "/crm/v3/objects/contacts"
                        ),
                        method=("GET",),
                    ),
                    transform=(
                        NetworkPolicyTransform(
                            headers={"Authorization": f"Bearer {token}"}
                        ),
                    ),
                ),
                NetworkPolicyRule(
                    response=NetworkPolicyResponse(status_code=403)
                ),
            ]
        }
    )
```

Pass the result to `sandbox.create_sandbox(network_policy=...)`.

#### Review, allow writes, then move to production

After approval, give the sandbox account's token the `crm.objects.contacts.write` scope and allow only the reviewed script's required path and HTTP method. Test the changes and inspect the records in the sandbox account before using a production token with the necessary scopes.

> **Warning:**
>
> Production writes change live CRM records and Vercel Sandbox can't undo them. Export affected records first, then restrict the policy to the reviewed script's required paths and methods.

For production, use that account's token and find records by a property because IDs differ between accounts. Handle `429` rate-limit errors from the [HubSpot API](https://developers.hubspot.com/docs/developer-tooling/platform/usage-guidelines).

### Run jobs that outgrow HubSpot custom code actions

HubSpot's custom code actions must finish within 20 seconds and use up to 128 MB of memory. When a job needs more, have the workflow call a [Vercel Function](https://vercel.com/docs/functions) through a webhook, and let the function run the job in a sandbox. Workflow webhooks need Data Hub Professional or Enterprise.

#### Start the job from a route handler

In a Next.js 15.1 or later app, create `app/api/hubspot/missing-emails/route.ts`. The route checks a shared secret, creates a sandbox, responds to HubSpot, and finishes the job after the response:

```typescript
import { after } from 'next/server';
import { Sandbox } from '@vercel/sandbox';

export const maxDuration = 300;

const job = `
import json
import urllib.request

URL = "https://api.hubapi.com/crm/v3/objects/contacts?limit=100&properties=email"

with urllib.request.urlopen(URL) as response:
    contacts = json.load(response)["results"]

# Replace this block with the work a custom code action can't finish.
missing = [c["id"] for c in contacts if not c["properties"].get("email")]

print(json.dumps({"checked": len(contacts), "missing_email": missing}))
`;

export async function POST(request: Request) {
  const secret = process.env.WORKFLOW_WEBHOOK_SECRET;
  const token = process.env.HUBSPOT_TOKEN;
  if (!secret || !token) {
    return new Response('Missing configuration', { status: 500 });
  }
  if (request.headers.get('authorization') !== `Bearer ${secret}`) {
    return new Response('Unauthorized', { status: 401 });
  }

  const sandbox = await Sandbox.create({
    persistent: false,
    timeout: 4 * 60 * 1000,
    resources: { vcpus: 4 },
    networkPolicy: {
      allow: {
        'api.hubapi.com': [
          {
            transform: [{ headers: { Authorization: `Bearer ${token}` } }],
          },
        ],
      },
    },
  });

  after(async () => {
    try {
      await sandbox.writeFiles([{ path: 'job.py', content: job }]);
      const result = await sandbox.runCommand('python3', ['job.py']);
      console.log(result.exitCode, await result.stdout());
    } finally {
      await sandbox.stop();
    }
  });

  return Response.json({ sandbox: sandbox.name }, { status: 202 });
}
```

The sandbox has 4 vCPUs and 8 GB of memory. Its four-minute timeout ends the session even if the function fails before cleanup. This Pro or Enterprise transform has no matcher, so it attaches the token to every request to `api.hubapi.com`. Use reviewed code or restrict paths and methods as in the [contact-cleanup policy](#clean-up-hubspot-contacts-with-ai-generated-scripts).

Add `HUBSPOT_TOKEN` and `WORKFLOW_WEBHOOK_SECRET` to the Vercel project's environment variables before you deploy. To confirm the job ran, look in the function's logs for the exit code `0` and the JSON summary.

#### Know what the function still owns

In the workflow's **Send a webhook** action, choose **POST** and enter the route's HTTPS URL. Set authentication to **API key**, the key name to **Authorization**, and the location to **Request header**. For the value, use **Bearer** followed by a space and the secret in your Vercel project's `WORKFLOW_WEBHOOK_SECRET` variable.

This route ignores the request body. To process the enrolled record, read the webhook fields and pass them into the sandbox with `writeFiles()`. Make the job idempotent so repeat deliveries cannot apply the same change again.

Work scheduled with `after()` shares the function's [duration limit](https://vercel.com/docs/functions/configuring-functions/duration#duration-limits). Fluid compute defaults to 300 seconds. Pro and Enterprise allow 800 seconds, with a [30-minute beta](https://vercel.com/docs/functions/configuring-functions/duration#extended-max-duration-beta) for eligible runtimes.

For jobs that outlive their initiating function, start a detached command and store its sandbox and command IDs. Another invocation can collect the result. Pro and Enterprise [lifecycle webhooks](https://vercel.com/docs/sandbox/lifecycle-webhooks) report session starts, stops, and expiration.

#### Test the workflow in a HubSpot sandbox first

Copied workflows retain their production webhook URLs. Before testing, point the sandbox workflow at a deployment whose `HUBSPOT_TOKEN` belongs to the test account, such as a separate Vercel project. Otherwise, enrollment can trigger a job against production data. Enroll a test contact only after this change, then check the logs for exit code `0` and the contact summary.

### Analyze campaign and attribution data with AI-written Python

An AI-written Python script can compare first-touch and last-touch revenue by campaign. Prepare an approved dataset from production exports, because HubSpot sandboxes omit reporting, dashboards, and record event data. Include only the required campaign-touch fields and run the script in a microVM that blocks outbound network access, including DNS.

#### Run the analysis with outbound access denied

Initialize a new Python project and install the Python SDK ([install uv](https://docs.astral.sh/uv/) first):

```bash
uv init --bare --no-workspace --name marketing-sandbox &&
uv add vercel-sandbox python-dotenv
```

Save your export as `exports/campaign-touches.csv`, then create `analyze.py`. It uploads the export and a generated script, runs the script under a `deny-all` policy, and prints the result:

```python
import asyncio
from pathlib import Path

from dotenv import load_dotenv
from vercel import sandbox
from vercel.sandbox import NetworkPolicy

load_dotenv(".env.local")


async def main() -> None:
    export = Path("exports/campaign-touches.csv").read_text()
    script = Path("generated/attribution.py").read_text()

    async with sandbox.create_sandbox(
        persistent=False,
        network_policy=NetworkPolicy.deny_all(),
    ) as box:
        await box.fs.write_text("touches.csv", export)
        await box.fs.write_text("attribution.py", script)

        result = await box.run_command(
            "python",
            ["attribution.py"],
            kill_after=120,
            capture_output=True,
        )
        print(result.returncode)
        if result.stdout is None or result.stderr is None:
            raise RuntimeError("Expected captured command output")
        print(result.stdout.decode())
        print(result.stderr.decode())


asyncio.run(main())
```

The `async with` block stops and destroys the sandbox on exit, so the export doesn't stay in a snapshot. `kill_after` ends a script that runs longer than 120 seconds.

Save the analysis script as `generated/attribution.py`. It expects one row per touch with `deal_id`, `campaign`, `touched_at`, and `deal_amount`. Use ISO 8601 timestamps with `Z` or a UTC offset, and repeat the same deal amount on each touch for that deal. Prepare amounts in one currency before running the analysis.

The script parses timestamps, checks amounts, and writes quoted CSV. Tied timestamps retain the input row order.

```python
import csv
import sys
from collections import defaultdict
from datetime import datetime
from decimal import Decimal

touches = defaultdict(list)
with open("touches.csv", newline="", encoding="utf-8-sig") as source:
    reader = csv.DictReader(source)
    required = {"deal_id", "campaign", "touched_at", "deal_amount"}
    if not required.issubset(reader.fieldnames or []):
        raise ValueError("Missing required CSV columns")
    for row in reader:
        if not row["deal_id"] or not row["campaign"]:
            raise ValueError("Each touch needs a deal_id and campaign")
        touched_at = datetime.fromisoformat(row["touched_at"])
        if touched_at.utcoffset() is None:
            raise ValueError("touched_at must include a UTC offset or Z")
        amount = Decimal(row["deal_amount"])
        if not amount.is_finite():
            raise ValueError("deal_amount must be a finite decimal")
        touches[row["deal_id"]].append(
            (touched_at, row["campaign"], amount)
        )

first_touch = defaultdict(Decimal)
last_touch = defaultdict(Decimal)
for rows in touches.values():
    if len({row[2] for row in rows}) != 1:
        raise ValueError("Each deal must have one consistent deal_amount")
    rows.sort(key=lambda row: row[0])
    amount = rows[0][2]
    first_touch[rows[0][1]] += amount
    last_touch[rows[-1][1]] += amount

writer = csv.writer(sys.stdout)
writer.writerow(["campaign", "first_touch", "last_touch"])
for campaign in sorted(set(first_touch) | set(last_touch)):
    writer.writerow([
        campaign,
        f"{first_touch[campaign]:.2f}",
        f"{last_touch[campaign]:.2f}",
    ])
```

Run it:

```bash
uv run python analyze.py
```

The script prints `0`, a header row, and one row for each campaign.

#### Add packages and larger datasets

Scripts that need pandas or another package can't install it under `deny-all`. Create the sandbox with outbound access, install the packages, then call `await box.update(network_policy=NetworkPolicy.deny_all())` before the generated script runs. The firewall's [live updates](https://vercel.com/docs/sandbox/concepts/firewall#live-updates) apply to the running session.

For exports with millions of rows, [query the data with DuckDB and Python through an MCP server](https://vercel.com/kb/guide/large-scale-data-analysis-vercel-sandbox-mcp), which keeps the rows out of the model's context. To run generated Python from a FastAPI app, follow [the Python walkthrough](https://vercel.com/kb/guide/python-and-vercel-sandbox). To accept exports that people upload, [store them in Vercel Blob and process them in a sandbox](https://vercel.com/kb/guide/user-uploaded-files-vercel-sandbox-and-blob).

Generated code can use the wrong denominator or drop rows, so have an analyst compare its totals with a trusted report. Isolation cannot validate the analysis.

### Preview AI-generated landing pages and email templates

Reviewers need to see a model's landing page or email template rendered. Serve the draft from a sandbox and share the URL.

#### Serve the draft on an exposed port

> **Warning:**
>
> Preview URLs are public. Use placeholder content and omit real contact data or unreleased pricing. The sandbox's `deny-all` policy does not control browser requests, so review generated scripts, forms, and external assets before sharing.

Save the model's drafts as `generated/landing-page.html` and `generated/nurture-email.html`, then create `preview.ts`. It uploads both files, starts the server on port 3000, and prints their URLs. If setup fails, it stops the sandbox before reporting the error.

```typescript
import { config } from 'dotenv';
config({ path: '.env.local' });

import { readFile } from 'node:fs/promises';
import { Sandbox } from '@vercel/sandbox';

async function main() {
  const sandbox = await Sandbox.create({
    ports: [3000],
    timeout: 30 * 60 * 1000,
    persistent: false,
    networkPolicy: 'deny-all',
  });

  try {
    await sandbox.mkDir('site');
    await sandbox.writeFiles([
      {
        path: 'site/index.html',
        content: await readFile('./generated/landing-page.html'),
      },
      {
        path: 'site/email.html',
        content: await readFile('./generated/nurture-email.html'),
      },
    ]);

    await sandbox.runCommand({
      cmd: 'python3',
      args: ['-m', 'http.server', '3000', '--directory', 'site'],
      detached: true,
    });

    const url = sandbox.domain(3000);
    console.log(`Sandbox: ${sandbox.name}`);
    console.log(`Landing page: ${url}`);
    console.log(`Email: ${new URL('/email.html', url).href}`);
  } catch (error) {
    await sandbox.stop();
    throw error;
  }
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});
```

Run it:

```bash
pnpm tsx preview.ts
```

The script prints the sandbox name and two URLs. The detached command returns before the server is ready, so previews may take a moment to load.

At the 30-minute timeout, files are discarded and preview URLs return [HTTP 410](https://vercel.com/docs/errors/SANDBOX_STOPPED).

To end the preview sooner, stop the sandbox with the Sandbox CLI. Replace `your-sandbox-name` with the printed name:

```bash
npx sandbox@latest stop your-sandbox-name
```

#### Move the approved draft into HubSpot

The preview shows layout and copy. To test forms and sending, build the approved template in your HubSpot sandbox account and send it to sandbox users.

New forms and eligible automated marketing emails can be deployed to production. Email subscriptions must already exist in production, and branded automated emails are excluded. Reconfigure form settings and the email Settings tab in production before using the deployed assets.

Landing pages aren't listed as deployable, and regular marketing emails are excluded, so plan to build those in production after review. Copying existing website pages, landing pages, and blog posts into a HubSpot sandbox is in beta.

### Give marketing agents a place to run code

Marketing agents may need to calculate a segment size or a week-over-week change. An [agent sandbox](https://vercel.com/i/agent-sandbox) gives their code a separate execution environment without access to the host application's files or credentials.

#### Add a sandbox-backed tool to an AI SDK agent

Enable [AI Gateway](https://vercel.com/docs/ai-gateway/getting-started) for your Vercel team, then install these packages in a Next.js app. This example uses AI SDK 7:

**pnpm**

```bash
pnpm add @vercel/sandbox ai@^7 zod
```

**yarn**

```bash
yarn add @vercel/sandbox ai@^7 zod
```

**npm**

```bash
npm install @vercel/sandbox ai@^7 zod
```

**bun**

```bash
bun add @vercel/sandbox ai@^7 zod
```

Add the test account's read-only `HUBSPOT_TOKEN` to `.env.local`. AI Gateway accepts the OIDC token from `vercel env pull` or an `AI_GATEWAY_API_KEY` in that file. Next.js loads it automatically. Model requests and Sandbox runs have separate usage.

Use this route locally with synthetic records in a HubSpot sandbox or developer test account. The route only runs in development and has no caller authentication or record-level authorization. Before adapting it for production, require sign-in and check which records and fields the caller may access; apply those checks before any data reaches generated code.

In your Next.js app, copy `hubspot-policy.ts` from the first use case to `lib/hubspot-policy.ts`, then create `app/api/marketing-agent/route.ts`:

```typescript
import { Sandbox } from '@vercel/sandbox';
import { ToolLoopAgent, isStepCount, tool } from 'ai';
import { z } from 'zod';
import { readOnlyContactsPolicy } from '../../../lib/hubspot-policy';

export const maxDuration = 300;

export async function POST(request: Request) {
  if (process.env.NODE_ENV !== 'development') {
    return new Response('Local demonstration only', { status: 403 });
  }

  const parsed = z
    .object({ prompt: z.string().min(1).max(10_000) })
    .safeParse(await request.json().catch(() => null));
  if (!parsed.success) {
    return Response.json(
      { error: 'Expected { prompt: string }.' },
      { status: 400 },
    );
  }

  const token = process.env.HUBSPOT_TOKEN;
  if (!token) {
    return Response.json(
      { error: 'HUBSPOT_TOKEN is not set.' },
      { status: 500 },
    );
  }

  const sandbox = await Sandbox.create({
    persistent: false,
    timeout: 4 * 60 * 1000,
    networkPolicy: readOnlyContactsPolicy(token),
    tags: { agent: 'marketing-analyst' },
  });

  try {
    const agent = new ToolLoopAgent({
      model: 'openai/gpt-5-nano',
      instructions:
        'Answer questions about fictional HubSpot test contacts. ' +
        'Write Python 3 using urllib to call ' +
        'https://api.hubapi.com/crm/v3/objects/contacts ' +
        'without an Authorization header, and print the answer.',
      tools: {
        runPython: tool({
          description: 'Run Python 3 and return its output',
          inputSchema: z.object({
            code: z.string().min(1).max(20_000).describe('Python code'),
          }),
          execute: async ({ code }) => {
            await sandbox.writeFiles([
              { path: 'task.py', content: code },
            ]);
            const result = await sandbox.runCommand(
              'python3',
              ['task.py'],
            );
            return {
              exitCode: result.exitCode,
              stdout: await result.stdout(),
              stderr: await result.stderr(),
            };
          },
        }),
      },
      toolCallConcurrency: 1,
      stopWhen: isStepCount(10),
    });

    const result = await agent.generate({ prompt: parsed.data.prompt });
    return Response.json({ text: result.text });
  } finally {
    await sandbox.stop();
  }
}
```

Start the Next.js development server:

```bash
pnpm dev
```

In a second terminal, send a prompt:

```bash
curl -X POST http://localhost:3000/api/marketing-agent \
  -H "Content-Type: application/json" \
  -d '{"prompt":"How many of the first 100 contacts have no email address?"}'
```

The response is JSON with the agent's answer in `text`.

The read-only policy requires Pro or Enterprise and blocks writes and requests to unlisted hosts. It still lets generated code read every contact and property available through the permitted API with this token. The tool returns stdout and stderr to the model, so any contact data the script prints enters the agent's context.

Before using real customer data, have trusted code select the records and fields the caller may access, or enforce those permissions in a retrieval tool. Follow the same boundary when [running generated code from Next.js](https://vercel.com/kb/guide/running-ai-generated-code-sandbox).

#### Run the agent on eve

On Vercel, [eve](https://vercel.com/docs/frameworks/agents/eve) gives each agent session a Sandbox for its file and shell tools, with durable workflows to preserve session state and channels such as Slack. Configure approval policies for actions that need review.

The [marketing team walkthrough](https://vercel.com/kb/guide/marketing-team-eve) builds a lead agent and five specialists. Consider [multiple agents](https://vercel.com/i/do-i-need-multiple-ai-agents-for-marketing) if channels, tools, or voice rules outgrow one agent's context.

Okara's SEO agent [starts a Vercel Sandbox to analyze a customer's site](https://vercel.com/blog/how-okara-runs-cmo-agents-for-120000-companies-on-vercel), and a person reviews the resulting pull request before anything goes live.

## Govern AI-generated code in marketing operations

Before production, name the data-access owner and approver for each contact-cleanup script or marketing agent. Apply these [employee-built app controls](https://vercel.com/i/govern-employee-built-ai-apps-and-agents) whether a marketer prompts the model or a developer writes the integration.

### Assign owners for data and execution

Give [citizen developers](https://vercel.com/i/what-is-a-citizen-developer) in marketing an approved way to request an analysis or submit a script without handling the HubSpot token. The platform team owns the Vercel project, credentials, and network policy. The marketing operations or revenue operations owner decides which data the task needs, while the application owner implements sign-in and checks each requester's access.

Set vCPU and session limits for each job, and limit how often a caller can start a run. Budget for model calls when an agent runs code repeatedly, and for HubSpot Credits when a workflow uses HubSpot agents.

### Enforce access to records and fields

For [enterprise AI agents](https://vercel.com/i/enterprise-ai-agents) working with HubSpot, check which records and fields each caller may use before generated code runs. The contact-cleanup policy restricts HTTP paths and methods. Its brokered token can still authorize access to more contacts or properties than the caller should see, so enforce those permissions in trusted application code or the service that retrieves records.

#### How do you limit which HubSpot data a script receives?

For email cleanup, call this helper from trusted server code after checking access to the contacts and fields. It selects only IDs and email addresses:

```typescript
type Contact = {
  id: string;
  properties: Record<string, string | null>;
};

export function selectContactFields(contacts: readonly Contact[]) {
  return contacts.map(({ id, properties }) => ({
    id,
    email: properties.email ?? null,
  }));
}
```

The helper selects fields; it doesn't authorize the caller or choose which contacts they may access. Write its returned records to the sandbox's input file. For this file-based task, use `deny-all` and omit the HubSpot token and brokered API access so the script can't fetch additional records.

For live lookups, expose a retrieval tool that enforces the same limits. Keep authorization outside generated code because a model can still follow instructions hidden in CRM data.

### Approve the changes that will reach production

Enforce approval in trusted application code or the agent's action tool, using eve or AI SDK tool approvals where appropriate. HubSpot's Super Admin deployment step governs supported configuration assets; direct API writes to production need their own approval. For previews, the campaign owner approves layout and copy before forms or automated marketing emails proceed to testing in HubSpot.

#### What should someone review before approving a CRM update?

For an email-normalization job, show the CRM owner each contact ID, field, current value, and proposed value. This fictional change set targets a HubSpot test account:

| Contact ID | Field | Current value   | Proposed value  |
| ---------- | ----- | --------------- | --------------- |
| 1042       | email | SAM@EXAMPLE.COM | sam@example.com |
| 2048       | email | LEX@EXAMPLE.COM | lex@example.com |

Tie approval to the exact change set and script version. Test approved changes in the HubSpot sandbox, then prepare a production proposal because its records have different IDs. Any script or change-set revision needs fresh approval. Run HubSpot custom code tests in the sandbox because they modify the selected record.

### Control outputs and retain a useful audit trail

For attribution analysis, give the model column definitions and synthetic sample rows instead of the production export. This provides an approved alternative to [shadow AI](https://vercel.com/i/what-is-shadow-ai), such as uploading customer data to a personal assistant. If you use AI Gateway, [restrict requests to approved providers](https://vercel.com/docs/ai-gateway/security-and-compliance/provider-allowlist) and confirm their data terms; routing through the gateway alone doesn't establish those terms.

The `deny-all` policy blocks the sandbox's outbound requests, but your application can still forward command output to a model. Generated code can print every row it receives. Have trusted application code decide which results may return to the caller or enter model context, including stdout, stderr, and error messages.

#### How do you find the sandbox behind a marketing job?

Add [sandbox tags](https://vercel.com/docs/sandbox/concepts/tags) to the creation call in the marketing-agent route. Keep its read-only policy and existing `finally` cleanup:

```typescript
const sandbox = await Sandbox.create({
  persistent: false,
  timeout: 4 * 60 * 1000,
  networkPolicy: readOnlyContactsPolicy(token),
  tags: {
    agent: 'marketing-analyst',
    team: 'marketing',
    account: 'hubspot-test',
  },
});
```

The account tag is a label. The HubSpot token still determines which account API calls reach. From the same linked project directory, use the [Sandbox CLI](https://vercel.com/docs/sandbox/sdk/cli#sandbox-list) to list the marketing team's sandboxes, including stopped ones:

```bash
npx sandbox@latest list --all --tag team=marketing
```

Tags can change, so keep an [audit trail](https://vercel.com/i/how-to-audit-ai-agents) outside the agent's control with the requester, script and policy versions, approvals, sandbox ID, and exit status. Store approved summaries or restricted result references with access and retention rules. Review other scripts and CRM connections separately for [shadow IT](https://vercel.com/i/shadow-it).

## Start from an eve template

The [eve Marketing Team template](https://vercel.com/templates/eve/eve-marketing-team) deploys a lead agent and five specialists that you brief from Slack. They prepare blog drafts in Notion, social drafts in Typefully, and email campaigns in Resend.

Its approval policies pause Resend sends and deletions, Typefully deletions and scheduled publishing, and Notion page edits and moves. The [marketing team setup](https://vercel.com/i/how-to-build-an-ai-marketing-team) explains the architecture and configuration.

The template connects to Slack, Notion, Typefully, and Resend. Add a HubSpot connection or specialist by [customizing the team](https://vercel.com/i/customize-ai-marketing-team). Use [shared brand context](https://vercel.com/i/keep-ai-generated-marketing-on-brand) to keep drafts consistent across channels.

## Next steps

- Restrict egress and broker credentials with the [Sandbox firewall](https://vercel.com/docs/sandbox/concepts/firewall)
  
- Set timeouts and run detached commands for [long-running tasks](https://vercel.com/docs/sandbox/examples/execute-long-running-tasks)
  
- Estimate usage with [Sandbox pricing and quotas](https://vercel.com/docs/sandbox/pricing)
  
- Pick a first agent from [7 internal AI agents teams can build](https://vercel.com/i/internal-ai-agent-examples)
  
- Set data access and approval rules for [employee-built apps](https://vercel.com/i/govern-employee-built-ai-apps-and-agents)
  
- Compare Vercel Sandbox with [Cloudflare Sandbox](https://vercel.com/kb/guide/vercel-sandbox-vs-cloudflare-sandbox), [E2B](https://vercel.com/kb/guide/vercel-sandbox-vs-e2b), [Railway Sandboxes](https://vercel.com/kb/guide/vercel-sandbox-vs-railway-sandboxes), and [Upstash Box](https://vercel.com/kb/guide/vercel-sandbox-vs-upstash-box), or weigh more options in [7 AI sandbox providers compared](https://vercel.com/i/ai-sandbox-providers)
  

## Frequently asked questions

### Is Vercel Sandbox an alternative to a HubSpot sandbox?

No. Vercel Sandbox runs code in an isolated microVM, and a HubSpot sandbox is a copy of a HubSpot account for testing configuration. Vercel Sandbox doesn't copy a HubSpot portal's workflows or properties. Teams that automate HubSpot with code can use both, with the HubSpot sandbox account as the target and Vercel Sandbox as the place the code runs.

### Can a HubSpot workflow run code in Vercel Sandbox?

Yes. Configure a HubSpot workflow webhook to call a Vercel Function that creates the sandbox and runs the job. Workflow webhooks require Data Hub Professional or Enterprise. Your function must authenticate the webhook request before starting the job.

### How do I keep a HubSpot API token out of AI-generated code in Vercel Sandbox?

Use credentials brokering, a Vercel Sandbox firewall feature available on Pro and Enterprise. Add `api.hubapi.com` to the sandbox's network policy with a `transform` rule that sets the `Authorization` header, and leave the token out of the sandbox's files, environment, and command arguments. The firewall attaches the header as requests leave, so generated code can call the HubSpot API without being able to read the token.

### Do I need a HubSpot Enterprise subscription to test code in Vercel Sandbox against HubSpot?

No. HubSpot standard and development sandboxes require Enterprise, but a standard account can create up to 10 developer test accounts. Load sample records into a test account and target it from Vercel Sandbox. Test accounts can't sync data from other accounts.

## Related Resources

- [Vercel Sandbox vs E2B](/kb/guide/vercel-sandbox-vs-e2b): Compare Vercel Sandbox and E2B as AI agent sandboxes, including isolation, persistence, network controls, SDKs, and deployment regions.
- [Run a marketing team from Slack with eve](/kb/guide/marketing-team-eve): Team of five marketing agents built on eve. The lead routes work to specialists that write long-form into Notion, queue social posts in Typefully, run email in Resend, and audit for SEO, with approvals for anything irreversible.
- [How Vercel Drives work and how to use them](/kb/guide/vercel-drives): Learn how Vercel Drives give Vercel Sandbox persistent, shareable storage, and how to create, mount, snapshot, fork, list, and delete a drive.

## More Vercel Sandbox guides

- [Migrate from E2B to Vercel Sandbox](/kb/guide/migrate-from-e2b-to-vercel-sandbox): Move E2B sandbox code to Vercel Sandbox in TypeScript or Python, from templates and pauses to Volumes, network rules, Secrets, and a staged cutover.
- [Vercel Sandbox vs CodeSandbox](/kb/guide/vercel-sandbox-vs-codesandbox): Compare Vercel Sandbox and CodeSandbox as AI agent sandboxes, including isolation, persistence, network controls, SDKs, and workload fit.
- [Migrate from Modal Sandboxes to Vercel Sandbox](/kb/guide/migrate-from-modal-sandboxes-to-vercel-sandbox): Migrate from Modal Sandboxes to Vercel Sandbox in TypeScript or Python, including images, persistent files, network policies, and a staged cutover.

## Reference Architecture

Choose a stack and work through the decisions behind it, with curated documentation, guides, templates, and courses to help you build.

- [Agent stack](/kb/architecture/agents): Build and operate agents with models, tools, and durable workflows.
- [Web applications](/kb/architecture/web): Choose rendering, data, authentication, and caching approaches.
- [Backends](/kb/architecture/backends): Choose a runtime, connect services, and run background work.

[Browse all stacks](/kb/architecture)

## Build with prompts

Build an app, extend an agent, or improve your project with ready-to-use prompts for your coding agent.

[Browse the prompt library](/kb/prompts) · [Read the Markdown index](/kb/prompts.md)

## Search guides from your terminal

Search the Knowledge Base and read guides as Markdown with the Vercel CLI. No login required.

```bash
# Find guides by keyword
npx vercel@latest kb search "rewrites and redirects"
npx vercel@latest kb search "AI SDK streaming"

# Show the latest guides
npx vercel@latest kb

# Print a guide as Markdown, by slug or URL
npx vercel@latest kb inspect <guide>
```
