Repository navigation
[Sandbox] Require scoped credentials for pooled sandboxes - #4782
Merged
Merged
Conversation
|
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. |
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.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit dce05c5. Configure here.
Wauplin
marked this pull request as draft
August 31, 2026 13:44
Wauplin
force-pushed
the
security/harden-pool-isolation
branch
from
September 14, 2026 13:04
dce05c5 to
f8505eb
Compare
Wauplin
marked this pull request as ready for review
September 28, 2026 14:32
Contributor
|
This PR has been shipped as part of the v2.1.0 release. |
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
This replaces the original pre-audit implementation in this PR with a focused change on current main. Scoped credentials and internal redirect refusal already landed in #4832 and #4838; only the remaining compatibility fallback is removed here, as requested.
Breaking change: older pool hosts that do not provide scoped tokens must be upgraded/recycled. The currently published and pinned server 0.6.0 already provides them, so this PR needs no new binary pin. The companion server PR removes host-token acceptance on scoped routes entirely: huggingface/sandbox-server#29. Land this client first; release and pin that server afterward. No release is included here.
Validation: 162 sandbox tests passed; sandbox-module mypy passed. make style and make quality were run; formatting/lint/generated checks pass, with the same three unrelated local ty errors and one warning previously reproduced on main.
Manual malformed-token check:
Note
Medium Risk
This is a deliberate credential hardening break: pooled workloads on hosts without scoped tokens will fail until hosts are recycled, but dedicated sandboxes and correctly upgraded pools are unchanged.
Overview
Breaking change for pooled sandboxes: the client no longer substitutes the pool host-management credential when a per-sandbox capability token is missing, empty, or invalid. Shared
Sandboxhandles are constructed with_require_scoped_token, token recovery viasandbox_token()fails on 404 or empty JSON instead of falling back, andproxy_headersalways sends the sandbox-scopedX-Sandbox-Token(never the host token).Docs now state that users must upgrade/recycle older pool hosts, note redirect safety when using
proxy_headers, and clarify that server 0.6.0 may still accept host tokens on scoped routes until compatibility is disabled or the server is upgraded.Tests drop the legacy fallback case and add coverage for invalid tokens and non-fallback token recovery.
Reviewed by Cursor Bugbot for commit e34838e. Bugbot is set up for automated code reviews on this repo. Configure here.