Secret detection check · OpenAI

OpenAI API key

Finds OpenAI API key values in every commit of a repository's git history and in lines staged for a commit, with a pattern adopted from gitleaks.

Why it matters

Anyone who can read the repository, or any clone or fork of it, can use a committed credential until it is revoked, and deleting the line does not remove it from history.

How to fix it

Revoke this OpenAI API key at OpenAI and issue a replacement, then update every service that used it. TrustIvan has no console path recorded for this provider.

How it recognises a value

  • A line is only looked at when it contains the keyword t3blbkfj (ignoring case).
  • A match counts only when its Shannon entropy is above 3, so a placeholder of the same shape (all zeros, all x) is not reported.
  • Adopted with attribution from the gitleaks rule openai-api-key (MIT License).
The pattern (a Go regular expression)
\b(sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})\b|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})(?:[\x60'"\s;]|\\[nr]|$)

What TrustIvan reads

Used by the git history scan (off until SECRET_HISTORY_ENABLED is set) and the pre-commit check; a default repository scan uses the scanner's built-in rules. A finding is high severity, and critical when a live check confirms the provider still accepts it.

TrustIvan can ask OpenAI whether a found value still works, once an owner or admin turns validity checking on, with the request GET https://api.openai.com/v1/models. That check is tested against the provider's documented responses, not a live account.

Terms: Secret scanning, Secret sprawl, Credential rotation

All secret detection checks · The whole catalogue · How this works in TrustIvan · Documentation

See TrustIvan on your own estate.

Book thirty minutes with an engineer and bring an image, a repository or a cloud account, or start free on the hosted service.