Skip to content
Dashboard

Vercel Sandbox firewall now supports request proxying and filtering

Link to headingRequests proxying

import { Sandbox } from '@vercel/sandbox';
// Sandbox has access to everything, with a proxy for requests towards github.com
const sandbox = await Sandbox.create({
networkPolicy: {
allow: {
"github.com": [{
forwardURL: "https://my-custom-proxy.vercel.app/api/proxy"
}],
// Allow traffic to all other domains. If unset only defined ones are reachable.
"*": []
}
}
});

Link to headingFiltering

import { Sandbox } from '@vercel/sandbox';
// Sandbox has access to everything, with a proxy for requests towards POST github.com/api/*
// Other requests to github.com are allowed and not proxied
const sandbox = await Sandbox.create({
networkPolicy: {
allow: {
"api.github.com": [{
match: {
path: { startsWith: "/v1" },
method: ["POST"]
},
forwardURL: "https://my-custom-proxy.vercel.app/api/proxy"
}],
// Allow traffic to all other domains. If unset only defined ones are reachable.
"*": []
}
}
});