Detection reference · Credentials and secrets · Updated 2026-11-05
GitHub tokens: ghp_, github_pat_ and the other prefixes
GitHub prefixes every token it issues, so a leaked one is recognisable on sight: by you, by Redaxa, and by anyone scraping public code for credentials. This page shows exactly how Redaxa treats each prefix.
At a glance
| Reported as | API key or token |
|---|---|
| Category | Credentials and secrets |
| Severity | critical: direct account or system compromise, as with keys, passwords and tokens |
| Replaced with | [SECRET] |
| Where it runs | The same engine runs in the Chrome extension (free checks, on your device), in the web check and the Windows app (on Redaxa's server; the text is not stored) and in public repository checks. |
| Engine rule | scanner.ts, line 205 |
What it looks like
ghp_ (classic personal access token), gho_ (OAuth), ghu_ (user-to-server), ghs_ (server-to-server) and ghr_ (refresh) followed by at least 20 letters, digits or underscores; github_pat_ (fine-grained personal access token) followed by exactly 82.
Example 1
You paste
export GITHUB_TOKEN=ghp_RedaxaDocsSampleNotRealRedaxaDocsSam
Redaxa returns
export GITHUB_TOKEN=[SECRET]
| Reported as | API key or token |
|---|---|
| Severity | critical: direct account or system compromise, as with keys, passwords and tokens |
| Replaced with | [SECRET] |
| Probable service | GitHub |
| Credential type | Personal access token |
| Evidence | GitHub-specific token prefix; account and validity are not verified. |
| Recommended action | Revoke or rotate if genuine |
Example 2
You paste
token: github_pat_RedaxaDocs_Sample_NotReal_RedaxaDocs_Sample_NotReal_RedaxaDocs_Sample_NotReal_Reda
Redaxa returns
token: [SECRET]
| Reported as | API key or token |
|---|---|
| Severity | critical: direct account or system compromise, as with keys, passwords and tokens |
| Replaced with | [SECRET] |
| Probable service | GitHub |
| Credential type | Fine-grained personal access token |
| Evidence | GitHub-specific token prefix; account and validity are not verified. |
| Recommended action | Revoke or rotate if genuine |
Example 3
You paste
CI uses ghs_RedaxaDocsSampleNotRealRedaxaDocsSam
Redaxa returns
CI uses [SECRET]
| Reported as | API key or token |
|---|---|
| Severity | critical: direct account or system compromise, as with keys, passwords and tokens |
| Replaced with | [SECRET] |
| Probable service | GitHub |
| Credential type | GitHub app / OAuth token |
| Evidence | GitHub-specific token prefix; account and validity are not verified. |
| Recommended action | Revoke or rotate if genuine |
All values on this page are synthetic or published specimens; none is a working credential or a real person's data.
Key format, rotation and exposure
- Why the prefixes exist. GitHub's engineering team added the
ghprefix plus a type letter and an underscore (ghp_,gho_,ghu_,ghs_,ghr_) so tokens can be recognised by scanners; the older 40-character hex tokens looked like any SHA hash. The article expects the prefix alone to bring the false-positive rate of secret scanning down to about 0.5%, and says the underscore also makes a double-click select the whole token. - A checksum is built in. The last 6 characters of these tokens hold a Base62-encoded 32-bit CRC32 checksum, which lets a scanner reject a made-up string offline. The article describes this as the starting design and notes that details may change, so Redaxa does not check the checksum: it reports any value with the right prefix and body length, and it skips obvious placeholders.
- Who else is looking. Because the format is public, anyone scraping public code can find these tokens the same way. If one was ever in a public commit, treat it as exposed even if you deleted the file a minute later, and revoke it before cleaning history.
In a repository check
The same example, committed to a public repository and run through the free repository check:
.github/workflows/release.yml: API key or token, listed for review (severity critical). Credential pattern matched. Validity is not tested; review and rotate if genuine.- Same value in
tests/fixtures/release.yml: Test or example value, counted but not listed. Real-looking keys in test files are still reported.
Values are always shown masked in repository reports. No key is ever tested against its provider.
What it does not flag
export GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: not flagged. A run of x after the prefix is read as a placeholder, not a token.Generate a ghp_ token under Settings: not flagged. The prefix alone, without the token body, is ordinary text.
If it already leaked
Revoke the token on GitHub (Settings, Developer settings, Personal access tokens, or the app's own settings), create a new one with the narrowest scopes and expiry you can, and only then clean the value out of code and history.
What Redaxa adds to every finding of this kind: If genuine, revoke or rotate it at the issuing service, update the application, then remove the exposed value from code and review Git history. Deleting it from Git does not revoke access.
Official guidance: docs.github.com.
Step by step: pasted a key into ChatGPT, or committed one to GitHub.
Check before you paste
The free Chrome extension runs this check inside ChatGPT, Claude, Gemini and Perplexity before a message is sent, on your device and with no daily limit. On the web you get 5 free prompt checks a day with no account.
Add the Chrome extensionTry a free web checkWorried it is already in your code? Check a public GitHub repository free (3 checks a day).
Related
- GitLab personal access tokens
- OpenAI API keys
- Anthropic API keys
- Stripe keys and webhook secrets
- Supabase keys
- Slack tokens and webhook URLs
- Google API keys
- AWS access keys
- npm access tokens
- PyPI API tokens
- Hugging Face access tokens
- SendGrid API keys
- JSON Web Tokens (JWT)
- Bearer tokens
- Passwords in URLs
- Secrets in configuration values
- Passwords written in text
- Private keys (PEM)
- I pasted an API key into ChatGPT: what to do
- Stop API keys leaking into AI prompts
- Check a public GitHub repository for leaked API keys
- Free GitHub secret scanner
- Everything Redaxa detects
Sources
- Redaxa engine: scanner.ts line 205, credential-context.ts line 30 (GitHub). Every output on this page was produced by that code when the page was built.
- GitHub blog: Behind GitHub's new authentication token formats
- GitHub Docs: Removing sensitive data from a repository