Repository navigation
Hide the home from harness shells except an allowlist - #71
Merged
Merged
Conversation
Harness shells ran with `/` read-only and masked a fixed list of credential stores, so a secret in any other home directory (for example a relay's key files) stayed readable. Both the outer bwrap launch and the Codex math-worker permission profile now mask every home around an allowlist: - the launch's workspace, profile, executable and Lean lock; - PATH entries with the installation prefix of each bin directory, every hop of user-owned launcher symlinks and their node package trees; - Lean, cache, tool, retrieval and proof-environment roots the environment names, the default ~/.elan when ELAN_HOME is unset, and DEEPSCIENTIST_MATH_SANDBOX_READ_ROOTS; - a script launcher's #! interpreter; - symlink targets in the workspace and profile (.lake packages, git worktree metadata); - the new readableRoots session option, which solver sessions set to the application root and research tool directory. Credential stores stay masked inside allowed paths, and user-owned link targets outside the home are masked at their real paths. The isolation receipt records homeReadRoots. 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.
Problem
Harness shells (Claude Code, OpenCode, CLI, isolated Codex, the Lean health check, and Codex worker shells) read
/read-only and masked only a fixed list of credential stores (HOST_CREDENTIAL_PATHS). A secret anywhere else in the home stayed readable, for example~/services/sub2api/*.Change
The bwrap launch (
prepareHarnessProcess) and the Codex math-worker permission profile (mathWorkerPermissionConfig) now mask each home around an allowlist (harnessReadRoots+hostPrivateRoots). The allowlist contains:bin(never a home or its.local); every hop of user-owned launcher symlinks; node package trees;~/.elanwhenELAN_HOMEis unset; and the new deployment settingDEEPSCIENTIST_MATH_SANDBOX_READ_ROOTS;#!interpreter;.lake/packages, git worktree metadata);readableRootssession option. Solver sessions (research.ts,agentTeam.ts×2) set it to the app root and the research tool directory, because worker shells runbun <root>/bin/math.tsandout/main/check-lean.js.Credential stores stay masked even inside allowed paths. User-owned link targets outside the home are masked at their real paths; root-owned targets (e.g.
/usr/bin) are left alone. Codex does not reopenreadundernone, so the home is denied entry by entry around the allowed paths. The isolation receipt gainshomeReadRoots.Known limits: only homes are allowlisted.
/data/...content not reached through a home link stays readable, and home entries created after launch are not masked. The sealed (readIsolation) path is unchanged.Verification
tsc --noEmitpasses, andbun scripts/build.tspasses.tests/formalizationReviewCli.test.tsand fail the same way on origin/maind4da8caa.readableRootsstay readable); unit tests forharnessReadRootsandhostPrivateRoots; an updated Codex profile expectation.~/services/sub2api/*,~/.ssh/known_hosts,~/.bashrc,~/.codex/auth.json.codex --version,claude --version,bun ~/theorem-os/bin/math.ts --help, readingout/main/check-lean.js.Not deployed. Running solvers were not touched.
🤖 Generated with Claude Code