Skip to content

feat(w8): macOS SeatbeltBackend process sandbox - #62

Merged
gitctrlx merged 3 commits into
mainfrom
feat/w8-seatbelt-backend
Aug 12, 2026
Merged

feat(w8): macOS SeatbeltBackend process sandbox#62
gitctrlx merged 3 commits into
mainfrom
feat/w8-seatbelt-backend

Conversation

@gitctrlx

Copy link
Copy Markdown
Member

Summary

  • W8.2b SeatbeltBackend (machi-sandbox, feature seatbelt, macOS): wraps commands with /usr/bin/sandbox-exec; SBPL from SandboxPolicy (workspace RW, net denied by default).
  • Enforcement tests: outside-jail read denied; network denied under default policy; wrap prefixes sandbox-exec.
  • Shell e2e: ShellTool::sandboxed(SeatbeltBackend, …) allows in-jail cat, fails outside (HOME secret).
  • Facade feature seatbeltmachi-sandbox/seatbelt + optional toolkit; re-exports SeatbeltBackend / SANDBOX_EXEC on macOS.

Context

PR #61 landed the port + explicit Shell constructors. This PR is the first real OS backend (not NoSandbox). Landlock (Linux) remains open.

Test plan

  • cargo clippy --workspace --all-features --all-targets -- -D warnings
  • cargo test --workspace --all-features
  • cargo test -p machi-sandbox --features seatbelt (8 tests incl. live seatbelt)
  • cargo test -p machi-toolkit --features seatbelt (Shell seatbelt e2e)
  • CI green on Linux (seatbelt is compile-no-op; macOS legs exercise enforcement)

Ship OS-enforced process isolation for ShellTool via sandbox-exec:
workspace RW + network denied by default; outside-jail reads and
outbound network fail closed. Feature-gated (`seatbelt`); Shell e2e
proves sandboxed() path end-to-end on macOS.
Copilot AI lite review requested due to automatic review settings August 12, 2026 07:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Seatbelt e2e only compiles on macOS; tempfile as a sandbox dev-dep
trips unused-crate-dependencies under CI --all-features on Linux.
@gitctrlx
gitctrlx merged commit 1103a27 into main Aug 12, 2026
1 check passed
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.

2 participants