Back to Library
Security

Secret Assignment Detector

Detect likely plaintext secrets in config assignments.

Pattern
\b(api[_-]?key|secret|token)\s*=\s*['"][A-Za-z0-9_-]{16,}['"]

Test Cases

api_key="abcDEF0123456789" Match
mode="debug" No Match

Related Blog Guides

Try it Live

Test and customize this pattern in our interactive editor

Open in Editor