hyderhusainarastu

AI Coding Agent Guardrail Hooks — AI skill for Claude Code

AI community

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: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](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