[luv-201] feat: add Infra Commands category with 7 opt-in policies (cuts 0.0.7)#202
Conversation
…cut 0.0.7 Adds a new built-in policy category that prevents coding agents from running infrastructure CLIs or triggering CI/CD pipelines without explicit opt-in: - block-kubectl, block-terraform (terraform/tofu), block-aws-cli, block-gcloud, block-az-cli, block-helm - block-gh-pipeline targets only mutating gh subcommands (workflow run, pr merge, release create, etc.) — read-only forms used by other failproofai workflow policies remain allowed All seven default to opt-in (defaultEnabled: false) and accept an allowPatterns param that reuses the existing matchesAllowedPattern helper, inheriting its shell-operator-injection defenses (verified by the block-sudo allowPattern test suite). Built-in policy count: 32 → 39. Bumps version 0.0.7-beta.0 → 0.0.7 and cuts the 0.0.7 changelog section. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…fore-stop (#204) The MERGED-PR reconciliation logic ran git fetch + git log + git diff against origin/<base> to verify the work had shipped before allowing Stop. Those probes assume regular-merge semantics (branch commits become ancestors of base). They never converge for: - Squash-merge: GitHub creates a new commit on base with rewritten parentage; the original branch commit is orphaned. - Rebase-merge: same problem with different SHAs. - Any post-merge change to base (release auto-bumps, follow-up commits): introduces extra diff that the probe reads as "work hasn't shipped". All three applied when PR #202 was squash-merged and the publish workflow auto-bumped main to 0.0.8-beta.0, producing the misleading deny: Pull request for branch "luv-201" is merged. Run now: gh pr create Replace the 28-line reconciliation with a direct allow when state === MERGED — GitHub's PR state is itself authoritative proof the work shipped. The allow message hints to switch off the branch (git checkout main && git pull) before stopping again. Mirrors the fix shape from #196 for require-no-conflicts-before-stop. Tests: regression test for the orphaned-commit + diverged-main scenario, plus an assertion that the policy no longer invokes git fetch on MERGED PRs. Removed the prior "denies when merged + diff" and "falls through to deny when fetch fails" tests — both codified the buggy behavior. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Summary
block-kubectl,block-terraform(terraform/tofu),block-aws-cli,block-gcloud,block-az-cli,block-helm,block-gh-pipeline.defaultEnabled: falseand accept anallowPatternsparam that reuses the existingmatchesAllowedPatternhelper (inherits its shell-operator-injection defenses, verified by the block-sudo allowPattern test suite).block-gh-pipelinematches only mutating subcommands (workflow run/enable/disable,run rerun/cancel,pr merge,release create/delete,cache delete,secret set/delete). Read-onlyghcalls (gh pr view,gh run list,gh api ...) are intentionally allowed because failproofai's own workflow policies depend on them.package.jsonfrom0.0.7-beta.0→0.0.7and rolls the## Unreleasedchangelog section into## 0.0.7 — 2026-04-27.Built-in policy count: 32 → 39. All seven new policies live under the
exospherehost/namespace.Test plan
bun run test:run— 1043/1043 passing (added 41 tests across 7 newdescribeblocks)bun run lint— clean (only pre-existing<img>warning intool-input-output.tsx)bunx tsc --noEmit— cleanbun run test:e2e— 207/207 passingfailproofai p -i -c <custom>registers cleanly with new policies in the registryoven/bun:latest+npm install -g failproofai-0.0.7.tgz --ignore-scripts): version reports0.0.7, custom hook validated, opt-in default behavior verified (kubectl invocation passes through when policy is disabled)block-gh-pipelinedoes NOT block read-onlygh pr view,gh pr list,gh run list,gh api ...(covered by 4 explicit positive-allow tests)kubectl get pods; rm -rf /withallowPatterns: ["kubectl get *"]is still denied (the existingmatchesAllowedPatternoperator check handles it; replicated test from block-sudo)🤖 Generated with Claude Code