Repository navigation
Conversation
smolyn
added a commit
to ubc/ltic-ai-guidelines
that referenced
this pull request
May 27, 2026
Two srt settings files (strict + permissive postures), zsh/bash shell functions for launching Claude inside the sandbox, and a README covering rationale and setup. The configs rely on a new allowAllDomains flag added in a fork of sandbox-runtime (upstream PR: anthropics/sandbox-runtime#283). README documents how to install from ubc/sandbox-runtime#gs/allow-all-domains until that PR lands. Threat model treats filesystem restrictions as the primary boundary; web egress is broadly allowed with explicit denies for the riskiest paths.
3 of 4 tasks
smolyn
force-pushed
the
gs/allow-all-domains
branch
from
June 30, 2026 18:41
e372c47 to
223de24
Compare
When `network.allowAllDomains: true`, filterNetworkRequest short-circuits to allow after the deniedDomains check runs, so explicit denies still take effect. Intended for environments where filesystem restrictions are the primary boundary and enumerating every reachable domain is impractical (e.g. opening web docs lookups in an otherwise locked-down sandbox). The flag is optional and additive: existing configs are unaffected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
smolyn
force-pushed
the
gs/allow-all-domains
branch
from
June 30, 2026 19:27
223de24 to
d20d944
Compare
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ains The injectHosts ⊆ allowedDomains reachability check predates allowAllDomains: with the flag on, every host is reachable, but the validator still demanded allowlist entries the flag makes meaningless — the documented masking recipe (empty allowlist + injectHosts toward GitHub) failed to load without padding allowedDomains. Skip the subset check when allowAllDomains is set. Conversely, add the missing guard for the trap that combination creates: a masked credential with no injectHosts defaults to allowedDomains, which under allowAllDomains is typically empty — masked but injected nowhere, a silent auth failure. That spelling is now a validation error asking for explicit injectHosts. The excludeDomains contradiction checks and the explicit-empty-injectHosts rejection are unchanged.
…k names Upstream's resolved-address guard treats an allow-listed IP literal or localhost name as an explicit choice and skips its checks. The flag's short-circuit made every such destination count as allow-listed, so 169.254.169.254, 127.0.0.1 and localhost were reachable. The flag now covers hostnames only; those destinations still need an allowedDomains entry.
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
Adds an optional
network.allowAllDomains: booleanfield to the config schema. When set,filterNetworkRequestshort-circuits to allow after the existingdeniedDomainscheck runs, so explicit denies still take effect.Motivation
Today the config schema requires
allowedDomainsand rejects"*"/"*.com"-style wildcards (sandbox-config.ts:43-44). For setups that rely on filesystem restrictions as the primary boundary, this means enumerating every domain that might be reached during normal work — for example, looking up docs for a random library — which becomes whack-a-mole. There's already an internal "no network restriction" branch insandbox-manager.ts:670, but it's unreachable from the CLI because the schema mandatesallowedDomainsas an array, and any settings file giveshasNetworkConfig === true.This flag provides an explicit, schema-validated way to opt into allow-all egress while keeping
deniedDomainsas an enforced denylist.Behavior
allowAllDomains: undefinedorfalse(default): unchangedallowAllDomains: true: every host passesfilterNetworkRequestafter thedeniedDomainscheck, so an explicit deny still wins{ "network": { "allowedDomains": [], "deniedDomains": ["gist.github.com"], "allowAllDomains": true } }Changes
src/sandbox/sandbox-config.ts— add the optional field toNetworkConfigSchemawith a description that calls out the deny precedencesrc/sandbox/sandbox-manager.ts— add an early-return infilterNetworkRequestafter the deny looptest/config-validation.test.ts— schema test verifyingallowAllDomains: truevalidates alongsidedeniedDomains+35 lines total, all additive — existing configs are unaffected.
Test plan
pnpm exec tsc --noEmitcleantest/config-validation.test.ts(schema-level): new test passessrt --settings:https://www.npmjs.com/→ reaches origin (403 from npm, not a sandbox block) ✓https://stackoverflow.com/→ 302 ✓https://docs.rs/→ 200 ✓https://gist.github.com/(indeniedDomains) → blocked at proxy ✓denyReadstill blocked ✓🤖 Generated with Claude Code