Skip to content

[DOCS] Kernel-confined Bash writes in the CLI sandbox #1233

Closed

Description

@edenreich

Summary

The CLI's sandbox.yaml gains filesystem.enforce (default true). Every Bash command the allow-list runs unattended (in auto mode, every command) runs under an OS sandbox that lets it read and execute anything but write only under the writable allowed paths, the grants, the carve-outs, the temp dir and the Go, cargo and npm caches - Landlock on Linux, Seatbelt on macOS, nothing on Windows. A command the user approved runs as approved, unconfined. On macOS the kernel also refuses to read, rename or delete the files the blocking denied entries name (auth.yaml, *.env, *.key, ...), under any spelling, symlink, copy or clone, while directory entries such as .git/ stay with the path check so git keeps reading its own tree. Linux keeps reads with the path check, since Landlock only grants. Denied entries match case-insensitively, so .ENV is .env on a case-insensitive filesystem. The pages that describe the CLI sandbox and the Bash tool need the new key, the write boundary and the hint a refused write returns.

Example to add, for turning the confinement off where the OS sandbox cannot run:

# ~/.infer/sandbox.yaml
filesystem:
  enforce: false

A refused write returns Operation not permitted (macOS) or Permission denied (Linux) followed by the hint: "the sandbox confines writes to the writable paths of ~/.infer/sandbox.yaml (filesystem.allowed) and refuses to read, rename or delete its denied files (filesystem.denied): work inside them, or ask the user to approve the command or add the path".

Acceptance Criteria

  • cli.md, the file sandbox section (#file-sandbox): documents filesystem.enforce, its default, the platforms it applies to, the writable carve-outs (temp dir, Go, cargo and npm caches) and that an approved command runs unconfined.
  • cli.md, the Bash tool under "Tools & Capabilities": explains the write boundary, the hint on a refused write or read, and that reads of denied files fail in the kernel on macOS while every other read follows the allow-list path check.
  • cli.md, plan mode: the sentence "An allow-listed command can also still reach outside the scratchpad through an absolute path argument: the file tools are the hard boundary, the shell is allowed-list plus approval" now says such a command can still read outside the scratchpad while a write outside it fails in the kernel and, on macOS, so does reading a denied file.
  • cli.md, the file sandbox section: the kernel read denial on macOS (read, rename and delete of the files the blocking denied entries name fail under any spelling, symlink, copy or clone), that directory entries such as .git/ stay with the path check, that Linux keeps reads with the path check, and that denied entries match case-insensitively.
  • cli.md, infer tools validate under "Tools & Capabilities": a command naming a denied path exits non-zero with "access to path '...' is excluded for security" instead of being reported as needing approval.
  • cli.md: a new infer debug section next to infer tools documents infer debug sandbox - the policy table (allowed and denied entries with their effect and what each covers), the built-in carve-outs, the kernel write paths per agent mode, and the files the kernel refuses to read.
  • cli.md, auth.yaml under "Provider API Keys": "agent tools cannot read or edit it" adds that on macOS an unattended Bash command cannot read it either.
  • Source: feat(sandbox): confine bash writes in the kernel cli#1875 (issue [FEATURE] Confine Bash writes in the kernel cli#1874), including its follow-up commits 3472d44b (kernel read denial, case folding) and 255cb315 (infer debug sandbox, tools validate).

Activity

  1. added
    documentation
    on Nov 16, 2026
  2. added theissue type on Nov 16, 2026
  3. edenreich commented on Nov 16, 2026

    @edenreich
    ContributorAuthor

    Amended the summary and acceptance criteria for the follow-up commits that landed in inference-gateway/cli#1875 (3472d44b and 255cb315): the kernel read denial of denied files on macOS, case-insensitive denied entries, the new infer debug sandbox command, and infer tools validate refusing a denied path.

  4. edenreich commented on Nov 16, 2026

    @edenreich
    ContributorAuthor

    @claude can you document this?

  5. inference-gateway-maintainer commented on Nov 16, 2026

    @inference-gateway-maintainer
    Contributor

    Claude finished @edenreich's task in 4m 34s —— View job • docs/issue-1233-20261116-1441 • [Create PR ➔](https://github.com/inference-gateway/docs/compare/main...docs/issue-1233-20261116-1441?quick_pull=1&title=Issue%20%231233%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%231233%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)


    Documented the kernel-confined Bash sandbox

    • Gather context (cli.md sections + the source CLI PR and cmd/debug/debug.go)
    • File sandbox: enforce: true in the example, new Kernel enforcement (filesystem.enforce) subsection - default, platforms (Landlock / Seatbelt / none on Windows), writable set (writable allowed entries, grants, carve-outs, temp dir, Go/cargo/npm caches), plan mode swapping the project for the scratchpad, approved commands running unconfined, the macOS kernel read/rename/delete denial under any spelling, symlink, copy or clone, .git/-style directory entries staying with the path check, Linux keeping reads with the path check, the enforce: false snippet, and the limits (no Landlock, refused ruleset, caches outside the listed ones)
    • Entry forms: denied entries match case-insensitively
    • Bash tool: Kernel-confined writes subsection with the write boundary and the verbatim refusal hint
    • Plan mode: the absolute-path sentence now distinguishes reads from kernel-refused writes and macOS denied reads
    • infer tools validate: a denied path exits non-zero with access to path '...' is excluded for security
    • New Inspecting Internals (infer debug) section next to infer tools, documenting infer debug sandbox (policy table, carve-outs, kernel write paths per mode, refused reads, allow-list sizes) + an infer debug <cmd> row in Core Commands
    • auth.yaml: on macOS an unattended Bash command cannot read it either
    • Validated: bun run lint:md, bun run format:check, bun run build all clean (checked the generated anchor ids and fixed the filesystem.enforce slug)
    • Committed and opened docs: kernel-confined bash writes in the CLI sandbox #1235

    Pull request: #1235

    Not done / worth knowing: I did not run bun run preview for a visual pass (no nav or theme change, and the build renders cleanly), and the except key that infer debug sandbox can print for a denied entry is still undocumented in the sandbox entry-forms table - it was not in the acceptance criteria, so say the word if you want it added.
    • Branch

  6. moved this from Todo to In progress in 2026on Nov 16, 2026
  7. moved this from In progress to QA in 2026on Nov 16, 2026
  8. moved this from QA to Done in 2026on Nov 16, 2026
  9. inference-gateway-releaser commented on Nov 17, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.9.27 🎉

    The release is available on GitHub release

    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

    documentationreleased

    Type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions