
secrets-scanner
Scans for common credentials across cloud, source control, payment, and collaboration providers
- version
- 0.1.14
- GitHub stars
- 77
Install
/plugin install secrets-scanner@agent-securityRun it inside Claude Code after adding the marketplace with /plugin marketplace add mintmcp/agent-security.
Contents
Discovered from sourceAgents 2
Secrets Scanner Plugin
Blocks sending secrets to Claude Code or Cursor by scanning inputs and outputs.
Installation
Claude Code Plugin Marketplace
Install via the Claude Code plugin marketplace:
/plugin marketplace add mintmcp/agent-security
/plugin install secrets-scanner@agent-security
PyPI
pipx install claude-secret-scan
# or
python3 -m pip install --user claude-secret-scan
For manual usage, run secrets_scanner_hook.py with python3 via hooks.
Behavior
PreToolUse/ CursorbeforeReadFile: blocks when secrets are detected.UserPromptSubmit/ CursorbeforeSubmitPrompt: blocks when secrets are detected.PostToolUse: prints a warning (cannot block after execution).
Detected classes include common cloud credentials, source control tokens, webhook URLs, payment provider keys, private keys, and JWTs. See PATTERNS in hooks/secrets_scanner_hook.py for details.
Configuration
MAX_SCAN_BYTES(default 5 MB)PATTERNS(regex map for credential types)
Binary content is skipped using a simple heuristic.
Testing
See tests/read_hook_test.py and TESTING.md for examples and guidance.
Notes
- Regex detection is best-effort. Rotate real secrets immediately.
- No external dependencies. Uses only Python's built-in regexes and simple pattern matching.
- Runs completely locally. No code, prompts, or files leave your system.
- Curious how it works? See
hooks/secrets_scanner_hook.pyfor the core implementation and patterns. - Python 3.7+.
License
Apache License 2.0. See ../../LICENSE.
Acknowledgements
Regex patterns were informed by or adapted from detect-secrets (Apache 2.0).
Testing and Tuning
This document covers how to run the included tests and adjust patterns.
Run Tests
python3 plugins/secrets_scanner/tests/read_hook_test.py --suite all
Suites available: basic, extended, exitcodes, or all.
Adjust Patterns
Edit PATTERNS in plugins/secrets_scanner/hooks/secrets_scanner_hook.py to refine detection or add new formats. Re-run tests after changes.
Notes
- Regex detection is best-effort and may produce false positives. Review lines before acting.
- Post-execution hooks warn only; they cannot block a completed operation.
Sponsors
Details
- Marketplace
- mintmcp/agent-security
- Source
- plugins/secrets_scanner
- Author
- MintMCP
- Category
- Security
- Keywords
- security, secrets, credentials, scanning