You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(secrets): detect Stripe, SendGrid, and Hugging Face keys (#2882)
Add three well-known, format-precise credential patterns across all four
secret scanners in lockstep (PR-diff gate secrets-scan.ts, content-lane
security-scan.ts, the shared safety.ts HARD_SECRET_KINDS, and the
review-enrichment analyzer), matching the precision of the gitlab/npm rules
so they are safe as unconditional hard blockers:
- stripe_secret_key: sk_live_ / rk_live_ + >=24 base62
- sendgrid_key: SG. + 22-char id + . + 43-char secret
- huggingface_token: hf_ + 34 base62
The SendGrid rule terminates with a negative lookahead (?![A-Za-z0-9_-]) rather
than \b: because its final class includes -, a trailing \b would fail to match a
key whose last character is - (a - before a quote/space is not a word boundary).
Regression tests cover a hyphen-terminated key in every scanner.
All test fixtures are assembled from fragments at runtime so the source never
embeds a contiguous secret-shaped literal. Also updates the review-enrichment
generic-assignment test, whose sk_live_ fixture now (correctly) trips the new
Stripe rule, to use a non-format high-entropy value.
0 commit comments