Skip to content

feat(sandbox): tole doctor lists sandbox grants and startup logs the sandbox decision - #818

Merged
ajianaz merged 2 commits into
developfrom
feat/809-doctor-sandbox
Nov 15, 2026
Merged

ajianaz merged 2 commits into
developfrom
feat/809-doctor-sandbox

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What

tole doctor prints the effective mode, workspace access, network, extra read/write grants and decision of each sandboxed stdio MCP server and each model-command consumer, flagging grants that touch $HOME or credential directories. Each stdio server logs one start-up line with its decision.

Why

The owner could not see from doctor which sensitive paths a sandbox grant exposes, nor, at startup, whether a server ran sandboxed, fell back to unsandboxed (optional, no bwrap) or was refused.

Changes

  • sandbox::report: decide(), sensitive_kind(), doctor_grant_lines(), startup_line() and log_startup_once() (stderr, once per server and process).
  • mcp.rs logs the launch decision through log_startup_once (the optional-fallback warning now prints once per server instead of on every start).
  • doctor.rs prints the grant lines; docs/sandbox-design.md describes them.
  • No new config keys.

Testing

Unit tests with a fake bwrap in a TestDir cover the three decisions, the start-up lines against plan(), and the sensitive-grant listing. fmt, clippy (--workspace --all-targets --all-features -D warnings), tole-core and tole-cli tests, and the --no-default-features lib tests pass. The tole-cli lib tests only compile with the fix from #815.

Closes #809

…sandbox decision

What
`tole doctor` prints the effective mode, workspace access, network, extra
read/write grants and decision of each sandboxed stdio MCP server and each
model-command consumer, flagging grants that touch $HOME or credential
directories. Each stdio server logs one start-up line with its decision.

Why
The owner could not see from doctor which sensitive paths a sandbox grant
exposes, nor, at startup, whether a server ran sandboxed, fell back to
unsandboxed (optional, no bwrap) or was refused.

Changes
- sandbox::report: decide(), sensitive_kind(), doctor_grant_lines(),
  startup_line() and log_startup_once() (stderr, once per server and process).
- mcp.rs logs the launch decision through log_startup_once.
- doctor.rs prints the grant lines; docs/sandbox-design.md describes them.
- No new config keys.

Testing
Unit tests with a fake bwrap in a TestDir cover the three decisions, the
start-up lines against plan(), and the sensitive-grant listing.

Closes #809
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 60014cc into develop Nov 15, 2026
27 of 28 checks passed
@ajianaz
ajianaz deleted the feat/809-doctor-sandbox branch November 20, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(sandbox): tole doctor lists the sensitive grants of each sandboxed server and logs the sandbox decision at startup (#750 part 1)

2 participants