Repository navigation
Description
Finding
Spec #2054's Implementation Decisions say the release summary Session runs "inside the fresh-home bwrap sandbox (binding only Harness binary/credentials and an empty temporary directory …)", and Story 14 asks for "no host filesystem read access". The exception that the Spec branch adds to ADR 0013 says the same. In practice, the release summary sandbox also binds the host's toolchain roots read-only (~/.cargo, ~/.rustup, ~/.nvm, plus $CARGO_HOME, $RUSTUP_HOME and $NVM_DIR), and the written-out Factory skills directory too.
Evidence
src/release/summary.rs(write) builds its sandbox withsandbox::prepare. It passesskills_dir: &crate::skills::written_out()?.src/sandbox.rs(prepare) always callstoolchains_into(request.home, …), which binds every existing root fromtoolchains()read-only.conceal_toolchain_credentialsblanks only Cargo'scredentialsandcredentials.toml.- The Spec review of PR Spec:
thirdshift releaseCommand and Pass for scheduled and on-demand releases #2162 proposed this test intests/release/native.rs. On the Spec branch it fails: the fake Harness can read~/.nvm/host-only.txtfrom inside the sandbox.
#[test]
fn release_summary_sandbox_binds_no_host_toolchain_directories() {
let release = Release::new();
shipped(&release);
let nvm = release.root().join("home/.nvm");
fs::create_dir_all(&nvm).unwrap();
fs::write(nvm.join("host-only.txt"), "host file").unwrap();
let binary = release.bin().join("claude");
fs::remove_file(&binary).unwrap();
write_executable(&binary, &format!(r#"#!/bin/sh
if [ "$1 $2" = 'auth status' ]; then exit 0; fi
cat >/dev/null
if [ -r '{nvm}/host-only.txt' ]; then summary='Host file readable'; else summary='Sealed summary (#2).'; fi
printf '%s\n' '{{"type":"system","subtype":"init","session_id":"release-summary-test"}}'
printf '{{"type":"result","subtype":"success","is_error":false,"result":"%s"}}\n' "$summary"
"#, nvm = nvm.display()));
let output = with_input(command(&release, "").arg("--patch").env_remove("NVM_DIR"), "");
assert!(output.status.success(), "{}", stderr(&output));
let body = release.pr_body("release-0.1.1");
assert!(body.contains("Sealed summary (#2)."), "summary Session read a host toolchain file: {body}");
}cargo test --locked --test release -- release_summary_sandbox_binds_no_host_toolchain_directories panics with summary Session read a host toolchain file.
Raised by
The Spec-axis code review of #2162 (Spec #2054).
Why this needs a decision
This needs a call on how strict the sandbox should be, and on which Harnesses must keep working.
Narrowing the binds is not a safe mechanical fix:
harness_intobinds only the npm package for Kimi Code (dist/main.mjs) and getsnodefrom the bound~/.nvm. Dropping the toolchain binds for the release Session would break release summaries on any npm-installed Harness.- The Rust toolchains (
~/.cargo,~/.rustup) and the skills directory are not needed by any Harness's tool-less summary. Removing just those leaves~/.nvmreadable.
Cargo registry credentials are already blanked, so no known secret is exposed. The gap is between what the Spec and ADR 0013 promise and what the shared sandbox does.
The Day shift should choose one of these:
- Narrow the release sandbox. This could bind only a Harness's own runtime, which would need new per-Harness plumbing in
src/sandbox.rs. - Amend the ADR 0013 exception and the manual to say that read-only toolchain roots, with credentials concealed, are bound.
- Refuse npm-installed Harnesses for release summaries.
Decision
Option 1, kept narrow so it needs no general per-Harness plumbing. The release summary Session keeps the Spec's promise of no host filesystem read access:
- The release summary sandbox binds no toolchain roots (
~/.cargo,~/.rustup,~/.nvm,$CARGO_HOME,$RUSTUP_HOME,$NVM_DIR) and no skills directory. Other Sessions keep today's binds; only the release summary path changes. - When the Harness is npm-installed and needs
node, bind only the resolvednodeexecutable (the canonical pathharness_intowould otherwise reach through~/.nvm) read-only, at the path the Harness expects. Nothing else under~/.nvmis visible. - If
nodecan't be resolved, fail the summary Session so the existing fallback (patchplus non-duplicated generated notes) applies. Don't widen the binds.
Tests: the release_summary_sandbox_binds_no_host_toolchain_directories test above passes, plus a test showing an npm-installed fake Harness still writes the summary with only node bound. Keep the ADR 0013 exception and the manual's wording as they are, since the code now matches them.
Activity
JacobStephens2 commentedon Nov 14, 2026
Investigation Summary
Confirmed against
main(c0b4f35c) and open PR #2162 (issue-2054, implementing Spec #2054):thirdshift releaseCommand and Pass for scheduled and on-demand releases #2162:src/release/summary.rsand the ADR 0013Exception (#653)live on open PR Spec:thirdshift releaseCommand and Pass for scheduled and on-demand releases #2162 and have not landed onmainyet (onmain,src/harness/summary.rsstill runs release summaries unsandboxed).src/sandbox.rslives onmainand is not modified by PR Spec:thirdshift releaseCommand and Pass for scheduled and on-demand releases #2162.src/release/summary.rs(write) callssandbox::prepare(src/sandbox.rs:438-574) withskills_dir: &crate::skills::written_out()?.sandbox::prepareunconditionally bindsrequest.skills_dirread-only (src/sandbox.rs:496) and callstoolchains_into(src/sandbox.rs:497,728-775), which binds every existing directory among$RUSTUP_HOME,~/.rustup,$CARGO_HOME,~/.cargo,$NVM_DIR, and~/.nvmread-only at its host path and prepends discoveredcargo/rustc/node/npm/python3/phpbin directories toPATH(tool_bin_dirs,src/sandbox.rs:808-839).conceal_toolchain_credentials(src/sandbox.rs:780-801) masks only<root>/credentialsand<root>/credentials.toml, leaving any other file under those toolchain roots readable.home_into(src/sandbox.rs:844-933) also binds user-level Harness configs, instructions, and hooks read-only (user_file, such as.claude.json,.claude/settings.json,.claude/hooks,.codex/config.toml,.gemini/settings.json,.grok/settings.json,.config/opencode/opencode.json), whilebase_argv(src/sandbox.rs:688-723) binds/usr,/bin,/sbin,/lib,/lib64,/etc,/usr/local, and/optread-only. This matters becauseagystill permits file reads in summary mode (src/harness/agy.rs:83-86).~/.nvmcannot simply be dropped without a decision:harness_into(src/sandbox.rs:1308-1359) binds only the npm package directory (dist/main.mjs+package.json) forHarness::Kimi(@moonshot-ai/kimi-code) and only the single resolved executable forClaude,Agy,Grok,Muse, andOpenCode. Whennodeis installed vianvm, npm-installed Harnesses rely ontoolchains_intobinding~/.nvm/$NVM_DIRand exposingnodeonPATH.Decision Needed from the Day Shift
Because this touches a trust/security boundary and contradicts the current Spec #2054 / PR #2162 ADR 0013 exception wording, please choose an approach (and whether to fold it into open PR #2162 before merge or fix it in a follow-up PR):
skills_dirandtoolchainsoptional onsandbox::Requestso release summaries omitskills_dir,~/.cargo/$CARGO_HOME, and~/.rustup/$RUSTUP_HOME(none are needed for tool-less summaries), and bind only the resolvednoderuntime binary/directory rather than all of~/.nvm/$NVM_DIR(plus decide whetherhome_into'suser_filemounts should also be omitted or kept for release summaries).thirdshift releaseCommand and Pass for scheduled and on-demand releases #2054, ADR 0013 Exception (agy release summaries can still read local files #653), and the manual: Either dropskills_dirand Rust toolchains while documenting the read-onlynode/nvmbind, or document that the shared sandbox binds read-only toolchain roots with Cargo registry credentials concealed.toolchains_intoandskills_dirfrom release summaries so no host toolchain directory is readable, and refuse (or fall back topatch+ GitHub generated notes on) any Harness requiringnvm/node.thirdshift releaseCommand and Pass for scheduled and on-demand releases #2054thirdshift releaseCommand and Pass for scheduled and on-demand releases #2054