Skip to content

Agent Safety & Hooks Pack

Hard-block destructive commands, ask before risky ones, and guard secrets and spend.

Getting started with Agent Safety & Hooks Pack is free to read: what to install, the first 15 minutes after download, and common problems.

Which kit is right for me?

Buyer FAQ: delivery, files, software, updates, the license and help.

Zero-dependency Node.js hooks for Claude Code and Cursor. They hard-block destructive commands, ask before risky ones (push, deploy, publish, sudo, deletes), cap tool calls and tokens per session, and log tool calls with secrets redacted. On Claude Code, the secret guard blocks agents writing secrets into files, and it blocks reads and writes of .env and key files. On Cursor, that guard runs only when a file is read: it blocks opening .env and key files, and it does not block the agent writing secrets into ordinary files. A Cursor rule tells the agent not to hard-code secrets. A git pre-commit hook blocks commits with secrets either way. Ready-made configs and rules for both tools are included, and the 57-check test suite runs every hook for real. Requires Node.js 18+.

Who it's for

What's included

What you can set up with it

FAQ

Which tools does it work with?
Claude Code and Cursor, with ready-made hook configs for both. On Claude Code the secret guard blocks writes of secrets into files, and reads or writes of .env and key files. On Cursor the secret guard runs on file reads, so it blocks opening those secret files and does not block writing secrets into ordinary files. The pre-commit secret scanner works in any git repo, whatever tool made the change.
Is this a sandbox?
No. Hooks are a strong safety net, not a sandbox: pattern matching can be evaded by a determined or obfuscated command, and token counts are estimates from transcript size. Keep real secrets out of your repo, use least-privilege tokens and keep backups.
Will it keep interrupting me?
Approval prompts only appear for the risky commands on the list. You can add commands you trust to an allow-list to skip the prompt; destructive commands stay blocked either way.
What if it flags something that isn't a secret?
Add guard:allow-secret in a comment on that line and the scanner skips it.
How long does it take to install?
About two minutes: copy the folder into your project, run the tests, then copy the example configs for Claude Code or Cursor. An optional one-command step installs the pre-commit hook and backs up any existing one.
What do I need?
Node.js 18+. The scripts have no dependencies and work on Windows, macOS and Linux.

Delivery: instant zip download right after checkout. Updated versions appear in your Polar purchase page. One-time purchase. Use it in your own and client projects; don't resell the kit itself.