Openai Key
Detects Openai Key patterns.
- Type
- regex
- Engine
- universal
- Confidence
- low
- Confidence justification
- Low confidence: generic pattern format that may match unrelated data. Corroborative evidence keywords are essential for reliable detection. Added context gating and exclusion rules improve precision and reduce incidental matches.
- Detection quality
- Mixed
- Jurisdictions
- global
- Regulations
- Criminal Code Act 1995 (Cth)
- Frameworks
- CIS Controls, ISO 27001, NIST CSF, PCI-DSS, SOC 2
- Data categories
- credentials, security
- Scope
- wide
- Platform compatibility
- Purview: Compatible, GCP DLP: Compatible, Macie: Compatible, Zscaler: Compatible, Palo Alto: Compatible, Netskope: Compatible
Pattern
\bsk-[A-Za-z0-9\s]{48,52}\b
Corroborative evidence keywords
api key, api_key, apikey, access key, secret key, private key, auth token, authorization, access token, bearer, conn str, connection string, connectionstring, cookie, credential, database, host, JWT, oauth, passphrase (+37 more)
Proximity: 300 characters
Should match
sk-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv— OpenAI API keysk-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijkl— Alternate OpenAI key formatsk-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV— Mixed-case OpenAI key
Should not match
sk-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstu— Too few characters after prefix (47 instead of 48)sk-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvw— Too many characters after prefix (49 instead of 48)pk-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv— Wrong prefix (pk instead of sk)template example placeholder record identifier— Template/sample context should be excluded even when anchor words are present
Known false positives
- Authentication-related terminology in software documentation, security training materials, or system architecture descriptions without actual credentials. Mitigation: Require proximity to credential-specific patterns (API keys, connection strings, tokens) rather than general security terminology.
- Code snippets and configuration examples containing credential-related keywords or placeholder values in developer documentation. Mitigation: Check for common placeholder patterns (example.com, localhost, 0000) and documentation file types to reduce false positives from technical writing.