Repository navigation
Conversation
…thing else Second R3 PR. sandbox.network: deny | allowlist (deny by default, at user and workspace level; a workspace allowlist waits for trust). With allowlist, a sandboxed command's first process is a stdlib bridge that listens on 127.0.0.1:3128 inside the command's own network namespace, forks a relay and execs the command. The relay gets one connected socket per connection from the daemon over a socket pair handed in before the start (SCM_RIGHTS), and the daemon serves it with the TD-5305 proxy. The seccomp filter is unchanged and nothing on the host listens. The grant ends when the last process in the sandbox does. Real bubblewrap tests: a listed host is reached and audited with its tool call; an unlisted one is 403; with the proxy variables removed a command has no route out at all (the owner's condition); deny, or no hosts, sets no proxy and grants nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
PR 2 of 2 for sandboxing.md R3. The approach was signed off ahead of time, on two conditions: it sits behind a setting, and the network stays fully off by default. It builds on TD-5305's proxy, already merged.
Setting:
sandbox.network: deny | allowlist, at the user level and per workspace.denyis the default.allowlistis a trust loosening, so it waits for the trust card.How it works (Linux, bubblewrap) — design option 1, with the seccomp filter unchanged:
egress.BRIDGE_SOURCE, run withpython -I -S -c). It binds127.0.0.1:3128inside the command's own network namespace, forks a relay, and execs/bin/sh -c <command>.SCM_RIGHTS). The daemon serves that socket withEgressProxy(TD-5305).socket(AF_UNIX)is still refused inside.HTTP(S)_PROXY/ALL_PROXY, never on a command line.network_egress).Tests (
test_sandbox_network.py, real bubblewrap; CI requires it viaTST_REQUIRE_SANDBOX=1). No outside host is contacted: the allowed host is a local server reached through the proxy's connect seam.boundary.networkreason.deny, or no hosts listed, sets no proxy and grants nothing.Limits (documented):
python3; without it the network stays off.Suite: full core suite 9087 passed. The one failure, the outbound-hosts confinement test, is fixed in this PR by listing
sandbox/egress.pywith its reason. ruff and mypy are clean. Release scan: 0 hits.🤖 Generated with Claude Code