Help us improve
Share bugs, ideas, or general feedback.
From autopilot-codex
Use whenever you're about to run a destructive Bash command, push code, or spend Codex tokens — explains every cap and denylist this plugin enforces and how to extend them.
npx claudepluginhub evgenygurin/autopilot-codex --plugin autopilot-codexHow this skill is triggered — by the user, by Claude, or both
Slash command
/autopilot-codex:safety-railsWhen to use
About to run `git push --force` / `npm publish` / `terraform apply` / `rm -rf` / SQL drops | budget exhausted | hitting iteration cap
This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
The autopilot moves faster than a human reviewer. The safety rails are
Applies 10 pre-set color/font themes or generates custom ones for slides, documents, reports, and HTML landing pages.
Share bugs, ideas, or general feedback.
The autopilot moves faster than a human reviewer. The safety rails are intentionally narrow — Claude Code's own permission system is the primary line of defence; this is the backstop for the loop.
hooks/safety-rails.sh)PreToolUse:Bash hook denies these patterns with
hookSpecificOutput.permissionDecision="deny":
| Pattern | Matched as | Reason |
|---|---|---|
rm -rf / (and any absolute root) | regex on /[^[:space:]]* after rm -rf | irreversible |
rm -rf .git | (...)*\.git after rm -rf | drops history |
git push --force / git push -f | git push.*--force|-f | rewrites shared branches |
git reset --hard | literal | discards uncommitted work |
git clean -f* | git clean -[a-zA-Z]*f | deletes untracked |
DROP TABLE / DROP DATABASE / TRUNCATE TABLE | case-insensitive SQL | irreversible |
terraform destroy | literal | tears down infra |
mkfs.* | mkfs(\.[a-z0-9]+)? | wipes filesystems |
shutdown / halt / reboot | literal | takes the host down |
:(){ :|: & };: | fork-bomb regex | DoS |
npm publish (without --dry-run) | requires --dry-run to allow | unintended release |
git push origin main (no --force) — recoverable, allowed.rm -rf /tmp/<project>/<dir> — /tmp paths are not
special-cased in the regex; we strip quoted bodies before matching to
avoid false positives in commit messages."..." or '...' quoted strings — stripped to a
QUOTED placeholder before the deny regex runs (v0.1.3 fix).scripts/budget-guard.mjs)PostToolUse and Stop hooks call node budget-guard.mjs check after the
status check. Behaviour:
state.budget_used_usd and state.budget_usd.used >= cap and status == "running", flips status to
stopped_budget and exits 2.additionalContext note.Defaults: budget_usd = 5.00. Override with AUTOPILOT_BUDGET_USD env
or /autopilot ... --budget 12.50.
This is a soft cap on already-charged turns. A single very large
Codex turn can put budget_used_usd above budget_usd in one step;
the next hook short-circuits, but the over-spend that turn is real.
cmdVerdict increments state.iteration per call. When
iteration >= max_iterations (default 30), status flips to
stopped_iteration_limit. Stop hook lets Stop proceed.
cmdVerdict tracks no_progress_streak. When Codex returns 'continue'
3× in a row without commits or working-tree changes (excluding
docs/autopilot/ artefacts), status flips to aborted with a
forced_abort reason.
The autopilot loop never runs git push, npm publish,
terraform apply, or anything else that talks to the outside world.
The implementer is expected to ask the user. If a user-facing message
mentions these, surface them through /autopilot-codex:codex-status
and let the user opt in.
To add a Bash denial pattern:
hooks/safety-rails.sh. Add a grep -qiE line below the
existing ones, model it on the SQL block.scripts/__tests__/hooks.test.mjs. The negative case (a benign
variant that should pass) is just as important as the deny case.echo '{"tool_name":"Bash","tool_input":{"command":"…"}}' | bash hooks/safety-rails.sh.To raise / lower the budget: set AUTOPILOT_BUDGET_USD in your env or
pass --budget USD to /autopilot. The hook will pick it up on the
next session-start (or via budget-guard init).
To raise / lower the iteration cap: set AUTOPILOT_MAX_ITERATIONS=50
before invoking /autopilot. There's no per-session override yet.