Skip to content

Close the bypasses in the bash guard, and check the .claude toolkit in CI - #171

Open
blakebauman wants to merge 1 commit into
mainfrom
chore/toolkit-guards
Open

blakebauman wants to merge 1 commit into
mainfrom
chore/toolkit-guards

Conversation

@blakebauman

@blakebauman blakebauman commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Audit findings AIE-1 to AIE-4, AIE-6 and AIE-7 (11 Nov). Tooling only: no product code.

Guard hook

I probed .claude/hooks/guard-bash.sh with 17 commands and it allowed 13. The table covers those and the close variants I tested while fixing them:

Was allowed Now
podman compose … down -v, docker-compose down -v, podman-compose down --volumes denied — the repo has run on Podman since #135 and the guard only matched docker compose
docker volume rm <fiber volume>, volume prune, system prune --volumes denied
rm -rf data/workspaces/ (trailing slash), rm -rf ./data/artifacts/*, rm -rf data denied
cp / mv / perl -pi onto an applied migration, rm of one denied
bash -c "pkill -f fiber-agent", … | xargs pkill -f fiber-agent, pkill -f target/debug/fiber denied

Left allowed on purpose: git checkout <rev> -- <migration> (restoring to HEAD is legitimate and the two are hard to tell apart), and everyday neighbours — copying a migration elsewhere, compose down without volumes, compose up -d, docker volume ls, removing one run's workspace, pkill -f vite. Each has a selftest case; the selftest goes from 26 to 53 cases.

It is still a pattern guard, not a sandbox: a determined command (a script file, python -c) gets through. It exists to stop the accidents.

Toolkit checked in CI

  • validate.py now fails when an agent or skill brief names a repository path that does not exist, and when .claude/README.md's counts drift. It immediately found fiber-devops naming deploy/Dockerfile.api, deploy/Dockerfile.ui and deploy/nginx.conf; that brief also described a two-job CI with RUSTFLAGS. Both corrected.
  • make toolkit runs the validator, the hook selftest and shellcheck on the hooks; the check job runs it.

Smaller

  • fiber-reviewer and fiber-security-reviewer were pinned to opus, so on a newer session model the reviewers were weaker than the implementer. Now inherit.
  • settings.json allowlisted git branch:* as read-only, which covers git branch -D. Narrowed to --list and --show-current.
  • AGENTS.md was six lines; it now carries the nine invariants and points at CLAUDE.md, so a non-Claude agent gets them too.
  • CLAUDE.md: http_request added to the durable built-ins, and make smoke's description matches the target. ci.yml notes that deny is now a required check.

Verified

  • make toolkit: validator 0 errors, selftest 53 passed / 0 failed, shellcheck clean at warning level.
  • The original 17 probe commands re-run against the new guard: 15 denied, 2 allowed as described.
  • actionlint clean.

Not verified

  • The CI step assumes PyYAML is importable on the ubuntu-24.04 runner and falls back to apt-get install python3-yaml; this PR's check job is the first run of it.

🤖 Generated with Claude Code

…n CI

Probing guard-bash.sh with 17 commands found it allowed podman and
docker-compose teardown with volumes, volume rm/prune, rm of the data roots
with a trailing slash or glob, cp/mv/perl onto an applied migration, and the
argv-pattern kill inside sh -c or behind xargs. Each is now denied, with a
selftest case, alongside allow cases for the everyday commands next to them.

validate.py now fails when a brief names a repository path that does not
exist or the README's counts drift; fiber-devops named three files that were
gone. make toolkit runs the validator, the selftest and shellcheck, and the
check job runs it.

Reviewers inherit the session model instead of pinning an older one. The
allowlist no longer covers git branch -D. AGENTS.md carries the nine
invariants and points at CLAUDE.md.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant