Repository navigation
fix(tools): restore confined host CLI toolchains - #461
Merged
Merged
Conversation
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
* fix(tools): restore confined host CLI toolchains * test(tools): accept platform-specific sandbox denials
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
* fix(tools): restore confined host CLI toolchains * test(tools): accept platform-specific sandbox denials
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
PATH, then expose only that executable (and the runtime paths it actually needs) read-only; there is nogh/cargobinary allowlist.exec_commandsessions.host(...)egress, credential isolation, workspace/.git/.forge confinement, and destructive-git approval semantics.This fixes the #447 regression: strict read confinement excluded the normal user-installed toolchain/runtime paths, while the default personal host policy must continue to deny network access until an explicit host grant is present. Relative
../command paths and relativePATHentries cannot widen the runtime exception outside the workspace.The implementation does not add implicit GitHub or crates.io access. The command and host names in tests/docs are representative examples; runtime access is derived from the selected executable and explicit egress grants. Standard external-client credential variables are scrubbed from confined children and are not execution or network grants.
Validation
cargo fmt --all -- --check— passcargo clippy --workspace --all-targets --locked -- -D warnings— passcargo test -p forge-tools --lib sandbox::tests --locked -- --nocapture— 18 passedcargo test -p forge-tools --test sandbox_enforcement --locked -- --nocapture— 40 passedcargo test --workspace --all-targets --locked— pass; all suites passed (including 337 forge-tools tests and 1,045 forge-tui tests)cargo build --release --locked --package forge-cli && ./target/release/forge --version— pass;forge 0.1.0-beta.7Platform notes
The real sandbox enforcement tests passed on macOS Seatbelt. Linux bubblewrap path/profile coverage is included in unit tests but was not runnable on this macOS host. The interactive nested Forge PTY reproduced the original macOS harness limitation: Forge itself was already inside a Seatbelt and could not reliably enter a second one; the pre-fix child reported
bash: cargo: command not found(exit 127), andghreached hostgitbut failed with the macOS Xcode developer-tools request. Source-backed sandbox integration tests cover the fixed path without claiming a live network/API result.