Skip to content

sandbox allowed/blocked domains#712

Open
kcoopermiller wants to merge 3 commits into
mainfrom
feature/allowed-domains
Open

sandbox allowed/blocked domains#712
kcoopermiller wants to merge 3 commits into
mainfrom
feature/allowed-domains

Conversation

@kcoopermiller

@kcoopermiller kcoopermiller commented Jun 4, 2026

Copy link
Copy Markdown
Member

Note

Medium Risk
Egress domain controls affect sandbox network security; this PR only extends SDK/CLI request and display fields—actual enforcement depends on the backend.

Overview
Adds allowed_domains and blocked_domains to sandbox create/read models so callers can configure egress domain filtering alongside network_access.

allowed_domains is an allowlist for restricted sandboxes (network_access=false); blocked_domains is a blocklist when outbound network stays enabled. Both are rejected for VM sandboxes. CreateSandboxRequest enforces these rules via Pydantic validators; the prime sandbox create command mirrors them with --allowed-domain / --blocked-domain (repeatable, wildcards documented in help) and shows the lists in the create confirmation and sandbox get detail output (with getattr for older SDK wheels).

Reviewed by Cursor Bugbot for commit c583d27. Bugbot is set up for automated code reviews on this repo. Configure here.

@kcoopermiller kcoopermiller changed the title sandbox allowed domains sandbox allowed/blocked domains Jun 15, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c583d27. Configure here.

vm=vm,
network_access=network_access,
allowed_domains=allowed_domains if allowed_domains else [],
blocked_domains=blocked_domains if blocked_domains else [],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Domain flags omit SDK guard

Medium Severity

prime sandbox create always passes allowed_domains and blocked_domains into CreateSandboxRequest and prints them in the confirmation summary, but unlike idle_timeout_minutes it never checks CreateSandboxRequest.model_fields. An older prime-sandboxes wheel drops unknown fields, so egress allowlists/blocklists can be shown and validated in the CLI yet never reach the API.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c583d27. Configure here.

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.

1 participant