
Full Sandbox egress firewall now available on Hobby plan
Quick Answer
Vercel has introduced full Sandbox egress firewall features on its Hobby plan, enabling network isolation for free-tier users.
Quick Take
This allows developers to control outbound requests securely, attaching secrets to requests without exposing them in code, thus enhancing security for untrusted or AI-generated code.
Key Points
- Hobby plan users can now utilize full Sandbox firewall features for enhanced security.
- Custom network policies can be defined using domain and IP-based rules.
- Secrets are attached to outbound requests, preventing exposure in code.
- Sandbox CLI allows live updates of network policies without restarting.
- Policies reduce data exfiltration risks when running untrusted code.
📖 Reader Mode
~2 min readAll Vercel Sandbox firewall features are now available on the Hobby plan.
This brings the same network isolation that protects production workloads to the free tier, giving Hobby builders control over exactly what leaves the sandbox while keeping secrets out of the code entirely. Because the firewall attaches secrets to outbound requests itself, sandboxed code can call authenticated services like AI Gateway without ever seeing the token.
Define allow-all, deny-all, or custom network policies with domain and IP-based rules, using matchers to scope each rule by path, method, query string, or headers. Custom policies can safely broker credentials or proxy requests through infrastructure you control. To get started, pass a networkPolicy when you create a sandbox.
sandbox.ts
import { Sandbox } from '@vercel/sandbox';
const sandbox = await Sandbox.create({
networkPolicy: {
allow: {
"ai-gateway.vercel.sh": [{
transform: [{
headers: {
"Authorization": `Bearer ${process.env.AI_GATEWAY_TOKEN}`
}
}],
}],
"*": []
}
}
});
A custom policy that brokers an AI Gateway token onto outbound requests.
The Sandbox CLI manages the same policies, letting you update them live without restarting the sandbox.
# Create a sandbox whose egress is limited to Vercel AI Gateway
sandbox create --name my-sandbox --allowed-domain ai-gateway.vercel.sh
# Update the policy live, without restarting the sandbox
sandbox config network-policy my-sandbox --network-policy deny-all
Creating a locked-down sandbox from the terminal, then denying all egress on the fly.
Network policies reduce data exfiltration risk when running untrusted or AI-generated code. Learn more in the Sandbox firewall documentation.
— Originally published at vercel.com
Want this in your inbox every morning?
Daily brief at your local 8am — bilingual EN/中文, free.
More from Vercel AI
See more →
The Agent Stack
The Agent Stack by Vercel AI provides essential building blocks for creating production-grade agents, enabling seamless integration across multiple AI models and secure operations. It features components like AI Gateway for model routing, Workflow SDK for durable execution, and Vercel Connect for scoped access, streamlining agent development and deployment across various platforms.

