Skip to content

[FEATURE] Confine Bash writes in the kernel #1874

Description

@edenreich

Summary

The Bash tool's sandbox has been an approval decision. A regex allow-list says which commands run without a prompt, and a path check reads the command's arguments to keep an unattended command off paths outside sandbox.yaml. Nothing confines what a command does once it runs. In auto mode, or after the user approves a command, a write can land anywhere the CLI process can write, and a command that derives a path internally never shows it in its arguments.

Every Bash command the allow-list runs unattended, which in auto mode is every command, should run under an OS sandbox that lets it read and execute anything but write only under the writable allowed paths, the grants, the writable carve-outs, the temp dir and the build caches a toolchain needs. Linux applies a Landlock ruleset on the thread that forks the child, so only the child inherits it, macOS uses Seatbelt, Windows has no equivalent and keeps the path check alone. A command the user approved runs as approved, unconfined, so approving a path outside the sandbox keeps its meaning. The path check stays as the read guard: the kernel cannot tell a tool reading its own token from a command printing it.

Acceptance Criteria

  • sandbox.yaml filesystem.enforce (default true) confines every Bash command the allow-list runs unattended, in auto mode every command, and false turns it off.
  • A command the user approved runs unconfined: approving an allow-listed command that names a path outside the sandbox still lets it run there.
  • A write outside the writable paths fails in the kernel, and the tool result carries a hint naming the policy. A write inside the project still lands.
  • Plan mode confines writes to the scratchpad, the temp dir and the caches.
  • git, gh, go build, go test, cargo and npm keep working under confinement through the temp and cache carve-outs.
  • e2e coverage on Linux proves the kernel refuses an outside write in auto mode.
  • The configuration reference, the tools reference and the sandbox context README describe the boundary and the carve-outs.

Activity

  1. added
    enhancement
    on Nov 16, 2026
  2. moved this from Todo to QA in 2026on Nov 16, 2026
  3. moved this from QA to Done in 2026on Nov 16, 2026
  4. inference-gateway-releaser commented on Nov 16, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.262.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementreleased

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions