Repository navigation
Conversation
Sandbox.create / SandboxPool.create take network="none" or
network={"allow": [...]}, and hf sandbox create takes --network. The
client checks that the sandbox server applied the policy and refuses the
sandbox otherwise. Requires a sandbox-server release with network policies.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…isor Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort 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 31d6c5e. Configure here.
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. Pages changed in this PR: |
…nores the network policy
The DELETE /v1/sandboxes/{id} route is scoped since sbx-server 0.7.0 and refuses the host token,
so the cleanup failed, the outdated-server error never surfaced, and the unrestricted sandbox stayed
on the host. Also tailor the remedy per mode, and drop the review notes committed by mistake.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…case for 'none', document supervisor limits Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Built from huggingface/sandbox-server@ef31b89 (v0.8.0), which includes huggingface/sandbox-server#32. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wauplin
marked this pull request as ready for review
November 19, 2026 11:40
This branch has not been deployed
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
Sandboxes can now run without internet access, or with access to an allowlist only. This follows the plan from this Slack thread (plan) and covers #5261 for the Sandbox API.
networkargument onSandbox.createandSandboxPool.create:"none", or{"allow": [...]}with IP ranges, IPs (with an optional port) and hostnames.--networkoption onhf sandbox create:none, or a comma-separated allowlist. It also works with--pool.This needs a sandbox-server release with huggingface/sandbox-server#32, then a bump of
SANDBOX_SERVER_SHA256/SANDBOX_SERVER_VERSION. Until then,network=fails with a clear error.Decisions
/etc/hosts.--networkCLI option rather than two flags.run_job/hf jobs run --network(from [Jobs] Option to run a job without outbound network access #5261) need backend support. Keeping a vLLM token inside the server, as the plan mentions, is not done here.Tested end to end on HF Jobs (dedicated and pool) with a build of the new server.
🤖 Generated with Claude Code
Note
Medium Risk
Changes sandbox security boundaries and pins a new sbx-server version; creation fails safely when servers are too old, but policy enforcement depends on correct server rollout and pool host recycling.
Overview
Adds configurable outbound network policies for Sandboxes:
network="none"blocks all egress, or{"allow": [...]}permits only listed TCP destinations (ranges, IPs with ports, or hostnames). The same option works onSandbox.create,SandboxPool.create, andhf sandbox create --network(including pooled sandboxes).Policies are sent to sbx-server 0.8.0 (pinned digest updated) via
SBX_NETWORKon dedicated jobs or the pool create API body. The client verifies the server echoes the policy after create; mismatches (e.g. older hosts) raiseSandboxError, cancel the job where applicable, and for pools delete a wrongly provisioned sandbox before failing.Documentation covers the feature end-to-end (guide, concepts Network policies, CLI reference) and updates isolation/limitation text so unrestricted egress is only the default, not the only mode.
Reviewed by Cursor Bugbot for commit 0ddfe92. Bugbot is set up for automated code reviews on this repo. Configure here.