chore(claude): grant gh cache write, generic /tmp redirect allow

Add ~/.cache/gh to sandbox allowWrite so gh CLI no longer needs an
XDG_CACHE_HOME=/tmp/... prefix, and replace the five XDG-prefixed allow
entries with two generic `* > /tmp/*` redirect entries that cover any
command capturing output into /tmp. Sync sandbox.md / settings.md /
security.md and normalize the allowWrite path enumerations.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 4.7 committed 2026-04-18 11:23:53 +02:00
1 parent 8c41f40c7a
commit d74b2bf5f7
4 files changed
+13 -18

No files matched your search

+3 -5
View File
@@ -6,12 +6,9 @@
},
"permissions": {
"allow": [
"Bash(* > /tmp/*)",
"Bash(* > /tmp/* 2>&1)",
"Bash(PYTHONPATH=* python *)",
"Bash(XDG_CACHE_HOME=* gh api *)",
"Bash(XDG_CACHE_HOME=* gh issue list *)",
"Bash(XDG_CACHE_HOME=* gh run download *)",
"Bash(XDG_CACHE_HOME=* gh run list *)",
"Bash(XDG_CACHE_HOME=* gh run view *)",
"Bash(docker *)",
"Bash(echo *)",
"Bash(gh api *)",
@@ -165,6 +162,7 @@
".",
"/tmp",
"~/.ansible",
"~/.cache/gh",
"~/.cache/pip",
"~/.cache/pre-commit",
"~/.venvs"
@@ -53,6 +53,7 @@ The agent MAY write to the paths listed in `sandbox.filesystem.allowWrite`. All
| `/tmp` | The **only** location outside the repository where transient agent output (downloaded logs, scratch files, intermediate artefacts) MAY be written; see the *Temporary Files* rule in [`AGENTS.md`](../../../../../AGENTS.md). |
| `~/.cache/pre-commit` | Cache directory used by the [pre-commit](https://pre-commit.com/) framework. Granted because pre-commit hooks run on every commit and need to populate and read this cache; without it, every commit attempt would fail with `Read-only file system`. The cache contains only hook tool installations, no project data. |
| `~/.cache/pip` | pip's package cache. Granted because the project's `make install-python` step (transitively invoked by `make test`, which runs as a pre-commit hook) populates this cache; denying it would force every install to redownload from PyPI even when the requirements have not changed. |
| `~/.cache/gh` | `gh` CLI's cache directory (HTTP response cache + extension metadata). Granted because every `gh` invocation writes cache entries at startup; denying it would require every `gh` call to be wrapped with an `XDG_CACHE_HOME=/tmp/...` env prefix, which adds a shell shape that falls out of sandbox auto-allow and forces per-subcommand allow entries. Auth tokens are **not** stored here (they live in `~/.config/gh/`, which stays read-only). Persistence trade-off is identical to `~/.cache/pip` / `~/.cache/pre-commit`: cache poisoning, if it occurred, would survive reboots, but API auth is server-side so the blast radius is bounded to wrong-output-to-operator. |
| `~/.venvs` | Project-managed Python virtualenvs (notably `~/.venvs/pkgmgr`, the editable-install target for `infinito-nexus` itself). Required so the pre-commit `make test` hook can refresh the editable install of this repository's Python package without hitting `[Errno 30] Read-only file system`. The directory holds only Python interpreters and packages, no host credentials. |
| `~/.ansible` | Ansible's runtime state directory (notably `~/.ansible/tmp/`, where `ansible-galaxy` and other ansible CLIs create per-invocation temp dirs). Required because the pre-commit `make test` flow runs `make install-ansible`, which fails to even initialize the `ansible` Python package without write access here (`DEFAULT_LOCAL_TMP` setup uses `tempfile.mkdtemp` against this path). |
@@ -26,7 +26,7 @@ The Bash auto-allow path trusts the OS sandbox to confine commands. A missing or
Path-scoped write restrictions inside `permissions.allow` entries (for example `Bash(tee /tmp/*)` rather than `Bash(tee *)`) add no security on top of the sandbox. The sandbox enforces write scope at the syscall layer, so any path outside `allowWrite` fails with `EROFS`.
**Enabled by this:** Allow rules MAY use broad wildcards (`tee *`, `XDG_CACHE_HOME=* gh run view *`) without maintaining narrow path lists. The single source of truth for writable paths is `sandbox.filesystem.allowWrite` in [sandbox.md](sandbox.md).
**Enabled by this:** Allow rules MAY use broad wildcards (`tee *`, `* > /tmp/*`) without maintaining narrow path lists. The single source of truth for writable paths is `sandbox.filesystem.allowWrite` in [sandbox.md](sandbox.md).
**If violated:** If a contributor widens `allowWrite` (for example by adding `~/` or `/`), the broad allow rules become genuinely broad. Changes to `allowWrite` SHOULD be reviewed with the same scrutiny as a `deny` rule.
@@ -22,12 +22,12 @@ For Bash specifically, `sandbox.autoAllowBashIfSandboxed: true` adds an implicit
## Allow Permissions ✅
The allowlist covers non-Bash tools, the wildcarded web tools, and a narrow set of Bash entries for shapes the sandbox auto-allow heuristic does not recognise. Read-only `gh api` calls are explicitly allowlisted as `gh api *` (and its `XDG_CACHE_HOME=*` prefix variant) because real invocations combine env prefixes, pipes, and `>` redirects that fall outside auto-allow. Mutation shapes (`-X`/`--method`/body-flags/`graphql`) are caught by the corresponding `ask` rules below.
The allowlist covers non-Bash tools, the wildcarded web tools, and a narrow set of Bash entries for shapes the sandbox auto-allow heuristic does not recognise. Read-only `gh api` calls are explicitly allowlisted as `gh api *` because real invocations combine `jq` pipes that fall outside auto-allow; stdout redirection to `/tmp` is covered separately by the generic `* > /tmp/*` entries below. Mutation shapes (`-X`/`--method`/body-flags/`graphql`) are caught by the corresponding `ask` rules below.
| Permission | When | Why | Security |
|---|---|---|---|
| `Read` | Every task that inspects a file. | Core IDE operation. The agent cannot understand code without it. | Scope is limited by `denyRead` in the sandbox configuration (see [sandbox.md](sandbox.md)). Credential directories are never readable. |
| `Edit` | Every task that modifies an existing file. | Core IDE operation. Required for any code change. | Write scope is bounded by `allowWrite` (see [sandbox.md](sandbox.md)). Changes outside `.`, `/tmp`, and `~/.cache/pre-commit` are blocked. |
| `Edit` | Every task that modifies an existing file. | Core IDE operation. Required for any code change. | Write scope is bounded by `allowWrite` (see [sandbox.md](sandbox.md)). Changes outside the paths listed there are blocked. |
| `Write` | Every task that creates a new file. | Core IDE operation. Required for scaffolding and new file creation. | Same sandbox boundary as `Edit`. |
| `WebSearch` | Looking up documentation, error messages, or package information. | Allows the agent to resolve unknown APIs and tooling questions without leaving the terminal. | Outbound query only. No local data is uploaded. |
| `WebFetch(domain:*)` | Fetching documentation, repository pages, registry metadata, or any other public web resource. | Replaces the previous explicit per-domain allowlist. The wildcard reflects that web research is a routine, low-risk activity for a sandboxed agent and that maintaining a per-domain list created friction without measurable safety gain. | Read-only HTTP fetches. Credentials in URLs are still discouraged. Egress is bounded by the sandbox network configuration (see [sandbox.md](sandbox.md)) and any host-level firewall. |
@@ -52,23 +52,19 @@ A small number of Bash allow entries exist as targeted workarounds for command s
| Permission | When | Why | Security |
|---|---|---|---|
| `PYTHONPATH=* python *` | Running individual pytest files or single `python -m <module>` invocations that are not covered by a `Makefile` target (e.g. `PYTHONPATH=. python -m pytest tests/unit/plugins/lookup/test_applications.py -x`). | Leading `PYTHONPATH=` env-assignments fall out of the sandbox auto-allow heuristic for the same reason as `XDG_CACHE_HOME=` (env-prefix shape is not reliably recognised). A narrow allow entry scoped to `python *` mirrors the existing `XDG_CACHE_HOME=* gh run view *` precedent: minimal namespace, no blank-check on arbitrary binaries. The CLAUDE.md rule to prefer `make` targets is unchanged — this entry only unblocks the cases where no target exists (e.g. running a single test file). | Sandbox `allowWrite` bounds every write the Python process performs (`.`, `/tmp`, `~/.venvs`, `~/.cache/pip`, `~/.ansible`, `~/.cache/pre-commit` — outside those paths: EROFS). Sandbox `denyRead` blocks credential paths. Network egress bounded by `sandbox.network.allowedDomains`. Python's arbitrary-code nature does NOT escape any of these boundaries. |
| `XDG_CACHE_HOME=* gh api *` | Fetching arbitrary GitHub API payloads (job logs, run metadata, rate-limit state) with the `gh` CLI cache relocated via `XDG_CACHE_HOME=`. | `gh api` defaults to GET (read-only), but typical invocations combine an `XDG_CACHE_HOME=` env prefix with a `> /tmp/...` redirect, which is not reliably covered by auto-allow. Mirrors the existing `XDG_CACHE_HOME=* gh run view *` precedent: narrow env namespace, broad subcommand namespace. Mutation flags (`-X`/`--method`/`-f`/`-F`/`--field`/`--raw-field`/`--input`/`graphql`) route through `ask` via the rules below, so the broad `gh api *` scope here is gated to default-GET in practice. | Default-GET is read-only. Cache and redirect targets are bounded by sandbox `allowWrite` — writes outside those paths fail with EROFS. Outbound network bounded by `sandbox.network.allowedDomains`. Mutation attempts prompt via the `ask` rules. |
| `XDG_CACHE_HOME=* gh issue list *` | Listing / searching issues with the `gh` CLI cache relocated via `XDG_CACHE_HOME=`, typically filtered via `--search`, `--state`, `--json`. | `gh issue list` is read-only, but the env-prefix shape combined with the `--search 'multi word'`/`--json ...` flags regularly falls outside auto-allow. A single namespace entry replaces a growing list of per-search literal allow entries, which rot as the set of queries the agent needs changes. Same env-prefix reasoning as `XDG_CACHE_HOME=* gh run view *` and `XDG_CACHE_HOME=* gh api *`. | Read-only GitHub API call. No filesystem mutation (issue metadata is returned to stdout). Outbound network bounded by `sandbox.network.allowedDomains`. Issue-mutating verbs (`gh issue comment/close/create/edit/reopen/…`) route through `ask` and `gh issue transfer*` is unconditionally in `deny`. |
| `XDG_CACHE_HOME=* gh run download *` | Downloading CI run artefacts (failure logs, Playwright assets) with the `gh` CLI cache relocated via `XDG_CACHE_HOME=`, typically targeted at `/tmp/<run-id>-artefacts/` per [push-trigger-pull.md](../../../../agents/action/push-trigger-pull.md) and [pipeline.md](../../../../agents/action/debug/pipeline.md). | Env-prefix variant of the `gh run *` entry below, scoped to the `download` subcommand. Real invocations combine the `XDG_CACHE_HOME=` prefix with `--dir /tmp/<run-id>-artefacts` (and sometimes `--repo <owner>/<repo>` for cross-fork runs), which falls outside auto-allow for the same reason as the other `XDG_CACHE_HOME=* gh run *` entries. A narrow subcommand-scoped entry mirrors the existing `view`/`list` precedent rather than collapsing into a broader `XDG_CACHE_HOME=* gh run *` namespace. | Read-only GitHub API call from the agent's perspective. Artefact writes are constrained by `sandbox.filesystem.allowWrite` — the conventional `--dir /tmp/...` target falls inside `/tmp`, and any other target outside `allowWrite` fails with EROFS. Outbound network bounded by `sandbox.network.allowedDomains`. |
| `XDG_CACHE_HOME=* gh run list *` | Listing CI runs with the `gh` CLI cache relocated via `XDG_CACHE_HOME=`, typically filtered via `--branch`, `--workflow`, `--json`, `--jq`. | Env-prefix variant of the plain `gh run list *` entry below. Real invocations combine the `XDG_CACHE_HOME=` prefix with `--jq` expressions whose `|` characters confuse the non-quote-aware auto-allow parser; a single namespace entry replaces per-workflow/per-branch literal allow entries that would accumulate and rot. | Read-only GitHub API call. No filesystem mutation. Outbound network bounded by `sandbox.network.allowedDomains`. |
| `XDG_CACHE_HOME=* gh run view *` | Fetching CI run / job logs with the `gh` CLI cache relocated via `XDG_CACHE_HOME=`. | `gh run view` is read-only, but invocations combine an `XDG_CACHE_HOME=` env prefix with a `> ...` redirect, which is not reliably covered by auto-allow. The env value itself is not scoped (`XDG_CACHE_HOME=*`) because `sandbox.filesystem.allowWrite` is the authoritative write boundary — a redundant `XDG_CACHE_HOME=/tmp/*` restriction on the allow rule added no safety, only maintenance. | Read-only GitHub API call. Cache and redirect targets are constrained by sandbox `allowWrite` (`.`, `/tmp`, `~/.ansible`, `~/.cache/pip`, `~/.cache/pre-commit`, `~/.venvs`) — writes outside those paths fail with EROFS. Outbound network bounded by `sandbox.network.allowedDomains`. |
| `* > /tmp/*` / `* > /tmp/* 2>&1` | Any already-allowed command that redirects stdout (optionally merging stderr) into a file under `/tmp` — typically capturing long-running log output for later inspection (e.g. `make deploy-* 2>&1 > /tmp/deploy.log`, `gh run view --log-failed > /tmp/<run>-logs.txt 2>&1`). | Shell redirection (`>`, `2>&1`) is not covered by the sandbox auto-allow heuristic — auto-allow treats the redirect operator as a shell-control shape and declines. Two wildcard-left entries cover the common "write to /tmp" and "write to /tmp merging stderr" log-capture shapes at once; the alternative — per-command `<cmd> > *` variants — would duplicate every existing allow entry and rot as new commands emerge. | Write target is bounded to `/tmp`, which is in `sandbox.filesystem.allowWrite` (Assumption 2 in [security.md](security.md)) — writes outside `/tmp` fail with EROFS. The left-hand command is still subject to `deny` rules and to any matching `ask` rule in the pre-redirect form. |
| `PYTHONPATH=* python *` | Running individual pytest files or single `python -m <module>` invocations that are not covered by a `Makefile` target (e.g. `PYTHONPATH=. python -m pytest tests/unit/plugins/lookup/test_applications.py -x`). | Leading `PYTHONPATH=` env-assignments fall out of the sandbox auto-allow heuristic (env-prefix shape is not reliably recognised). A narrow allow entry scoped to `python *` keeps the namespace minimal — no blank-check on arbitrary binaries. The CLAUDE.md rule to prefer `make` targets is unchanged — this entry only unblocks the cases where no target exists (e.g. running a single test file). | Sandbox `allowWrite` bounds every write the Python process performs (`.`, `/tmp`, `~/.ansible`, `~/.cache/gh`, `~/.cache/pip`, `~/.cache/pre-commit`, `~/.venvs` — outside those paths: EROFS). Sandbox `denyRead` blocks credential paths. Network egress bounded by `sandbox.network.allowedDomains`. Python's arbitrary-code nature does NOT escape any of these boundaries. |
| `docker *` | Any `docker` CLI subcommand: read-only inspection (`ps`, `logs`, `inspect`, `stats`, `images`, `top`, `port`, `version`, `info`, `events`), state changes (`rm`, `kill`, `stop`, `restart`, `pause`, `unpause`, `system prune`, `volume rm`, `network rm`, `rmi`), data movement (`cp`, `commit`, `save`, `load`, `export`, `import`, `tag`), and nested operations (`docker exec <container> …`, `docker compose …`). Handles the non-auto-allowable shapes the CLI produces: nested commands, Go-template `--format "table {{.Names}}\t{{.Status}}"` strings with `{{...}}`/`\t` escapes that confuse the non-quote-aware heuristic, and `--filter "name=…"` with embedded `=`. | Rests on Assumptions 3, 5, and 6 in [security.md](security.md) (test workloads only, DinD ask-bypass, Docker socket equals host root). Image-level mutation (`run`, `build`, `push`, `login`) and their synonyms route through `ask` (see below). | Sandbox `allowWrite` and `allowedDomains` bound anything a subcommand writes or fetches. `deny` rules (`rm -rf`, `sudo`, mutating `gh`) still fire when invoked through `docker exec …`. |
| `echo *` | Emitting section headers, status messages, or literal strings to stdout — typically chained via `&&`, `\|`, or heredoc-style redirection (`echo ... > /tmp/...`). | `echo` is a pure stdout primitive with no filesystem or network effect, but the shapes it appears in (`cmd_a && echo divider && cmd_b`, `echo payload \| jq ...`, `echo ... > /tmp/file`) routinely fall outside the auto-allow heuristic because `&&`/`\|`/redirects split the line into independently-checked parts. A single namespace entry covers every flag/argument combination. | Pure stdout write. No filesystem mutation via the command itself; any redirect target is still bounded by `sandbox.filesystem.allowWrite`. No network. |
| `gh api *` | Any `gh api` invocation without an `XDG_CACHE_HOME=` prefix — typically `gh api /repos/.../actions/jobs/.../logs`, `gh api /repos/.../actions/runs/...`, or pagination via `--paginate` + `--jq` filters. | Read-only by default (GET). Real invocations use shapes (`\| tee /tmp/...`, `--jq '... \| select(...) \| ...'`, `--paginate`) whose pipes confuse the non-quote-aware auto-allow parser. A single namespace entry covers every flag/path/jq combination for reads. Every mutation spelling (`-X`/`--method`, body-flags, GraphQL) is intercepted by the `ask` rules below, and path-based destructive calls stay in `deny`. | Default-GET is read-only; mutations prompt. Deny rules on secrets/keys/collaborators/merge/DELETE/PUT still take precedence. No filesystem mutation via GET; outbound network bounded by `sandbox.network.allowedDomains`. |
| `gh issue *` | Any `gh issue` subcommand without env prefix — read-only (`list`, `view`, `status`) plus mutating verbs (`close`, `create`, `edit`, `comment`, `delete`, `reopen`, `lock`, `unlock`, `pin`, `unpin`, `develop`, `transfer`). | Read-only subcommands use shapes (`--search 'multi word'`, `--jq '... \| ...'`) whose quoted pipes confuse the non-quote-aware auto-allow parser. Namespace breadth is safe because every mutating verb is already gated: the wildcarded `gh * <verb>*` ask rules catch every write (`close`/`create`/`edit`/`comment`/`delete`/`reopen`/`lock`/`unlock`/`pin`/`unpin`/`develop`), and `gh issue transfer*` is unconditionally in `deny`. Future read-only subcommands ship unblocked; future mutating verbs need a matching ask/deny entry anyway — no broader than the existing `gh * <verb>*` surface. | Read-only default; every mutation prompts via ask or is blocked by deny. No filesystem mutation via reads. Outbound network bounded by `sandbox.network.allowedDomains`. |
| `gh run *` | Any `gh run` subcommand without env prefix — read-only (`list`, `view`, `download`, `watch`) plus mutating verbs (`cancel`, `rerun`, `delete`). | Same namespace-breadth reasoning as `gh issue *`. `--jq` pipes in list/view fall outside auto-allow; `download` writes archive files to cwd (bounded by sandbox `allowWrite`); `watch` blocks on run completion. Mutating verbs route through `gh * cancel*` / `gh * rerun*` / `gh * delete*` ask. | Read-only default; mutations prompt. Cwd writes bounded by `allowWrite` (`.`, `/tmp`, `~/.ansible`, `~/.cache/pip`, `~/.cache/pre-commit`, `~/.venvs`). Outbound network bounded by `sandbox.network.allowedDomains`. |
| `gh api *` | Any `gh api` invocation — typically `gh api /repos/.../actions/jobs/.../logs`, `gh api /repos/.../actions/runs/...`, or pagination via `--paginate` + `--jq` filters. | Read-only by default (GET). Real invocations use shapes (`\| tee /tmp/...`, `--jq '... \| select(...) \| ...'`, `--paginate`) whose pipes confuse the non-quote-aware auto-allow parser. A single namespace entry covers every flag/path/jq combination for reads. Every mutation spelling (`-X`/`--method`, body-flags, GraphQL) is intercepted by the `ask` rules below, and path-based destructive calls stay in `deny`. | Default-GET is read-only; mutations prompt. Deny rules on secrets/keys/collaborators/merge/DELETE/PUT still take precedence. No filesystem mutation via GET; outbound network bounded by `sandbox.network.allowedDomains`. |
| `gh issue *` | Any `gh issue` subcommand — read-only (`list`, `view`, `status`) plus mutating verbs (`close`, `create`, `edit`, `comment`, `delete`, `reopen`, `lock`, `unlock`, `pin`, `unpin`, `develop`, `transfer`). | Read-only subcommands use shapes (`--search 'multi word'`, `--jq '... \| ...'`) whose quoted pipes confuse the non-quote-aware auto-allow parser. Namespace breadth is safe because every mutating verb is already gated: the wildcarded `gh * <verb>*` ask rules catch every write (`close`/`create`/`edit`/`comment`/`delete`/`reopen`/`lock`/`unlock`/`pin`/`unpin`/`develop`), and `gh issue transfer*` is unconditionally in `deny`. Future read-only subcommands ship unblocked; future mutating verbs need a matching ask/deny entry anyway — no broader than the existing `gh * <verb>*` surface. | Read-only default; every mutation prompts via ask or is blocked by deny. No filesystem mutation via reads. Outbound network bounded by `sandbox.network.allowedDomains`. |
| `gh run *` | Any `gh run` subcommand — read-only (`list`, `view`, `download`, `watch`) plus mutating verbs (`cancel`, `rerun`, `delete`). | Same namespace-breadth reasoning as `gh issue *`. `--jq` pipes in list/view fall outside auto-allow; `download` writes archive files to cwd (bounded by sandbox `allowWrite`); `watch` blocks on run completion. Mutating verbs route through `gh * cancel*` / `gh * rerun*` / `gh * delete*` ask. | Read-only default; mutations prompt. Cwd writes bounded by `allowWrite` (`.`, `/tmp`, `~/.ansible`, `~/.cache/gh`, `~/.cache/pip`, `~/.cache/pre-commit`, `~/.venvs`). Outbound network bounded by `sandbox.network.allowedDomains`. |
| `grep *` | Scanning one or many files for regex patterns from the shell. | Claude is instructed in [CLAUDE.md](../../../../../CLAUDE.md) to prefer a single flat `grep` over `for`/`while` loops for multi-file scans; this entry makes that flat-form always-allowed, so the agent can follow the guidance without a prompt. Shell loops around per-file `grep` calls fall outside auto-allow and should be avoided. | Read-only filesystem scan. No mutation, no network. Read scope is still bounded by `denyRead` (see [sandbox.md](sandbox.md)). |
| `head *` | Inspecting the first N lines of one or many files, typically chained after another read-only call via `&&` or `\|` (e.g. `cat file \| head -20`, `make target && head -15 /tmp/out.log`). | `head` is a pure read primitive, but like `wc` it usually sits on the right-hand side of `&&`/`\|`, where auto-allow checks each side independently and can decline the composite. Supports the documented alternative to shell loops for multi-file peeks: `head -n 15 file1 file2 file3` (prints `==> file <==` headers automatically) replaces `for f in ...; do head -15 "$f"; done`, which is forbidden by CLAUDE.md. A single namespace entry covers every flag (`-n`, `-c`, `-q`, `-v`). | Read-only file inspection. No filesystem mutation, no network. Read scope still bounded by `denyRead` (see [sandbox.md](sandbox.md)). |
| `make *` | Running any `Makefile` target (e.g. `make deploy-fresh-purged-apps`, `make up`, `make test`). | CLAUDE.md instructs the agent to prefer `make` targets over raw `docker`/`ansible-playbook`/`python` invocations. Long `make` invocations combine multi-word `VAR="a b c"` arguments with trailing redirections/pipes (`2>&1 | tee /tmp/...`), and both shapes fall outside the sandbox auto-allow heuristic. A single allow entry covers the whole namespace so the agent can follow the "prefer make targets" guidance without a prompt. | Rests on Assumption 7 in [security.md](security.md) (`Makefile` peer-reviewed and trusted). Every target still runs inside the sandbox. Destructive `rm -rf`, `sudo`, `git reset --hard`, and mutating `gh` deny rules still override this allow. |
| `pkill *` | Terminating stuck host processes (`pkill -f "ansible-playbook"`, `pkill -f "make deploy"`) after a runaway `make` target or long-running playbook needs to be stopped from a separate Bash call. | `pkill` is not in the sandbox auto-allow heuristic because process termination crosses the sandbox's filesystem boundary — it acts on host-level PIDs rather than files. A single namespace entry covers every flag (`-f`, `-9`, `-u`, `-HUP`). Kept broad because narrower patterns (e.g. `pkill -f ansible*`) rot as the set of stuck-process names grows. | Kills host processes only — no filesystem mutation, no network. The blast radius is bounded by the host user's process ownership: `pkill` cannot terminate processes owned by other users without `sudo` (which is in `deny`). Operators SHOULD prefer a targeted `pkill -f "<pattern>"` over a bare `pkill <name>` to avoid killing unrelated processes with matching names. |
| `tail *` | Inspecting the last N lines of a log or piping a command's output through `| tail -N` to trim verbose output (e.g. `pytest ... 2>&1 \| tail -20`, `make test 2>&1 \| tail -40`). | `tail` is the right-hand-side twin of `head *`: a pure read primitive that lives almost exclusively after `&&` or `\|`, where the auto-allow heuristic checks each side independently and declines the composite. A single namespace entry covers every flag (`-n`, `-f`, `-c`, `-q`, `-v`). Follow mode (`tail -f`) is intentionally included — it is routinely used to watch a log while a background job runs in a separate Bash call. | Read-only file inspection. No filesystem mutation, no network. Read scope still bounded by `denyRead` (see [sandbox.md](sandbox.md)). |
| `tee *` | Mirroring a long-running command's combined output to a log file for later inspection (`… 2>&1 \| tee /tmp/<name>.log`). | Pipelines (`\|`) and redirects (`2>&1`) regularly cause the sandbox auto-allow heuristic to decline, so the right-hand side of the pipe needs its own allow entry. The path is not scoped (`tee *` instead of `tee /tmp/*`) because `sandbox.filesystem.allowWrite` is the authoritative write boundary — a redundant path restriction on the allow rule added no safety. Operators SHOULD still prefer `/tmp/` to keep logs out of the repo tree, but that is style, not security. | Write is bounded by `sandbox.filesystem.allowWrite` (`.`, `/tmp`, `~/.ansible`, `~/.cache/pip`, `~/.cache/pre-commit`, `~/.venvs`). Writes outside those paths fail with EROFS. No network. |
| `tee *` | Mirroring a long-running command's combined output to a log file for later inspection (`… 2>&1 \| tee /tmp/<name>.log`). | Pipelines (`\|`) and redirects (`2>&1`) regularly cause the sandbox auto-allow heuristic to decline, so the right-hand side of the pipe needs its own allow entry. The path is not scoped (`tee *` instead of `tee /tmp/*`) because `sandbox.filesystem.allowWrite` is the authoritative write boundary — a redundant path restriction on the allow rule added no safety. Operators SHOULD still prefer `/tmp/` to keep logs out of the repo tree, but that is style, not security. | Write is bounded by `sandbox.filesystem.allowWrite` (`.`, `/tmp`, `~/.ansible`, `~/.cache/gh`, `~/.cache/pip`, `~/.cache/pre-commit`, `~/.venvs`). Writes outside those paths fail with EROFS. No network. |
| `wc *` | Counting lines / words / bytes in logs or intermediate files, typically chained after another read-only call via `&&`. | `&&` splits the command line into independently-checked parts, so the right-hand side needs its own allow entry even when the left-hand side already matches. The whole `wc` namespace is read-only regardless of flag (`-l`, `-w`, `-c`, `-m`), so the wildcard is kept broad. | Read-only file inspection. No filesystem mutation, no network. |
## Ask Permissions ⚠️