14
canaryhook is an open-source Command Line Interface (CLI) tool designed to protect your project's credentials from AI coding agents. It works by planting decoy credentials within your project files. The moment an AI agent attempts to read these decoys or exfiltrate their values, canaryhook intervenes.
Decoy Credentials: canaryhook plants four realistic, yet fake, secret files (.env.backup, credentials.json.bak, deploy_key.old, db_dump_2026.sql) that have no legitimate reason to be accessed by your build, test, or runtime processes.
Real-time Blocking: It intercepts tool calls made by AI agents. If a tool call attempts to read a decoy file or exfiltrate a canary string, the call is denied before it executes.
No False Positives: By design, canaryhook relies on simple string comparisons and the fact that legitimate code won't access these decoys, minimizing false positives. It does not require AI models, signatures, or API keys.
Alerting: When a tripwire is triggered, the event is logged to .canaryhook/alerts.jsonl, providing a record of the attempted access.
CI/CD Integration: Use canaryhook verify in your CI/CD pipeline to ensure no trips were recorded, failing the build if any suspicious activity is detected.
Simple Usage: Install globally via npm and run canaryhook init in your project directory to set up the decoys and hooks.
canaryhook acts as a smoke detector for your credentials, catching indiscriminate credential hunting by AI agents without adding measurable latency or complexity.
Built with