feat(sandboxes): egress policy allowlist/denylist for VM sandboxes - #797
Merged
Conversation
Breaking release: the network_access boolean is removed from the SDK models and the CLI. Existing clients that still send network_access=true keep working because the platform silently ignores the field; only VM sandboxes accept the new lists. SDK (prime-sandboxes): - network_allowlist/network_denylist on CreateSandboxRequest and the Sandbox response (VM-only, mutually exclusive, client-side canonicalization mirror, 256-entry cap); network_access removed from all models - sync + async get_egress_policy / update_egress_policy(sandbox_id, *, allowlist=None, denylist=None) with EgressPolicyStatus/SandboxEgressPolicy response models, exported from the package CLI (prime): - prime sandbox create: repeatable --network-allow / --network-deny with local conflict + vm-required checks, replacing --network-access/--no-network-access - prime sandbox get-egress-policy / update-egress-policy with --allow/--deny and --allow-all/--deny-all (empty-list states); details view shows the policy Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
DamianB-BitFlipper
requested review from
JannikSt,
JohannesHa,
burnpiro,
kcoopermiller and
willccbb
as code owners
July 18, 2026 02:05
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae065ecf83
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7178a85. Configure here.
kcoopermiller
approved these changes
Jul 22, 2026
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.

Summary
Adds the SDK and CLI surface for the VM sandbox domain-aware egress policy (platform side: PrimeIntellect-ai/platform#3532). VM sandboxes can now be created with, and live-updated to, a hostname/CIDR allowlist or denylist.
This is an intentionally breaking release: the
network_accessboolean is removed from the SDK models and the CLI. Existing clients that still sendnetwork_access=truekeep working — the platform silently ignores the field — so nothing breaks for callers that never touched the feature; only VM sandboxes accept the new lists.SDK (
prime-sandboxes)network_allowlist/network_denylistonCreateSandboxRequestand theSandboxresponse — VM-only, mutually exclusive, with a client-side canonicalization mirror (rejects schemes/ports/paths/bare*/IPv6/misplaced wildcards) and a 256-entry cap.network_accessremoved fromSandbox,CreateSandboxRequest, andUpdateSandboxRequest.get_egress_policy(sandbox_id)andupdate_egress_policy(sandbox_id, *, allowlist=None, denylist=None), returningEgressPolicyStatus(policy + desired/applied generation +applied). New models exported from the package.CLI (
prime)prime sandbox create: repeatable--network-allow/--network-denywith local conflict +--vm-required validation, replacing--network-access/--no-network-access.prime sandbox get-egress-policyandprime sandbox update-egress-policywith--allow/--denyand--allow-all/--deny-all(the two empty-list states). Details view renders the policy instead of the removed boolean.Testing
test_egress_policy.py) covering field validation, mutual exclusion, entry canonicalization/rejection, the rule-count cap, response parsing, and that the removed boolean is gone but old-servernetworkAccesspayloads are ignored.prime-sandboxesandprimesuites match their pre-existing-failure baselines; CLI--helpverified for all new flags/commands.🤖 Generated with Claude Code
Note
Medium Risk
Intentionally breaking SDK/CLI API (
network_accessremoval) plus changes to VM network egress configuration; misconfigured allow/deny lists could block or expose traffic incorrectly.Overview
Breaking change:
network_accessis removed from SDK models and the CLI; VM sandboxes use optionalnetwork_allowlist/network_denylistinstead (mutually exclusive, VM-only, with client-side entry validation and a 256-rule cap).The SDK adds
SandboxEgressPolicyandEgressPolicyStatus, and sync/asyncget_network/set_networkon/sandbox/{id}/egress-policy(full replacement;["*"]maps to allow-all / deny-all empty-list semantics). Responses can still carry legacynetworkAccesswithout breaking parsing.CLI:
prime sandbox creategains repeatable--network-allow/--network-deny(requires--vm); details/JSON show the lists and hide internalvmEgressPolicyfrom advanced configs. Newprime sandbox networkshows or replaces rules with--allow/--denyand warns when policy is not yet applied.Reviewed by Cursor Bugbot for commit 7178a85. Bugbot is set up for automated code reviews on this repo. Configure here.