Enable Secrets Detection
What Gets Detected
API Keys (API_KEY)
API Keys (API_KEY)
Provider-specific key patterns including:
- OpenAI —
sk-proj-*,sk-* - Anthropic —
sk-ant-* - GitHub — PATs (
ghp_*), OAuth (ghu_*), App tokens (ghs_*) - Stripe —
sk_live_*,sk_test_*,rk_* - Slack —
xoxb-*,xoxp-*,xoxa-*,xoxs-* - SendGrid —
SG.*.* - Twilio —
SKfollowed by 32 hex characters - Mailgun —
key-followed by 32 hex characters
Private Keys (PRIVATE_KEY)
Private Keys (PRIVATE_KEY)
PEM-encoded private key blocks with
BEGIN/END markers. Supports RSA, EC, DSA, OpenSSH, PGP, and encrypted variants.JSON Web Tokens (JWT)
JSON Web Tokens (JWT)
Three-segment base64url tokens starting with
eyJ. Validates that the decoded header contains an alg field.Connection Strings (CONNECTION_STRING)
Connection Strings (CONNECTION_STRING)
Database and service URIs with embedded credentials:
- PostgreSQL —
postgres://user:pass@host/db - MySQL / MariaDB —
mysql://user:pass@host/db - MongoDB —
mongodb+srv://user:pass@host/db - Redis —
redis://:pass@host:port - AMQP —
amqp://user:pass@host:port
changeme or password are ignored.AWS Credentials (AWS_CREDENTIALS)
AWS Credentials (AWS_CREDENTIALS)
- Access key IDs with the
AKIAprefix (high confidence) - Secret access keys when AWS-related context keywords are present (context-dependent)
Environment Variable Secrets (ENV_VAR_SECRET)
Environment Variable Secrets (ENV_VAR_SECRET)
Secret values in
.env-style lines like API_KEY=sk-abc123. The recognizer checks whether the key name suggests a secret (e.g., names containing password, secret, token, api_key, etc.) and filters out placeholder values.Config File Secrets (CONFIG_SECRET)
Config File Secrets (CONFIG_SECRET)
Secret values in JSON, YAML, and TOML configuration files. Uses the same key name heuristics as the environment variable recognizer.
Scanning .env Files
Point Rehydra at your.env files so it can learn the exact secret values and detect them anywhere in the text — even outside of KEY=VALUE context:
Explicit Redact Values
If you know specific values that should always be redacted, pass them directly:Custom Key Name Patterns
The built-in key name heuristic covers common names likepassword, secret, token, api_key, connection_string, and about 30 others. To extend it:
ENV_VAR_SECRET and CONFIG_SECRET detection.
Minimum Value Length
Short values like"yes" or "0" are skipped by default. Adjust the threshold if needed:
Full Configuration Reference
Next Steps
PII Types
See all supported PII categories.
Custom Recognizers
Add your own domain-specific patterns.