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.

Guardrails Pack cover: a Copilot hook designed to deny reading .env files, kill -9 -1 and a force push, as output.
  • New in 1.2.3: the guard hook on every host is designed to deny more ways of signalling every process: xargs kill with -1 fed on stdin (echo -1 | xargs kill -9), kill with an arithmetic PID such as $((-1)), perl's kill KILL => -1, node/python/perl/ruby code that holds -1 in a variable or is fed on stdin, and systemctl kill user@<uid>.service. Ordinary commands such as pgrep node | xargs kill and systemctl status are still allowed (tested). A kill inside a script file (for example node script.mjs whose code calls process.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 preToolUse hook 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 with view; 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, killall5 and inline process.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. PreToolUse hooks for Bash commands, apply_patch file 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 a config.toml alternative, 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 .env file over the network, or that send a secret env variable to a host other than api.stripe.com or your Supabase project. It is also designed to deny Claude Code reading or writing curl/wget/netrc config files (~/.netrc, ~/.curlrc, ~/.wgetrc, any file named curlrc written 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 .env reads.
  • 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 /guardrails command 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 .env files, 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_only and project_ref options.
  • 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 verify in 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 and CLAUDE_BIN, no login; run 25 Oct 2026 UTC on 1.2.3 with Claude Code 2.1.302), plus 53 codex exec runs 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.toml and rules cases), plus 16 claude plugin test cases 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 in RULES.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.json scripts behind npm run are 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 or XDG_CONFIG_HOME set 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 sets HOME= (or XDG_CONFIG_HOME=, CURL_HOME=) in the same command loses its exemption, so that last step is denied when HOME= is in the command itself (tested). HOME set 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, ~/.netrc and ~/.wgetrc, so the config-file and HOME= 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 push gets past the rules; the hook is designed to deny it).
  • Not designed to catch: kill 0, PHP posix_kill, os.killpg(1, ...), xargs kill whose -1 comes from a file or another program, or that sits behind a wrapper other than sudo, doas, env, nice, ionice, timeout, command, builtin, nohup, exec, setsid or stdbuf, git aliases, systemctl stop user@<uid>.service.
  • A kill inside a script file (for example node script.mjs whose code calls process.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 --hard and git clean are not denied.
  • Copilot: file-read, write and edit rules only apply to tools in the tool map, which ships with view only. Unmapped tools without a command argument get no decision unless you set GUARDRAILS_UNKNOWN_TOOL=deny.
  • Copilot: as of October 2026, GitHub documents that a hook timeout continues through normal permissions, so keep the hook's timeoutSec above its watchdog. If your repository also has the Claude Code hooks, a call can be checked twice; keep one.
  • git commit --no-verify and git push --no-verify skip 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.

Claude and Claude Code are trademarks of Anthropic. OpenAI and Codex are trademarks of OpenAI. GitHub Copilot is a trademark of GitHub. VS Code is a trademark of Microsoft. Cursor, Next.js, Supabase, Stripe, GitHub, AWS, Node.js, Python, Perl, Ruby, Windows and other names belong to their owners. Names are used only to identify products and compatibility. Stack & Ship is not affiliated with or endorsed by any of them.

Get the Guardrails Pack ($24 plus VAT where applicable)

Anthropic, Claude and Claude Code are trademarks of Anthropic. OpenAI and Codex are trademarks of OpenAI. Cursor is a trademark of Anysphere, Inc. Other product names are trademarks of their respective owners. Stack & Ship is not affiliated with or endorsed by any of them.

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