Skip to content

Sensitive CanarySecrets and PII guard for Claude Code

A security plugin that prevents unintended data leaks from Claude Code. Automatically detects and blocks AWS keys, tokens, email addresses, credit card numbers, and more before they are sent to the API.

Sensitive Canary

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 CanaryWith Sensitive Canary
cat .env → full contents sent to Claude ❌Blocked by name before Claude reads it ✅
Paste AKIAIOSFODNN7EXAMPLE in prompt ❌Blocked before the API call is made ✅
Tool result contains user@email.comPII detected and blocked ✅
echo $API_KEY with live key ❌Env var value scanned and blocked ✅
  • Two hooksUserPromptSubmit and PreToolUse cover both directions of risk
  • 31 detection rules — sourced from gitleaks and TruffleHog detector definitions
  • Entropy filtering — reduces false positives on low-entropy values
  • Luhn validation — credit card numbers are validated, not just pattern-matched
  • Local only — all scanning runs in your terminal; nothing is sent anywhere

Detection Rules

CategoryExamples
Cloud credentialsAWS Access Key, GCP service account key
Source controlGitHub PAT, GitHub fine-grained token, GitLab PAT
AI servicesAnthropic API key, OpenAI API key / project key
CommunicationSlack token, Slack webhook, Discord webhook, Telegram bot token
PaymentStripe secret/restricted key, credit card numbers (Luhn-validated)
Email servicesSendGrid API key, Mailgun key, Mailchimp key
Auth tokensJWT, database connection strings
PIIEmail address, US SSN, US/JP phone, Japanese postal code, private IPv4

View all detection rules →

Released under the MIT License.