Repository navigation
Description
Summary
Maka has landed the platform-neutral PermissionProfile model, the permissionMode -> PermissionProfile compiler, SandboxManager, and the macOS Seatbelt backend in #631.
The remaining gap is enforcement: current Bash and file-tool execution does not yet run through the active profile and sandbox boundary. This issue moves the unfinished execution work out of the long-lived documentation TODO and tracks it against current source.
This continues the documentation ownership direction in #767: stable architecture stays near the implementation; progress and migration work stay in issues and PRs.
Current state
Landed:
@maka/coreownsPermissionProfile, standard profiles, matchers, and the permission-mode compiler.@maka/runtimeownsSandboxManager, sandbox selection/transform contracts, and the default manager.- macOS has a Seatbelt policy builder/backend with focused contract and smoke tests.
- Restricted profiles fail closed when a required platform backend is unavailable.
- Linux selection is explicit but returns
backend_not_implemented. danger-full-access, disabled, external, and explicitly forbidden sandbox paths select host execution.
Not landed:
- The existing shell runner still accepts a shell command string and does not execute a transformed
SandboxExecRequest. - Bash does not compile and pass the active
PermissionProfileintoSandboxManager. - File tools do not enforce the same active profile.
PermissionEngineand execution diagnostics do not expose the effective sandbox decision.- Linux has no sandbox backend.
- Unsandboxed retry and managed network proxy remain out of scope unless separately designed.
Required work
1. Establish one argv execution seam
- Add an argv-based process runner that accepts the transformed execution request.
- Preserve bounded stdout/stderr retention, timeout, abort, process-tree cleanup, cwd, and environment behavior.
- Keep shell-string parsing at the Bash tool boundary; do not add a second general shell runner.
2. Route Bash through the active sandbox boundary
- Compile the session permission mode into the active profile.
- Build a
SandboxCommandwith normalized path context. - Transform it through the default
SandboxManager. - Execute only the returned argv request.
- Fail closed when a restricted profile requires an unavailable backend.
3. Enforce the same profile in file tools
- Apply read/write/deny matching to Read, Write, Edit, Glob, and Grep boundaries.
- Normalize paths and resolve symlinks before authorization.
- Preserve protected metadata deny-write behavior.
- Do not create a parallel file-policy system.
4. Align permission decisions and diagnostics
- Keep approval policy separate from sandbox capability.
- Record the effective profile name, sandbox type, selection reason, and typed failure reason.
- Expose only bounded, non-secret diagnostics to model/user-facing context.
- Do not treat sandbox success as permission approval.
5. Add Linux enforcement
- Select and document the Linux backend mechanism before implementation.
- Preserve the same
PermissionProfilesemantics and fail-closed behavior. - Keep Windows explicitly unsupported unless a separate design is approved.
Verification
- Focused unit tests for argv execution, selection, transform, normalized path matching, and failure reasons.
- macOS smoke coverage for allowed workspace writes, blocked outside writes, protected metadata, and restricted network.
- Deterministic Bash integration tests proving the transformed request is the executed request.
- File-tool tests for read-only, workspace-write, deny, symlink escape, and protected metadata.
- Linux backend contract and platform-gated smoke tests when that phase lands.
- Existing permission-mode behavior remains unchanged except for real enforcement.
Non-goals
- Worktree or workspace-copy sandboxing
- Diff/write-back or apply-patch UI
- Windows sandbox support
- Automatic unsandboxed retry
- Managed network proxy or domain allowlists
- A second
PermissionProfile, shell-runner, or file-policy implementation
Documentation closeout
When the implementation changes a stable boundary, update the sandbox architecture README beside the existing implementation. Keep phase progress and TODOs in this issue and its PRs rather than recreating a documentation checklist.
Activity
Astro-Han commentedon Jul 20, 2026
Done and close.