Claude Code Privacy Guard banner
datumbrain datumbrain

Claude Code Privacy Guard

Development community

Description

🛡️ Claude Code plugin that blocks prompts containing secrets, API keys, and PII before they reach Claude.

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

Claude Code Privacy Guard

Claude Code Privacy Guard Logo

🛡️ Prevent secrets and PII from being accidentally shared with Claude Code.

A privacy-first plugin for Claude Code that scans prompts for sensitive data and **blocks** them before they reach the AI.

![Claude Code Privacy Guard Screenshot](./assets/claude-code-privacy-guard-ss.png)

Features

  • Blocks prompts containing sensitive data before they're sent to Claude
  • Detects PII, secrets, API keys, tokens, and sensitive information
  • Works locally - all scanning happens on your machine
  • Zero configuration - works out of the box
  • Detailed reporting - shows exactly what was detected
  • Toggle rules and manage allowlists - by hand in .privacy-guard.json, or via npx claude-code-privacy-guard rules for a local web UI

Installation

# Add the marketplace (if not already added)
/plugin marketplace add datumbrain/claude-code-privacy-guard

# Install the plugin
/plugin install claude-code-privacy-guard

**⚠️ Important: Restart Required**

After installing the plugin, you must **restart your Claude Code session** for it to take effect. This is because hooks are registered at session startup - Claude Code doesn't dynamically load new hooks mid-session.

Simply close and reopen Claude Code, or start a new session.

Once restarted, the plugin will automatically scan all prompts before they reach Claude.

What Gets Detected

✅ **Secrets**

  • OpenAI API keys (sk-..., sk-proj-...)
  • Anthropic, OpenRouter, Google AI, Groq, and Perplexity API keys
  • Hugging Face API tokens
  • AWS credentials
  • GCP service account keys
  • Azure client secrets (Microsoft Entra ID)
  • GitHub tokens (classic and fine-grained PATs)
  • GitLab tokens (personal access, deploy, runner, pipeline trigger, service account, CI job)
  • Slack tokens
  • Stripe keys
  • Twilio API key SIDs and account