Sensitive Canary banner
coo-quack coo-quack

Sensitive Canary

Development community

Description

Claude Code hooks that guard secrets and PII before they reach the Anthropic API

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Sensitive Canary

[![CI](https://github.com/coo-quack/sensitive-canary/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/coo-quack/sensitive-canary/actions/workflows/ci.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A security plugin that prevents unintended data leaks from Claude Code. Automatically detects and blocks secrets and PII — in prompts, file reads, and command executions — before they are sent to the Anthropic API.

No proxy server. No background process. Native Claude Code hooks only.

📖 **[Documentation](https://coo-quack.github.io/sensitive-canary/)** — Installation guide, detection rules reference, and allow tag details.


Why sensitive-canary?

Claude Code is a powerful development tool, but file reads and command executions can inadvertently send secrets and personal information to the Anthropic API. API keys in `.env` files, tokens embedded in config files, credentials pasted into the terminal — once sent to the API, they leave your machine.

**sensitive-canary intercepts them before they are sent, preventing unintended data leaks.**

Without sensitive-canary With sensitive-canary
cat .env → full contents sent to Claude ❌ Blocked by name before Claude reads it ✅
Paste a live AWS key in a prompt ❌ Blocked before the API call is made ✅
Read customers.csv full of email addresses ❌ PII detected before Claude sees the file ✅
echo $API_KEY with live key ❌ Env var value scanned and blocked ✅
cat docker-compose.yml with POSTGRES_PASSWORD: Assignment detected in YAML and JSON too ✅
  • Two hooksUserPromptSubmit and PreToolUse cover both directions of risk
  • 76 detection rules — sourced from gitleaks and TruffleHog detector definitions
  • Checksum validation — credit cards (Luhn) and national ID numbers (JP My Number, FR NIR, IT Codice Fiscale, DE S