Repository navigation
feat(sandbox): startup profile hash, optional-fallback ledger entry, verbose argv, credential list (#750) - #876
Merged
Conversation
…acks in the plugin ledger, add TOLE_VERBOSE launch logging (#750) The start-up line of a sandboxed MCP server now names the profile the server runs in with a short hash, as one sanitized line. An optional server that starts unsandboxed is recorded as a sandbox_fallback line in the plugin ledger, once per server and session. TOLE_VERBOSE=1 prints the redacted bwrap command line to stderr. The doctor SENSITIVE marker covers more credential locations. Design note, threat model, changelog and epics are corrected to match.
…n the verbose launch line (#750) A positional NAME=VALUE (API_KEY=x), one after -e, and --env=NAME=VALUE are redacted like secret-shaped flags. The fallback reason's whitespace split of the lock source is documented as an approximation.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Nov 16, 2026
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.
What
The remaining logging scope of #750: the profile hash in the startup line, a ledger record when an
optionalsandbox falls back to no sandbox, verbose logging of the sandboxed launch command line, a wider credential list for the doctorSENSITIVEmarker, and the design note corrected where it was stale.Why
docs/sandbox-design.md§10 and §11 promised a ledger entry peroptionalfallback and a--verboselaunch line, and #750 asked for the profile hash in the startup log and~/.config/ghin the credential list. None of it existed: the fallback only produced a stderr warning, and the hash went only to the lock and the ledger. The startup line also named the default profile even for a server bound to its own profile.Changes
sandbox/report.rs):mcp[x]: sandboxed (profile <name> sha256:<12 hex>, mode m), usingprofile_for(name)(the profile the server really runs in). The whole line is sanitized to one line.sandbox::fallback_reason(true exactly whereplanfalls back;planis unchanged),plugin_lock::fallback_ledger_line(sandbox_fallback: server, profile, profile_hash, reason of at most 300 sanitized characters, at), andGate::record_fallbackcalled fromGate::checkon a trusted admission. One appended line per server and gate. No fold treats it as an approval, a revoke or a profile record. Never recorded forrequired, unattended runs, skipped or remote servers, or a working backend. The reason comes from the lock source split on whitespace (documented as an approximation).--verboseflag exists, so the existingTOLE_VERBOSEswitch (chore(cli): quiet startup — demote per-run "binary not found" notices #435) is reused, now defined once in core and aliased by tole-cli.redact_argvprints the bwrap command line to stderr only (MCP servers at first start, command consumers per command), redacting the process secret set, values of secret-shaped flags (--token x,--api-key=x) andNAME=VALUEarguments with a secret-shaped name (API_KEY=x,-e API_KEY=x,--env=API_KEY=x). A secret tole does not know under an innocent name is not recognised (documented)..config/gh,.config/glab-cli,.config/op,.password-store,.npmrc,.pypirc,.cargo/credentialsand.cargo/credentials.toml.docs/epics.mdupdated. README status is not stale.Callers and impact (grep, verified by hand):
startup_lineis called bylog_startup_once(mcp.rsstart_server) andreport_tests.rs.Gate::checkis called bytool_roster.rs(two sites, connect-time admit).command_preparedis the one placecommand.rsgets the sandboxed argv. New pub items are additive. Tests to rerun:sandbox::report,sandbox::tests,plugin_lock::tests,plugin::gate::tests,command_sandbox*,mcp_sandbox*,quiet_startup.Testing
cargo fmt --all --check,clippy --workspace --all-targets --all-features -D warnings, clippy for--no-default-features(core, cli, tui) and cli with shell-tools only, andcargo check -p tole-core --no-default-features --tests: clean, also after merging develop (fix(sandbox): harden the git tool, which runs on the host, when a command consumer is on (#748) #873).cargo test --no-fail-fastwithTOLE_REQUIRE_BWRAP=1in three profiles: default workspace (2647 passed),--no-default-featurescore and cli (2008), shell-tools only (2289); no failures.fallback_reason's mode and unattended check, the ledger-line sanitize, the gate call, the once-per-server dedupe and theNAME=VALUErule.fallback_reasonagrees withplanfor every mode × backend × attendance × skip combination.planrefuses.planis untouched, that every ledger fold ignores the new event, JSON escaping against forged lines, no--setenvleak of server env values, additive public API). The laterNAME=VALUEredaction commit was read by the coordinator. CI: all checks green, Cora Review "No issues found" on the final head; the oneTestfailure seen (tui_streams_approves_cancels_and_leaves_an_ordinary_session, a TUI pty timeout) passed on re-run. cora is not installed here, soscripts/review-local.shwas not run; the CI Cora Review is the gate.