Help stop your AI coding agent leaking secrets or touching production
Hooks, permission presets and git guards for Next.js + Supabase + Stripe apps built with Claude Code, Cursor or Codex CLI, plus the same rules for the Copilot harness in VS Code. $24 (plus VAT where applicable).
Get the Guardrails Pack ($24 plus VAT where applicable)Prices exclude VAT; UK and EU VAT is added at Gumroad checkout.

- New in 1.2.3: the guard hook on every host is designed to deny more ways of signalling every process:
xargs killwith-1fed on stdin (echo -1 | xargs kill -9),killwith an arithmetic PID such as$((-1)), perl'skill KILL => -1,node/python/perl/rubycode that holds-1in a variable or is fed on stdin, andsystemctl kill user@<uid>.service. Ordinary commands such aspgrep node | xargs killandsystemctl statusare still allowed (tested). A kill inside a script file (for examplenode script.mjswhose code callsprocess.kill(-1, ...)) can't be caught by any command hook, because the hook only sees the command text, not what the script does. Only process isolation (a sandbox with its own PID namespace) can contain that. - New in 1.2.2: the same guard rules as a Copilot
preToolUsehook for the Copilot harness in VS Code, designed to deny the same risky shell commands as the other hooks, plus file reads for the tools listed in its tool map (it ships withview; you add the file tools your session uses). It is built to fail closed on bad input, a crash or a timeout of its own watchdog. Tested with 22 tests on 16 local fixtures, not a live Copilot session. Also fixed:kill -l -1(listing signal names) is no longer denied. - New in 1.2.1: the guard hook (Claude Code, Cursor, Codex and the mod) is designed to deny commands that signal every process you can reach, such as
kill -9 -1,pkill -9 -u $USER,killall5and inlineprocess.kill(-1)code, which can end the terminal, tmux and the desktop session. Killing one PID or a named process is still allowed. Whole-tree staging (git add -A,git add .,git commit -a) is not denied by the hook; the team preset and the optional Codex rules are designed to ask you first. - New in 1.2: Codex CLI hooks.
PreToolUsehooks for Bash commands,apply_patchfile edits and MCP calls, designed to deny the same risky commands, secrets and file edits as the Claude Code hooks. A wrapper is built to fail closed (an error, bad input or a timeout gives a deny), because Codex has no setting for that. Includes aconfig.tomlalternative, optional Codex rules as a second layer, and a check script that warns when Codex will skip the hooks because they aren't trusted yet. Tested on Codex CLI 0.164.0. - Claude Code secret-egress hook: designed to deny commands and tool calls that contain a live Stripe key, webhook secret, Supabase secret key, service-role key, GitHub token or AWS access key id, that send a
.envfile over the network, or that send a secret env variable to a host other thanapi.stripe.comor your Supabase project. It is also designed to deny Claude Code reading or writing curl/wget/netrc config files (~/.netrc,~/.curlrc,~/.wgetrc, any file namedcurlrcwritten with the file tools or common shell commands), which hold credentials or can reroute network calls. - Claude Code guard hook (built on the Ship-Ready AI Rules guard core, updated in 1.2): designed to deny
supabase db push, production deploys, Stripe live mode, force pushes and.envreads. - New in 1.1, beta, optional extra: the same Claude Code rules as a Claude Code mod (Claude Code 2.1.287+). It is one plugin you install from the unzipped pack, with a
/guardrailscommand that lists what it denied. Checked with Claude Code's plugin validator and 16 plugin test cases (synthetic events). Not yet tested in a live interactive session. - Three Claude Code permission presets that deny listed commands (solo, team, CI).
- Cursor hooks for shell commands, file reads (including the config files above) and MCP calls, using the same rules, plus an advisory DO-NOT rule.
- git pre-commit and pre-push guards that work with any editor, designed to reject staged
.envfiles, live keys,NEXT_PUBLIC_secret names, server secrets in'use client'files, migrations that disable RLS, and force pushes or deletes on main. - Supabase and Stripe MCP configuration examples that use the vendors' documented options, such as Supabase MCP's
read_onlyandproject_refoptions. - Example CI workflow, 6 one-page fix guides (leaked key rotation, RLS, webhook signatures, prod migration, force push, MCP scoping), and a doctor command that shows what's on.
- Tested: 918 test cases without the Claude Code CLI, 0 failures (
npm run verifyin the pack, tested on Node 20.19 and 24.22, requires Node 18+, nothing else installed), run 25 Oct 2026 UTC; 921 with it (3 optional cases that need the Claude Code CLI andCLAUDE_BIN, no login; run 25 Oct 2026 UTC on 1.2.3 with Claude Code 2.1.302), plus 53codex execruns on Codex CLI 0.164.0 (last run on 1.2.1) against a local mock model, not a live model (Bash,apply_patch, fail-closed, trust,config.tomland rules cases), plus 16claude plugin testcases for the mod (synthetic events, not a live session) and 9,460 adversarial timing inputs, each required to finish within 5 seconds (worst case about 0.2 seconds in single runs on 25 Oct 2026 UTC; slower on a heavily loaded machine). Hooks run as real scripts against the documented Claude Code, Cursor and Codex hook formats; git hooks run with real commits and pushes. Full list inRULES.md.
Honest limits
- Rules are pattern-based. Rephrased or encoded commands can get past them.
- On Node 20.16+ the guard, including the mod, is designed to read files on disk (in the mod this is not yet tested in a live Claude Code session). On older Node it can't read files on disk: commands hidden in
package.jsonscripts behindnpm runare not expanded, and Edit checks look at the new text only. - curl/wget/netrc config files are matched by literal name. Globs (
~/.n?trc), quote-splitting (~/.ne""trc), a path built in a variable, a proxy orXDG_CONFIG_HOMEset outside the command, or a file written outside the agent get past that check. - A config file written by a script (for example Python) and copied into another folder, then used through
HOME=or a symlink, gets past the config-file check. Since 1.1.1, a curl/wget call to an official host that setsHOME=(orXDG_CONFIG_HOME=,CURL_HOME=) in the same command loses its exemption, so that last step is denied whenHOME=is in the command itself (tested).HOMEset outside the command, or a symlink, is not seen. - Commands run as another user (
sudo -u <user> ...,su <user> -c ...) read that user's~/.curlrc,~/.netrcand~/.wgetrc, so the config-file andHOME=checks don't apply to them. - Symlinks or hard links to these files are not matched.
- MCP file tools (for example a filesystem MCP server) are not checked for those config files, and Cursor agent edits to them are not denied (no pre-write hook).
- Codex: hooks you haven't trusted in Codex's
/hooks, or that changed since you trusted them, are skipped silently. Run the included check script after installing or updating. - Codex: there is no fail-on-error setting; the wrapper is what makes the hooks fail closed.
- Codex: as of October 2026, OpenAI describes hooks as "a useful guardrail, not a complete enforcement boundary".
- Codex: async hooks can't deny a call, and hosted tools (run by OpenAI, such as web search) aren't hooked.
- Codex: don't assume Codex cloud tasks enforce these hooks. The Codex IDE extension shares the config but is untested.
- Codex: the optional rules match command prefixes only (
FOO=1 supabase db pushgets past the rules; the hook is designed to deny it). - Not designed to catch:
kill 0, PHPposix_kill,os.killpg(1, ...),xargs killwhose-1comes from a file or another program, or that sits behind a wrapper other thansudo,doas,env,nice,ionice,timeout,command,builtin,nohup,exec,setsidorstdbuf, git aliases,systemctl stop user@<uid>.service. - A kill inside a script file (for example
node script.mjswhose code callsprocess.kill(-1, ...)) can't be caught by any command hook, because the hook only sees the command text, not what the script does. Only process isolation (a sandbox with its own PID namespace) can contain that. kill -9 $((PID))is denied too, because the hook doesn't evaluate arithmetic.rm -rf,git reset --hardandgit cleanare not denied.- Copilot: file-read, write and edit rules only apply to tools in the tool map, which ships with
viewonly. Unmapped tools without acommandargument get no decision unless you setGUARDRAILS_UNKNOWN_TOOL=deny. - Copilot: as of October 2026, GitHub documents that a hook timeout continues through normal permissions, so keep the hook's
timeoutSecabove its watchdog. If your repository also has the Claude Code hooks, a call can be checked twice; keep one. git commit --no-verifyandgit push --no-verifyskip the git hooks.- Not included: runtime or production monitoring, a scan of your existing code (that's Launch Audit), coding skills and rules (that's Ship-Ready AI Rules).
- Not tested: a live Claude Code, Cursor or Copilot session, a live OpenAI model with Codex, the Codex IDE extension, Codex cloud tasks, live Supabase or Stripe accounts, Windows.
- No guarantee. A clean result is not proof the app is secure.
Requires Node 18+. The Codex hooks are tested on Codex CLI 0.164.0. The Claude Code hooks need Claude Code 2.1.295+ to deny the action when a hook crashes or times out. Cursor hooks are configured to fail closed (failClosed: true), so they should deny the action if the hook fails (live Cursor behaviour not tested). Single-user commercial licence.
Disclosure: this is our own paid product. Guardrails Pack 1.2.3 is also one of eight kits in the AI Coding Toolkit: $49 (plus VAT where applicable) for the whole download. See the AI Coding Toolkit