Skip to content

v1.4.0

Latest

Choose a tag to compare

@github-actions github-actions released this 03 Aug 17:48
31623d4

Scratch space stops asking 🚧

Agents write to temp directories constantly — build output, checkouts, intermediate files — and clean up after themselves just as often. Fence treated every one of those cleanups as a recursive delete outside the workspace and asked. rm -rf /tmp/agent-build is not a catastrophe, and prompting on it is exactly the false positive that gets a guardrail uninstalled.

Deletes inside a temp directory now pass in silence: /tmp/build, /var/tmp/x, /private/tmp/y, macOS /var/folders/…/T/z, and $TMPDIR/scratch. A prefixed glob like /tmp/build-* still names a specific target, so it counts too.

What still asks

The temp root itself and a bare wildcard sweep of it — rm -rf /tmp, rm -rf /tmp/*, rm -rf $TMPDIR — wipe every process's scratch state rather than one named target, so those keep prompting. So do lookalikes (/tmpfoo/bar), the macOS cache sibling (/var/folders/…/C/x), and traversals that escape the root (/tmp/../etc is really /etc). A temp operand never launders a dangerous one beside it: rm -rf /tmp/scratch ~ is still a deny.

$TMPDIR is resolved to its actual value before the path is judged, so it counts as scratch only when it really points into a temp directory. If TMPDIR is unset — common on Linux — the shell expands rm -rf $TMPDIR/scratch to rm -rf /scratch, and Fence still asks. A project that itself lives under /tmp classifies its own files as workspace-local, not scratch.

New in the rule schema

delete_target and chmod_target accept a new temp value, the least-severe rung of the shared path scale (temp < cwd_relative < outside_workspace < sensitive). Nothing in the recommended pack matches temp, so scratch deletes fall through to the default allow. Match it explicitly to opt back into prompting:

rules:
  - id: confirm-temp-deletes
    effect: ask
    match:
      shell:
        recursive_delete: true
        delete_target: temp

See the match reference for the full scale.

Upgrading

Nothing to do — brew upgrade fence or your usual install path. No config or rulepack changes are required, and no existing rule changes meaning.

Changelog

  • 5d9bc6e feat: stop prompting on recursive deletes inside temp dirs
  • a740405 fix: resolve $TMPDIR before trusting it as scratch space (an unset TMPDIR made $TMPDIR/x mean /x), and rank workspace-local above scratch for projects living under /tmp

Full diff: v1.3.0...v1.4.0