Skip to content

[DOCS] Document the CLI sandbox.yaml policy and drop tools.sandbox #905

Closed

Description

@edenreich

Summary

The CLI's file sandbox moved out of config.yaml into its own userspace policy file, ~/.infer/sandbox.yaml (source PR: inference-gateway/cli#1473). The tools.sandbox.directories and tools.sandbox.protected_paths keys are gone, and infer config set no longer reaches the sandbox. The docs site still describes the old keys.

The new file has one section per resource, today filesystem with two lists:

filesystem:
  allowed:                 # the sandbox. Outside it the user is asked. First match wins.
    - .
    - /tmp
    - path: vendor/
      access: read         # read | write (default write). A write here asks.
  denied:                  # always wins over allowed, a blocking entry over one that asks
    - path: .infer/
      on_violation: approval   # block | approval (default block)
    - .git/
    - "*.env"

What changed for users:

  • Entries are a path string or a map. Allowed entries take access: read|write, denied entries take on_violation: block|approval. Paths are anchored (/abs, ~/x, ., ./x) or patterns matched at any depth (dir/, *.glob, name).
  • Defaults: allowed . and /tmp. Denied .infer/ (approval), .git/, *.env, .environment, auth.yaml, *.key, *.pem, id_rsa, id_dsa, id_ecdsa, id_ed25519.
  • The config dirs (.infer/ and ~/.infer/) ask before every read and write, since their files can hold tokens. Skills, plans, plugins, memory, ~/.infer/tmp and other runtime output stay open through the built-in carve-outs.
  • Only ~/.infer/sandbox.yaml is read. A project .infer/sandbox.yaml is ignored, and the agent's file tools can never write the policy file.
  • A list the file leaves out keeps its default. A file that fails to parse or validate stops infer from starting.
  • When the user approves a denied path, the grant lasts for the session. "Always" persists it into sandbox.yaml, except for paths matched by a denied entry, which stay session-only.
  • INFER_TOOLS_SANDBOX_DIRECTORIES (and the daemon's per-thread sandbox_directories) now adds directories to filesystem.allowed instead of replacing the list.
  • infer init seeds ~/.infer/sandbox.yaml with the defaults.

Affected pages:

  • cli.md: the tools config examples at "Sandbox directories" (infer config set tools.sandbox.directories), the custom tools trust note naming tools.sandbox.directories and tools.sandbox.protected_paths, the config tools sandbox add DIR migration table row, the CI example setting tools.sandbox.directories, the "Protected Paths" section and its links from the auth.yaml and ~/.infer/tmp paragraphs, and the Security section.
  • cli-skills.md: the "Skills sandbox carve-out" section, including "How it relates to tools.sandbox.directories", the tools.sandbox.protected_paths wins bullet and the tools.sandbox.directories: [] note.

The in-repo reference to mirror is docs/configuration-reference.md (the sandbox.yaml entry) and internal/sandbox/README.md in inference-gateway/cli.

Acceptance Criteria

  • No page mentions tools.sandbox.directories, tools.sandbox.protected_paths or infer config set for the sandbox
  • A sandbox section documents ~/.infer/sandbox.yaml with the example above, the entry forms, the defaults and the decision order (denied first with block over approval, then carve-outs, then the first matching allowed entry, then ask)
  • The docs state the config dirs ask before reads and writes, while skills, plans, plugins, memory and runtime output stay open
  • The docs state a project .infer/sandbox.yaml is ignored, an omitted list keeps its default, and an invalid file stops the CLI from starting
  • Grants are described: session-only by default, "always" persists to sandbox.yaml, except for paths matched by a denied entry
  • INFER_TOOLS_SANDBOX_DIRECTORIES is documented as adding allowed directories
  • The "Protected Paths" anchors and the skills carve-out page point at the new sandbox section

Activity

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

    @edenreich
    ContributorAuthor

    @claude can you document this?

  4. inference-gateway-maintainer commented on Oct 2, 2026

    @inference-gateway-maintainer
    Contributor

    Claude finished @edenreich's task in 4m 0s —— View job • docs/issue-905-20261002-1312 • Create PR ➔


    Documented the CLI sandbox.yaml policy

    • Gather context (cli.md, cli-skills.md, cli-hooks.md, plus the upstream internal/sandbox/README.md and configuration-reference.md from the source branch)
    • New File sandbox section in cli.md (/cli/#file-sandbox)
    • Purged tools.sandbox.directories / tools.sandbox.protected_paths / infer config set for the sandbox
    • Updated the skills carve-out in cli-skills.md and the hook path note in cli-hooks.md
    • Repointed the old #protected-paths anchors
    • Validated: bun run format:check, bun run lint:md, bun run build all pass
    • Committed and opened #907

    What the new section covers: the filesystem.allowed / filesystem.denied example, entry forms (access: read|write, on_violation: block|approval), anchored paths vs any-depth patterns, the defaults, the decision order (denied first with block over approval, then carve-outs, then the first matching allowed entry, then ask), the config dirs asking before every read and write while skills/plans/plugins/memory/artifacts/runtime output stay open, loading rules (userspace only, project copy ignored, omitted list keeps its default, invalid file stops startup, the policy file is unwritable by the agent), session vs "always" grants with the denied-entry exception, and INFER_TOOLS_SANDBOX_DIRECTORIES / the daemon's sandbox_directories as additive.

    Also added sandbox.yaml to the configuration-files table and to the infer init seed list - not in the acceptance criteria, but the table listed every other userspace file.

    | Branch

  5. moved this from QA to Done in 2026on Oct 2, 2026
  6. inference-gateway-releaser commented on Oct 4, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.9.21 🎉

    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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions