Skip to content

docs(cli): restructure the Sandbox reference (hooks, MCP env, org mode selector)#1280

Merged
wenemily merged 5 commits into
mainfrom
docs/sandbox-hooks-mcp-env-enterprise-mode
Jul 9, 2026
Merged

docs(cli): restructure the Sandbox reference (hooks, MCP env, org mode selector)#1280
wenemily merged 5 commits into
mainfrom
docs/sandbox-hooks-mcp-env-enterprise-mode

Conversation

@wenemily

@wenemily wenemily commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Restructures and hardens docs/cli/configuration/sandbox.mdx (EN + JP) for a user-facing audience, and documents the merged sandbox-hardening PRs under AC-618.

Restructure

Reorganized the reference into a clearer reading order, at a level of detail comparable to peer tools' sandbox docs:

  • How OS-level isolation works -- Seatbelt / bubblewrap+seccomp / filtering proxy, kernel-enforced, blocks when unavailable.
  • Isolation modes -- a comparison table for per-command vs whole-process (what runs in the sandbox, how MCP/hooks/subagents are handled, main-process isolation, behavior when isolation is unavailable).
  • Enable and configure the sandbox -- minimal enable snippet, default-access-policy table, full settings reference, and organization controls grouped together.
  • Coverage and enforcement -- per-tool coverage plus what happens when something is blocked (prompts, droid exec, allow-always persistence, TUI indicators).
  • Security limitations -- egress can still leak, writable paths can still be modified, and settings files are non-overridably protected.

Removed internal identifiers and jargon throughout in favor of outcome-based, user-facing language.

Linear tickets

Closes CLI-1148, AC-616, AC-536

  • CLI-1148 (mono#15438): hook commands run inside the sandbox with the Execute proxy/runtime env, and are blocked if the sandbox cannot be established.
  • AC-616 (mono#15582): sandboxed stdio MCP servers run with a minimal environment; ambient host secrets are dropped, keeping only a safe operational allowlist plus keys set in mcp.json.
  • AC-536 (mono#15180): admins can set sandbox.mode (per-command/whole-process) org-wide from Enterprise Controls.

Accuracy fixes (verified against factory-mono)

  • per-command mode also mediates MCP servers, hooks, and subagents (not only shell commands); the real distinction is that it leaves the main Droid process unsandboxed.
  • Settings files (settings.json, hooks.json, mcp.json, org-managed settings, etc.) sit behind a non-overridable deny-write floor, so a sandboxed process cannot modify its own policy.

All changes mirrored to the JP doc.

Not included: AC-564 (mono#15268, whole-process on macOS) since its source PR is not yet merged.

… mode selector

Cover three merged sandbox-hardening PRs:
- CLI-1148 (mono#15438): hook commands run inside the sandbox and fail closed
- AC-616 (mono#15582): sandboxed stdio MCP servers run with a scrubbed env allowlist
- AC-536 (mono#15180): admins can set sandbox.mode org-wide via Enterprise Controls

Mirrored to JP.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@mintlify

mintlify Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
factory 🟢 Ready View Preview Jul 8, 2026, 10:19 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Describe MCP tool sandboxing in terms of outcomes and boundaries rather
than internal mechanics (drop checkNetworkAccess()/checkFileAccess(),
argument inspection, side-effect metadata, and proxy internals). EN + JP.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Add a 'How OS-level isolation works' section (OS primitives per platform,
network proxy, Windows/WSL2 support) and a 'Security limitations' section,
matching the detail level of comparable platform docs. Tighten the MCP
tools bullet and replace repeated 'fail closed' jargon with plain
outcome language. EN + JP.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Reorganize the sandbox doc into concept, isolation modes, enable/configure,
coverage/enforcement, and security limitations; fix per-command mode
description, and note that settings files are non-overridably protected.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@wenemily wenemily changed the title docs(cli): sandboxed hooks, MCP stdio env scrubbing, and org mode selector docs(cli): restructure the Sandbox reference (hooks, MCP env, org mode selector) Jul 9, 2026
@wenemily wenemily marked this pull request as ready for review July 9, 2026 00:18
@factory-droid

factory-droid Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Droid finished @wenemily's task —— View job


Security Review

The restructure is clear and substantially improves the sandbox documentation. A few lines should be tightened to avoid misleading security claims or internal inconsistencies, and the JP page should restore /jp-prefixed links to keep readers in the correct locale.

lukealvoeiro
lukealvoeiro previously approved these changes Jul 9, 2026
Comment thread docs/cli/configuration/sandbox.mdx Outdated
Comment thread docs/cli/configuration/sandbox.mdx Outdated
Comment thread docs/jp/cli/configuration/sandbox.mdx Outdated
Comment thread docs/jp/cli/configuration/sandbox.mdx Outdated
factory-ain3sh
factory-ain3sh previously approved these changes Jul 9, 2026

@factory-ain3sh factory-ain3sh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

Scope the MCP minimal-environment claim to ambient env vars, clarify that
settings-file write protection applies to sandboxed tool processes, and
restore /jp locale prefixes on JP in-text and Related links.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@wenemily wenemily merged commit 101464d into main Jul 9, 2026
4 checks passed
@wenemily wenemily deleted the docs/sandbox-hooks-mcp-env-enterprise-mode branch July 9, 2026 17:01
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.

3 participants