Repository navigation
Sandbox interface: a probed level, and a user-level default (TD-5294, TD-5295) - #122
Merged
Merged
Conversation
…skips an ask
New core/tstd/sandbox/: a SandboxBackend protocol, BackendStatus (backend,
full / partial / none, gaps against a fixed promise list, and why it cannot
run) and a per-process probe cache. The bubblewrap probe starts a real
sandbox and then checks whether a command inside can map root in a user
namespace of its own; if it can, or that cannot be checked, the level is
partial with the pins named as the gap.
The probe runs once off the loop at daemon start, again when Doctor opens
and again after bubblewrap itself fails to start a command. auto_allow now
promotes only under full, and a promised call is refused if the level
dropped before it ran. The result note names backend and level. Doctor has
a sandbox row, and an approval card for a shell call carries a sandbox
object with one line ("Runs in the sandbox (bwrap, full)", partial with its
gaps, or "Runs on your computer, outside the sandbox").
CI sets TST_REQUIRE_SANDBOX=1 so the real-run tests fail rather than skip.
The bwrap argv is unchanged. Class B entry in DECISIONS.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… quietly turn it off The daemon's config gains a sandbox: section (SandboxDefaults: default off | on | require, on_partial ask | refuse, auto_allow, hidden_paths). The shipped default stays off. A workspace's sandbox.enabled becomes bool | None, None following the default, and shell_sandbox.effective merges the two on every boundary reload: what the workspace says wins, auto-run is on when either asks for it, hidden paths add up. Under on or require, a workspace file's enabled: false, a non-empty exclude and auto_allow: true are loosenings that wait for the trust card; the trust store carries the user's default for that. Under off nothing changes from TD-5138. In a partial sandbox, a command that would have run unasked asks, naming the gap; on_partial: refuse and require refuse it. A bare YAML off / on reads as the word. Class B entry in DECISIONS.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
captcrock
force-pushed
the
td/5294-sandbox-interface
branch
from
November 23, 2026 21:56
bee6582 to
6a3d459
Compare
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.
Milestone: the sandbox interface (R1 of the sandboxing design, approved in the build order).
TD-5294: the sandbox says how strongly it holds
core/tstd/sandbox/: aSandboxBackendprotocol,BackendStatus(full/partial/none, gaps against a fixed promise list, and the fix), and a probe cache.partialwith the pins named.auto_allowpromotes only when the level is full. A promised call is refused if the level dropped in between.sandboxrow. Approval cards for shell calls carry one line saying what the command runs in.TST_REQUIRE_SANDBOX=1, so the real-run sandbox tests fail instead of skipping.session.py,loop.pyanddaemon.pynow match the autonomy container module they were written to keep out.TD-5295: a user-level default
sandbox:in the daemon config:default(off / on / require),on_partial,auto_allow,hidden_paths. The shipped default staysoff.onorrequire, a repo'senabled: false,excludeorauto_allowwaits for the trust card.refuseandrequirerefuse it.Checks
TST_REQUIRE_SANDBOX=1. The 4 failures from that run (the over-broad guard tests, and a merge that didn't keepNone) are fixed; their files pass (127 tests). ruff and mypy are clean.🤖 Generated with Claude Code