feat(sdk): add L7 request matchers and forward URLs to network policies#173
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
tutman96
approved these changes
May 6, 2026
QuiiBz
added a commit
that referenced
this pull request
May 6, 2026
Follow-up to #173, update the network policies requests to use the V2 schema, which supports matchers and forward URLs For now, the API responses are still under the V1 schema, because changing it would be a breaking change. Only the requests are using the V2 schema with this PR, which greatly simplifies `toAPINetworkPolicy`
Merged
LukeSheard
pushed a commit
that referenced
this pull request
May 7, 2026
…es (#173) This PR adds support for L7 requests matcher and forward URLs in network policies⚠️ A follow-up PR will update to support the V2 API schema for network policies, which will clean up the `toAPINetworkPolicy` / `fromAPINetworkPolicy` logic ### Request matchers For each `NetworkPolicyRule`, you can apply a matcher on: - the request method - the request path - the request query strings - the request headers Each matcher can target to either exactly match, start with, or regex match, a provided value. For example, to inject an authorization header on requests to Vercel's AI gateway but only on specific requests: ``` allow: { "ai-gateway.vercel.sh": [ { match: { method: ["POST"], path: { startsWith: "/v1/" }, headers: [ { key: { exact: "x-api-key" }, value: { exact: "placeholder" } } ] }, transform: [{ headers: { authorization: "Bearer ..." } }] } ], "*": [] } ``` ### Forward URLs For each `NetworkPolicyRule`, you can define a `forwardURL` field that serves as an HTTPS proxy to forward matching requests to. Since it's a `NetworkPolicyRule`, you can also define matchers on it: ``` allow: { "ai-gateway.vercel.sh": [ { match: { method: ["POST"], path: { startsWith: "/v1/" }, headers: [ { key: { exact: "x-api-key" }, value: { exact: "placeholder" } } ] }, forwardURL: 'https://my-proxy.vercel.app' } ], "*": [] } ```
LukeSheard
pushed a commit
that referenced
this pull request
May 7, 2026
Follow-up to #173, update the network policies requests to use the V2 schema, which supports matchers and forward URLs For now, the API responses are still under the V1 schema, because changing it would be a breaking change. Only the requests are using the V2 schema with this PR, which greatly simplifies `toAPINetworkPolicy`
QuiiBz
added a commit
that referenced
this pull request
May 8, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to named-sandboxes, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `named-sandboxes` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `named-sandboxes`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @vercel/sandbox@2.0.0-beta.18 ### Minor Changes - Add L7 request matchers and forward URLs support to network policy rules. ([#173](#173)) ## sandbox@3.0.0-beta.20 ### Patch Changes - Updated dependencies \[[`0c62cab5ab16af355ca57d1a19ab1e6e70899060`](0c62cab)]: - @vercel/sandbox@2.0.0-beta.18 ## sandbox-filesystem-snapshots@0.0.17-beta.0 ### Patch Changes - Updated dependencies \[[`0c62cab5ab16af355ca57d1a19ab1e6e70899060`](0c62cab)]: - @vercel/sandbox@2.0.0-beta.18 ## workflow-code-runner@0.1.6-beta.0 ### Patch Changes - Updated dependencies \[[`0c62cab5ab16af355ca57d1a19ab1e6e70899060`](0c62cab)]: - @vercel/sandbox@2.0.0-beta.18 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Tom Lienard <tom.lienrd@gmail.com>
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
…es (#173) This PR adds support for L7 requests matcher and forward URLs in network policies⚠️ A follow-up PR will update to support the V2 API schema for network policies, which will clean up the `toAPINetworkPolicy` / `fromAPINetworkPolicy` logic ### Request matchers For each `NetworkPolicyRule`, you can apply a matcher on: - the request method - the request path - the request query strings - the request headers Each matcher can target to either exactly match, start with, or regex match, a provided value. For example, to inject an authorization header on requests to Vercel's AI gateway but only on specific requests: ``` allow: { "ai-gateway.vercel.sh": [ { match: { method: ["POST"], path: { startsWith: "/v1/" }, headers: [ { key: { exact: "x-api-key" }, value: { exact: "placeholder" } } ] }, transform: [{ headers: { authorization: "Bearer ..." } }] } ], "*": [] } ``` ### Forward URLs For each `NetworkPolicyRule`, you can define a `forwardURL` field that serves as an HTTPS proxy to forward matching requests to. Since it's a `NetworkPolicyRule`, you can also define matchers on it: ``` allow: { "ai-gateway.vercel.sh": [ { match: { method: ["POST"], path: { startsWith: "/v1/" }, headers: [ { key: { exact: "x-api-key" }, value: { exact: "placeholder" } } ] }, forwardURL: 'https://my-proxy.vercel.app' } ], "*": [] } ```
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
Follow-up to #173, update the network policies requests to use the V2 schema, which supports matchers and forward URLs For now, the API responses are still under the V1 schema, because changing it would be a breaking change. Only the requests are using the V2 schema with this PR, which greatly simplifies `toAPINetworkPolicy`
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
…es (#173) This PR adds support for L7 requests matcher and forward URLs in network policies⚠️ A follow-up PR will update to support the V2 API schema for network policies, which will clean up the `toAPINetworkPolicy` / `fromAPINetworkPolicy` logic ### Request matchers For each `NetworkPolicyRule`, you can apply a matcher on: - the request method - the request path - the request query strings - the request headers Each matcher can target to either exactly match, start with, or regex match, a provided value. For example, to inject an authorization header on requests to Vercel's AI gateway but only on specific requests: ``` allow: { "ai-gateway.vercel.sh": [ { match: { method: ["POST"], path: { startsWith: "/v1/" }, headers: [ { key: { exact: "x-api-key" }, value: { exact: "placeholder" } } ] }, transform: [{ headers: { authorization: "Bearer ..." } }] } ], "*": [] } ``` ### Forward URLs For each `NetworkPolicyRule`, you can define a `forwardURL` field that serves as an HTTPS proxy to forward matching requests to. Since it's a `NetworkPolicyRule`, you can also define matchers on it: ``` allow: { "ai-gateway.vercel.sh": [ { match: { method: ["POST"], path: { startsWith: "/v1/" }, headers: [ { key: { exact: "x-api-key" }, value: { exact: "placeholder" } } ] }, forwardURL: 'https://my-proxy.vercel.app' } ], "*": [] } ```
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
Follow-up to #173, update the network policies requests to use the V2 schema, which supports matchers and forward URLs For now, the API responses are still under the V1 schema, because changing it would be a breaking change. Only the requests are using the V2 schema with this PR, which greatly simplifies `toAPINetworkPolicy`
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
…es (#173) This PR adds support for L7 requests matcher and forward URLs in network policies⚠️ A follow-up PR will update to support the V2 API schema for network policies, which will clean up the `toAPINetworkPolicy` / `fromAPINetworkPolicy` logic ### Request matchers For each `NetworkPolicyRule`, you can apply a matcher on: - the request method - the request path - the request query strings - the request headers Each matcher can target to either exactly match, start with, or regex match, a provided value. For example, to inject an authorization header on requests to Vercel's AI gateway but only on specific requests: ``` allow: { "ai-gateway.vercel.sh": [ { match: { method: ["POST"], path: { startsWith: "/v1/" }, headers: [ { key: { exact: "x-api-key" }, value: { exact: "placeholder" } } ] }, transform: [{ headers: { authorization: "Bearer ..." } }] } ], "*": [] } ``` ### Forward URLs For each `NetworkPolicyRule`, you can define a `forwardURL` field that serves as an HTTPS proxy to forward matching requests to. Since it's a `NetworkPolicyRule`, you can also define matchers on it: ``` allow: { "ai-gateway.vercel.sh": [ { match: { method: ["POST"], path: { startsWith: "/v1/" }, headers: [ { key: { exact: "x-api-key" }, value: { exact: "placeholder" } } ] }, forwardURL: 'https://my-proxy.vercel.app' } ], "*": [] } ```
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
Follow-up to #173, update the network policies requests to use the V2 schema, which supports matchers and forward URLs For now, the API responses are still under the V1 schema, because changing it would be a breaking change. Only the requests are using the V2 schema with this PR, which greatly simplifies `toAPINetworkPolicy`
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
…es (#173) This PR adds support for L7 requests matcher and forward URLs in network policies⚠️ A follow-up PR will update to support the V2 API schema for network policies, which will clean up the `toAPINetworkPolicy` / `fromAPINetworkPolicy` logic ### Request matchers For each `NetworkPolicyRule`, you can apply a matcher on: - the request method - the request path - the request query strings - the request headers Each matcher can target to either exactly match, start with, or regex match, a provided value. For example, to inject an authorization header on requests to Vercel's AI gateway but only on specific requests: ``` allow: { "ai-gateway.vercel.sh": [ { match: { method: ["POST"], path: { startsWith: "/v1/" }, headers: [ { key: { exact: "x-api-key" }, value: { exact: "placeholder" } } ] }, transform: [{ headers: { authorization: "Bearer ..." } }] } ], "*": [] } ``` ### Forward URLs For each `NetworkPolicyRule`, you can define a `forwardURL` field that serves as an HTTPS proxy to forward matching requests to. Since it's a `NetworkPolicyRule`, you can also define matchers on it: ``` allow: { "ai-gateway.vercel.sh": [ { match: { method: ["POST"], path: { startsWith: "/v1/" }, headers: [ { key: { exact: "x-api-key" }, value: { exact: "placeholder" } } ] }, forwardURL: 'https://my-proxy.vercel.app' } ], "*": [] } ```
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
Follow-up to #173, update the network policies requests to use the V2 schema, which supports matchers and forward URLs For now, the API responses are still under the V1 schema, because changing it would be a breaking change. Only the requests are using the V2 schema with this PR, which greatly simplifies `toAPINetworkPolicy`
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to named-sandboxes, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `named-sandboxes` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `named-sandboxes`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @vercel/sandbox@2.0.0-beta.18 ### Minor Changes - Add L7 request matchers and forward URLs support to network policy rules. ([#173](#173)) ## sandbox@3.0.0-beta.20 ### Patch Changes - Updated dependencies \[[`0c62cab5ab16af355ca57d1a19ab1e6e70899060`](0c62cab)]: - @vercel/sandbox@2.0.0-beta.18 ## sandbox-filesystem-snapshots@0.0.17-beta.0 ### Patch Changes - Updated dependencies \[[`0c62cab5ab16af355ca57d1a19ab1e6e70899060`](0c62cab)]: - @vercel/sandbox@2.0.0-beta.18 ## workflow-code-runner@0.1.6-beta.0 ### Patch Changes - Updated dependencies \[[`0c62cab5ab16af355ca57d1a19ab1e6e70899060`](0c62cab)]: - @vercel/sandbox@2.0.0-beta.18 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Tom Lienard <tom.lienrd@gmail.com>
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
…es (#173) This PR adds support for L7 requests matcher and forward URLs in network policies⚠️ A follow-up PR will update to support the V2 API schema for network policies, which will clean up the `toAPINetworkPolicy` / `fromAPINetworkPolicy` logic ### Request matchers For each `NetworkPolicyRule`, you can apply a matcher on: - the request method - the request path - the request query strings - the request headers Each matcher can target to either exactly match, start with, or regex match, a provided value. For example, to inject an authorization header on requests to Vercel's AI gateway but only on specific requests: ``` allow: { "ai-gateway.vercel.sh": [ { match: { method: ["POST"], path: { startsWith: "/v1/" }, headers: [ { key: { exact: "x-api-key" }, value: { exact: "placeholder" } } ] }, transform: [{ headers: { authorization: "Bearer ..." } }] } ], "*": [] } ``` ### Forward URLs For each `NetworkPolicyRule`, you can define a `forwardURL` field that serves as an HTTPS proxy to forward matching requests to. Since it's a `NetworkPolicyRule`, you can also define matchers on it: ``` allow: { "ai-gateway.vercel.sh": [ { match: { method: ["POST"], path: { startsWith: "/v1/" }, headers: [ { key: { exact: "x-api-key" }, value: { exact: "placeholder" } } ] }, forwardURL: 'https://my-proxy.vercel.app' } ], "*": [] } ```
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
Follow-up to #173, update the network policies requests to use the V2 schema, which supports matchers and forward URLs For now, the API responses are still under the V1 schema, because changing it would be a breaking change. Only the requests are using the V2 schema with this PR, which greatly simplifies `toAPINetworkPolicy`
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to named-sandboxes, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `named-sandboxes` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `named-sandboxes`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @vercel/sandbox@2.0.0-beta.18 ### Minor Changes - Add L7 request matchers and forward URLs support to network policy rules. ([#173](#173)) ## sandbox@3.0.0-beta.20 ### Patch Changes - Updated dependencies \[[`0c62cab5ab16af355ca57d1a19ab1e6e70899060`](0c62cab)]: - @vercel/sandbox@2.0.0-beta.18 ## sandbox-filesystem-snapshots@0.0.17-beta.0 ### Patch Changes - Updated dependencies \[[`0c62cab5ab16af355ca57d1a19ab1e6e70899060`](0c62cab)]: - @vercel/sandbox@2.0.0-beta.18 ## workflow-code-runner@0.1.6-beta.0 ### Patch Changes - Updated dependencies \[[`0c62cab5ab16af355ca57d1a19ab1e6e70899060`](0c62cab)]: - @vercel/sandbox@2.0.0-beta.18 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Tom Lienard <tom.lienrd@gmail.com>
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
…es (#173) This PR adds support for L7 requests matcher and forward URLs in network policies⚠️ A follow-up PR will update to support the V2 API schema for network policies, which will clean up the `toAPINetworkPolicy` / `fromAPINetworkPolicy` logic ### Request matchers For each `NetworkPolicyRule`, you can apply a matcher on: - the request method - the request path - the request query strings - the request headers Each matcher can target to either exactly match, start with, or regex match, a provided value. For example, to inject an authorization header on requests to Vercel's AI gateway but only on specific requests: ``` allow: { "ai-gateway.vercel.sh": [ { match: { method: ["POST"], path: { startsWith: "/v1/" }, headers: [ { key: { exact: "x-api-key" }, value: { exact: "placeholder" } } ] }, transform: [{ headers: { authorization: "Bearer ..." } }] } ], "*": [] } ``` ### Forward URLs For each `NetworkPolicyRule`, you can define a `forwardURL` field that serves as an HTTPS proxy to forward matching requests to. Since it's a `NetworkPolicyRule`, you can also define matchers on it: ``` allow: { "ai-gateway.vercel.sh": [ { match: { method: ["POST"], path: { startsWith: "/v1/" }, headers: [ { key: { exact: "x-api-key" }, value: { exact: "placeholder" } } ] }, forwardURL: 'https://my-proxy.vercel.app' } ], "*": [] } ```
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
Follow-up to #173, update the network policies requests to use the V2 schema, which supports matchers and forward URLs For now, the API responses are still under the V1 schema, because changing it would be a breaking change. Only the requests are using the V2 schema with this PR, which greatly simplifies `toAPINetworkPolicy`
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to named-sandboxes, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `named-sandboxes` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `named-sandboxes`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @vercel/sandbox@2.0.0-beta.18 ### Minor Changes - Add L7 request matchers and forward URLs support to network policy rules. ([#173](#173)) ## sandbox@3.0.0-beta.20 ### Patch Changes - Updated dependencies \[[`0c62cab5ab16af355ca57d1a19ab1e6e70899060`](0c62cab)]: - @vercel/sandbox@2.0.0-beta.18 ## sandbox-filesystem-snapshots@0.0.17-beta.0 ### Patch Changes - Updated dependencies \[[`0c62cab5ab16af355ca57d1a19ab1e6e70899060`](0c62cab)]: - @vercel/sandbox@2.0.0-beta.18 ## workflow-code-runner@0.1.6-beta.0 ### Patch Changes - Updated dependencies \[[`0c62cab5ab16af355ca57d1a19ab1e6e70899060`](0c62cab)]: - @vercel/sandbox@2.0.0-beta.18 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Tom Lienard <tom.lienrd@gmail.com>
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
…es (#173) This PR adds support for L7 requests matcher and forward URLs in network policies⚠️ A follow-up PR will update to support the V2 API schema for network policies, which will clean up the `toAPINetworkPolicy` / `fromAPINetworkPolicy` logic ### Request matchers For each `NetworkPolicyRule`, you can apply a matcher on: - the request method - the request path - the request query strings - the request headers Each matcher can target to either exactly match, start with, or regex match, a provided value. For example, to inject an authorization header on requests to Vercel's AI gateway but only on specific requests: ``` allow: { "ai-gateway.vercel.sh": [ { match: { method: ["POST"], path: { startsWith: "/v1/" }, headers: [ { key: { exact: "x-api-key" }, value: { exact: "placeholder" } } ] }, transform: [{ headers: { authorization: "Bearer ..." } }] } ], "*": [] } ``` ### Forward URLs For each `NetworkPolicyRule`, you can define a `forwardURL` field that serves as an HTTPS proxy to forward matching requests to. Since it's a `NetworkPolicyRule`, you can also define matchers on it: ``` allow: { "ai-gateway.vercel.sh": [ { match: { method: ["POST"], path: { startsWith: "/v1/" }, headers: [ { key: { exact: "x-api-key" }, value: { exact: "placeholder" } } ] }, forwardURL: 'https://my-proxy.vercel.app' } ], "*": [] } ```
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
Follow-up to #173, update the network policies requests to use the V2 schema, which supports matchers and forward URLs For now, the API responses are still under the V1 schema, because changing it would be a breaking change. Only the requests are using the V2 schema with this PR, which greatly simplifies `toAPINetworkPolicy`
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to named-sandboxes, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `named-sandboxes` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `named-sandboxes`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @vercel/sandbox@2.0.0-beta.18 ### Minor Changes - Add L7 request matchers and forward URLs support to network policy rules. ([#173](#173)) ## sandbox@3.0.0-beta.20 ### Patch Changes - Updated dependencies \[[`0c62cab5ab16af355ca57d1a19ab1e6e70899060`](0c62cab)]: - @vercel/sandbox@2.0.0-beta.18 ## sandbox-filesystem-snapshots@0.0.17-beta.0 ### Patch Changes - Updated dependencies \[[`0c62cab5ab16af355ca57d1a19ab1e6e70899060`](0c62cab)]: - @vercel/sandbox@2.0.0-beta.18 ## workflow-code-runner@0.1.6-beta.0 ### Patch Changes - Updated dependencies \[[`0c62cab5ab16af355ca57d1a19ab1e6e70899060`](0c62cab)]: - @vercel/sandbox@2.0.0-beta.18 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Tom Lienard <tom.lienrd@gmail.com>
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
…es (#173) This PR adds support for L7 requests matcher and forward URLs in network policies⚠️ A follow-up PR will update to support the V2 API schema for network policies, which will clean up the `toAPINetworkPolicy` / `fromAPINetworkPolicy` logic ### Request matchers For each `NetworkPolicyRule`, you can apply a matcher on: - the request method - the request path - the request query strings - the request headers Each matcher can target to either exactly match, start with, or regex match, a provided value. For example, to inject an authorization header on requests to Vercel's AI gateway but only on specific requests: ``` allow: { "ai-gateway.vercel.sh": [ { match: { method: ["POST"], path: { startsWith: "/v1/" }, headers: [ { key: { exact: "x-api-key" }, value: { exact: "placeholder" } } ] }, transform: [{ headers: { authorization: "Bearer ..." } }] } ], "*": [] } ``` ### Forward URLs For each `NetworkPolicyRule`, you can define a `forwardURL` field that serves as an HTTPS proxy to forward matching requests to. Since it's a `NetworkPolicyRule`, you can also define matchers on it: ``` allow: { "ai-gateway.vercel.sh": [ { match: { method: ["POST"], path: { startsWith: "/v1/" }, headers: [ { key: { exact: "x-api-key" }, value: { exact: "placeholder" } } ] }, forwardURL: 'https://my-proxy.vercel.app' } ], "*": [] } ```
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
Follow-up to #173, update the network policies requests to use the V2 schema, which supports matchers and forward URLs For now, the API responses are still under the V1 schema, because changing it would be a breaking change. Only the requests are using the V2 schema with this PR, which greatly simplifies `toAPINetworkPolicy`
LukeSheard
pushed a commit
that referenced
this pull request
May 11, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to named-sandboxes, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `named-sandboxes` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `named-sandboxes`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @vercel/sandbox@2.0.0-beta.18 ### Minor Changes - Add L7 request matchers and forward URLs support to network policy rules. ([#173](#173)) ## sandbox@3.0.0-beta.20 ### Patch Changes - Updated dependencies \[[`0c62cab5ab16af355ca57d1a19ab1e6e70899060`](0c62cab)]: - @vercel/sandbox@2.0.0-beta.18 ## sandbox-filesystem-snapshots@0.0.17-beta.0 ### Patch Changes - Updated dependencies \[[`0c62cab5ab16af355ca57d1a19ab1e6e70899060`](0c62cab)]: - @vercel/sandbox@2.0.0-beta.18 ## workflow-code-runner@0.1.6-beta.0 ### Patch Changes - Updated dependencies \[[`0c62cab5ab16af355ca57d1a19ab1e6e70899060`](0c62cab)]: - @vercel/sandbox@2.0.0-beta.18 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Tom Lienard <tom.lienrd@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for L7 requests matcher and forward URLs in network policies
toAPINetworkPolicy/fromAPINetworkPolicylogicRequest matchers
For each
NetworkPolicyRule, you can apply a matcher on:Each matcher can target to either exactly match, start with, or regex match, a provided value. For example, to inject an authorization header on requests to Vercel's AI gateway but only on specific requests:
Forward URLs
For each
NetworkPolicyRule, you can define aforwardURLfield that serves as an HTTPS proxy to forward matching requests to. Since it's aNetworkPolicyRule, you can also define matchers on it: