mint_
Documentation menu
On this page

mint guard / Documentation

Rule list

All 32 rules plus the entropy detector.

mint guard ships 32 listed rules: 29 pattern rules and 3 environment checks. A Shannon-entropy detector runs on top of them.

mint guard rules
mint guard rules --format json

Pattern rules#

Rule idSeverityDetectsReplacement command
private-key-blockcriticalPEM private key blocksmint passphrase --words 6
aws-access-key-idhighAWS access key IDsmint base64url --length 40
aws-secret-access-keycriticalAWS secret keys next to their key namemint base64url --length 40
gcp-service-account-jsoncriticalService account JSON with an embedded private keymint token --bytes 32
google-api-keyhighGoogle API keysmint token --bytes 32
github-tokencriticalGitHub tokens, including fine-grained PATsmint token --bytes 32
gitlab-tokencriticalGitLab personal access tokensmint token --bytes 32
npm-tokencriticalnpm tokens, including .npmrc auth tokensmint token --bytes 32
pypi-tokencriticalPyPI upload tokensmint token --bytes 32
huggingface-tokenhighHugging Face tokensmint token --bytes 32
anthropic-api-keycriticalAnthropic API keysmint token --bytes 32
openai-api-keycriticalOpenAI API keysmint token --bytes 32
mint-apikeycriticalKeys generated with the mint_ prefixmint apikey --prefix mint_ --checksum
stripe-secret-keycriticalLive Stripe secret and restricted keysmint apikey --prefix sk_live_ --length 32 --checksum
slack-tokenhighSlack bot, user and app tokensmint token --bytes 32
slack-webhookhighSlack incoming webhook URLsmint webhook-secret
discord-bot-tokenhighDiscord bot tokensmint token --bytes 32
discord-webhookhighDiscord webhook URLsmint webhook-secret
twilio-auth-tokencriticalTwilio auth tokensmint token --bytes 24 --format hex
twilio-account-sidmediumTwilio account SIDsmint token --bytes 24
sendgrid-api-keyhighSendGrid API keysmint token --bytes 32
mailgun-api-keyhighMailgun API keysmint token --bytes 32
telegram-bot-tokenhighTelegram bot tokensmint token --bytes 32
supabase-service-rolecriticalJWT service role keysmint token --bytes 32
supabase-tokenhighSupabase management tokensmint token --bytes 32
firebase-server-keymediumLegacy Firebase server keysmint token --bytes 32
jwtmediumCompact JSON Web Tokensmint jwt-secret --algo hs512
database-url-passwordcriticalDatabase URLs with an inline passwordmint password --length 32 --no-ambiguous
generic-assignmentmediumpassword, secret, token, api_key and similar assignments with a real-looking valuemint password --length 32 --no-ambiguous

Some rules only fire when a marker is present:

  • gcp-service-account-json requires private_key and service_account.
  • supabase-service-role requires service_role.

The replacement command is a starting point, not the rotation itself. Rotate at the provider first.

Environment rules#

These are used by mint guard env and are included in mint guard rules.

Rule idSeverityDetectsReplacement command
env-file-trackedcritical.env file tracked by gitmint token --bytes 32
env-file-not-ignoredhigh.env file not ignoredmint token --bytes 32
env-no-examplelowNo .env.example while env files existmint password --length 32 --no-ambiguous

Entropy detection#

The entropy detector catches secrets with no known format. It looks at quoted strings and assignment values, then applies these rules:

  • Length from 20 to 200 characters.
  • Shannon entropy of at least 4.5 bits per character by default.
  • Reject UUIDs, known digests, git hashes, URLs, file paths, source snippets, images, alphabets, prose and placeholders.
  • Reject values already matched by a pattern rule on the same span.
mint guard scan --entropy-threshold 5
mint guard scan --entropy-threshold 4

Higher is stricter. Tune it only after looking at the findings. The synthetic rule id is entropy-string; it can be disabled in config:

{
  "disabledRules": ["entropy-string"],
  "entropySeverity": "high",
  "entropyThreshold": 4.5
}

It can also be selected with --rules entropy-string, even though it is not printed as a row in the 32-rule list.

Filtering#

mint guard scan --rules github-token,entropy-string

--rules accepts a comma-separated list. Unknown ids are an error. --fail-on controls the gate, not which rules run.

Reading the JSON rule list#

mint guard rules --format json

Each entry contains the id, name, severity, keywords, why text, replacement command, rotation key and a builtIn flag. Custom rules from .mintguard.json appear here too.