Skip to content

Add HTTP Host pinning shorthand to sandbox network policies - #352

Draft
roboeve[bot] wants to merge 1 commit into
mainfrom
feat/sandbox-http-only-host
Draft

roboeve[bot] wants to merge 1 commit into
mainfrom
feat/sandbox-http-only-host

Conversation

@roboeve

@roboeve roboeve Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Allow SDK callers to pin an allowed domain's outgoing HTTP Host header with { httpOnly: true }, without writing a transform manually.

Why

A domain allow-list alone does not pin the HTTP Host header. Callers can already express the necessary transform, but the security-sensitive configuration is easy to omit.

Approach

Add httpOnly: true as a mutually exclusive SDK rule action. The shared network-policy serializer expands it to { transform: [{ headers: { Host: domain } }] } before validating and sending the API request, so create, fork, and policy updates use the existing wire behavior. Reject wildcard domains because they cannot be pinned to one exact Host value. The original policy is not mutated. The shorthand applies to matching requests, following normal rule ordering.

Validation

  • pnpm --filter @vercel/sandbox exec vitest run src/utils/network-policy.test.ts (36 passed)
  • pnpm --filter @vercel/sandbox test (346 passed, 81 skipped before the final extra edge-case test)
  • pnpm --filter @vercel/sandbox typecheck (passed)
  • pnpm --filter @vercel/sandbox build (passed)
  • Prettier check and git diff --check (passed)

@vercel

vercel Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sandbox Ready Ready Preview, v0 Sep 27, 2026 4:56pm UTC
sandbox-sdk-ai-example Ready Ready Preview, v0 Sep 27, 2026 4:56pm UTC
workflow-code-runner Ready Ready Preview, v0 Sep 27, 2026 4:56pm UTC

This branch was successfully deployed

4 active deployments
Preview – sandbox — 53eff673 Deployed Sep 27, 2026 by vercel[bot]
Preview – sandbox-sdk-ai-example — 53eff673 Deployed Sep 27, 2026 by vercel[bot]
Preview – workflow-code-runner — 53eff673 Deployed Sep 27, 2026 by vercel[bot]
Preview – sandbox-cli — 53eff673 Deployed Sep 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants