DEV Community

kuro-tomo
kuro-tomo

Posted on AI-assisted

SinkSeal: git-hook guardrails for AI coding agents

I built this after watching an AI-agent-built demo feature get wired straight to a live SMS/voice vendor — no guard, no synthetic-tenant check, just the same code path production used. A routine demo session produced real phone charges.

SinkSeal is a set of git hooks (bash, no runtime dependency beyond git + grep/sed) that catch three things on every commit and push, regardless of which agent (Claude Code, Cursor, Codex, or a human) writes the code:

  • secrets, via gitleaks (warns rather than blocks if gitleaks isn't on your PATH — install it separately for this check to actually run)
  • risk-category changes (auth, payments, migrations, etc.) — flagged, not blocked, but requires an explicit commit-message trailer acknowledging it
  • "live-fire" calls to external irreversible-action APIs (SMS, payment, public-posting) reached from demo/test code paths — hard-blocked if the path looks like a demo, soft-flagged otherwise

Why git hooks, not a CI check

CI catches a bad diff after it's already pushed. A git hook catches it before the commit even lands, regardless of which coding agent (or human) wrote the code — the enforcement lives in the hook, not in any one tool's configuration or system prompt.

Install

git clone https://github.com/kuro-tomo/sinkseal
./sinkseal/install.sh /path/to/your/repo
Enter fullscreen mode Exit fullscreen mode

This copies the hooks self-contained into <repo>/.githooks/, so it survives even if you later delete the sinkseal checkout, and it's inherited automatically by any git worktree of that repo.

Free and MIT-licensed: https://github.com/kuro-tomo/sinkseal

Feedback especially welcome on the pattern-matching approach — it's inherently a probabilistic safety net (regex-based), not a completeness guarantee, and I'd rather know where it's weak than oversell it.

Top comments (0)