agent-guardrails-kit
Link to open source: https://github.com/Utkarsh450/agent-guardrails-kit
I use Claude Code a lot, and the more I let it work on its own, the more one thing bugged me. My agent can run any command on my machine. rm -rf on the wrong folder, a force push to main, reading my .env. It’s usually right, but usually isn’t always.
So I built a fix. agent-guardrails-kit is an open-source npm package that puts safety rails around AI coding agents, so the dangerous stuff gets stopped before it ever reaches your terminal and you stay the one who decides what runs.
How to try it: you need Node 22.12 or newer. In your project, run
npx agent-guardrails-kit init
It shows the 28 files it wants to create and waits for your yes. After that:
- A hook runs before every action from Claude Code, Cursor, Codex and Qoder. It blocks deletes, git writes, npm publish, secret files and curl piped into sh. If the hook breaks, it blocks instead of allowing.
- Your agent writes PLAN.md first and can’t change a file until you run approve. It can’t approve itself.
- Before the agent edits a file, the old version is saved (up to 1 MB per file), and restore puts it back.
- Git hooks catch secrets and force pushes, whichever tool made the commit.
You don’t have to trust me on any of it. The test command throws 2213 cases at the guard, and on my Windows machine the Claude Code hook passed 139 of 139.
It’s v0.1.1, so it won’t catch everything. Antigravity has no hooks, so there it’s only rules. If you find something it lets through, please open an issue. That’s the feedback I want most.
It’s MIT licensed and free.
Links:
- GitHub: https://github.com/Utkarsh450/agent-guardrails-kit
- npm: https://www.npmjs.com/package/agent-guardrails-kit
Tags: ai, ai-agents, claude-code, cursor, developer-tools, open-source, npm, nodejs, security, cli


