AI Coding Agent Guardrail Hooks — AI skill for Claude Code
Guardrails for AI coding agents: a tool-neutral 'guardrails check' CLI that blocks .env reads, writes outside allowed roots and --no-verify, a Claude Code hook adapter, and git hooks for any agent or.
How to install AI Coding Agent Guardrail Hooks
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open hyderhusainarastu/ai-coding-agent-guardrail-hooks and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What AI Coding Agent Guardrail Hooks does
Guardrails for AI coding agents: a tool-neutral 'guardrails check' CLI that blocks .env reads, writes outside allowed roots and --no-verify, a Claude Code hook adapter, and git hooks for any agent or human that stop your own .env values and protected-dir symlinks from being committed. Advisory, not a sandbox.
Alternatives in AI
- Amux — Bidirectional LLM API adapter with IR pattern 117 ★
- Datafog Python — Offline PII firewall for AI agents and LLM apps: fast local detection and redaction, Claude Code hook, LiteLLM 69 ★
- Oh My Dag — The orchestration layer under your coding agent 38 ★
README
ai-coding-agent-guardrail-hooks
Guardrails for AI coding agents and the people who run them: a tool-neutral `guardrails check` CLI, a Claude Code hook adapter, and git hooks that stop your own `.env` values and protected-directory symlinks from being committed. Advisory, not a sandbox.
[](LICENSE)
Works with
| Surface | How (prompt / native skill / CLI / hook / MCP) | Status |
|---|---|---|
| Claude Code | PreToolUse hook (adapters/claude_code.py), fail-open |
adapter tested with JSON fixtures 2026-11-23 (Python 3.14); not tested inside a live Claude Code session |
| Any agent or human using git | git hooks (pre-commit, pre-push, post-merge), fail-closed |
tested 2026-11-23, git on macOS, temp repos |
| Any tool that can run a command | CLI: python3 -m guardrails check |
tested 2026-11-23 |
| Codex | git hooks, AGENTS.md; no adapter | not tested |
| Cursor | git hooks, AGENTS.md; no adapter | not tested |
| Gemini CLI | git hooks, GEMINI.md pointer; no adapter | not tested |
| Copilot | git hooks, pointer file; no adapter | not tested |
| Aider | git hooks; no adapter | not tested |
| ChatGPT / Claude.ai / Gemini (chat) | no prompt version: these cannot run hooks | not applicable |
Details per agent: [docs/other-agents.md](docs/other-agents.md).
Quick start
git clone https://github.com/hyderhusainarastu/ai-coding-agent-guardrail-hooks tools/guardrails
cd tools/guardrails && python3 -m pip install -e . # optional: gives you the `guardrails` command
# 1. Git hooks for the repository you want to protect (run inside that repo)
/path/to/tools/guardrails/install-git-hooks.sh # core.hooksPath; or --copy, --uninstall
# 2. Claude Code: merge examples/claude-settings.json into .claude/settings.json
# and adjust the tools/guardrails path.
# 3. Policy: copy examples/guardrails.json to guardrails.json at your repo root and edit.
Requires Python 3.10+ and
Related Skills
Usewarden
Free, local guardrail for AI coding agents — Claude Code, Cursor, Gemini CLI and more. Blocks out-of-scope wri
AI Agent Guardrails Windows Guide
Verified guide: a global guardrail that blocks catastrophic shell commands from AI agents on Windows (Claude C
Geo Guard AI
Geo-restriction for AI CLIs: block Claude Code & Cursor from running outside allowed countries. Cross-platform
Shellbouncer
A firewall for AI coding agents. One policy file blocks rm -rf ~, curl sh and .env leaks in Claude Code, Codex
Bleep
Stops AI coding agents (Claude Code, Codex, Copilot) from leaking private/company repository names onto public
AI Hook
Ultra-fast AI-agent hook dispatcher & autonomous rule engine (Rust + embedded QuickJS). Write guardrail rules
Related Agents
Hcs Hook Integrator
Wires Claude Code + Codex hooks to the HCS substrate without embedding policy in hook bodies. Maintains .claud
Sp Reviewer
Use as a pre-push guardrail before committing or pushing. Runs lint, build, tests and a secret scan, reviews t
Pbr Render
Render specialist - look-dev, lighting variants, neutral-grey series stills, 4K, macro, turntable loop and mp4