SendGrid API Key

Detects SendGrid (Twilio SendGrid) API keys, formatted as SG. then a 22-character key id, a dot, and a 43-character secret. A leaked key allows sending email and reading account data through the SendGrid API.

Type
regex
Engine
universal
Confidence
high
Confidence justification
High confidence: the SG. prefix with two fixed-length base64url segments separated by a dot is a distinctive SendGrid structure with very low false-positive risk.
Jurisdictions
global
Regulations
Criminal Code Act 1995 (Cth)
Frameworks
CIS Controls, ISO 27001, NIST CSF, SOC 2
Data categories
credentials, security
Scope
narrow
Risk rating
8
Platform compatibility
Purview: Compatible, GCP DLP: Unsupported, Macie: Unsupported, Zscaler: Compatible, Palo Alto: Unsupported, Netskope: Unsupported

Pattern

(?<![A-Za-z0-9])SG\.[A-Za-z0-9_-]{22}\.[A-Za-z0-9_-]{43}(?![A-Za-z0-9])

Corroborative evidence keywords

sendgrid, twilio sendgrid, api key, SENDGRID_API_KEY, mail send, bearer token, smtp

Proximity: 300 characters

Should match

Should not match

Known false positives

References