An API key is a password one program uses to prove itself to another, and it often sits inside the config files and logs people paste into AI assistants. On 22 November 2026 we read the key documentation of seven vendors and counted 30 kinds of secret credential. Twenty carry a prefix or marker the vendor states in words, so a scanner can recognise them on sight. Seven have no documented prefix or format. Once a key has gone into a chat, all five vendors whose pages give a step for a leak say to rotate or revoke it.
Most documented secret types carry a stated prefix
The seven are GitHub, Amazon Web Services (AWS), Google Cloud, OpenAI, Anthropic, Stripe and Slack, whose pages describe 34 current key types by our count. Four are not secrets in themselves: two kinds of AWS access key ID and Stripe's two publishable keys, which Stripe's "API keys" page calls the only ones "safe to expose outside your application's back end". The sorting of the other 30 is ours.
| How the vendor documents the shape | Secret types (of 30) | Examples |
|---|---|---|
| Prefix or marker stated in words | 20 | GitHub ghp_, Stripe sk_live_, Slack xoxb-, Anthropic sk-ant-admin |
| Prefix shown only in an example | 3 | Google AIza, OpenAI sk- |
| Documented with no prefix | 2 | AWS secret access key, GitHub's pre-2021 tokens |
| No format on the pages we read | 5 | AWS session token, Anthropic's standard API key, Slack's configuration and service tokens |
GitHub's 2021 post "Behind GitHub's new authentication token formats" explains the move to prefixes: many older tokens were 40-character hex strings "indistinguishable from other encoded data like SHA hashes", and the new underscore is "not a Base64 character". The post forecast a 0.5% false-positive rate from the prefix alone, an expectation rather than a measurement. GitHub's current token-format table lists six prefixes.
OpenAI's API reference states no key format in words; its example values begin sk-, a prefix other services use too. Google's "Manage API keys", updated 17 November 2026, gives one 39-character example and no rule.
Randomness cannot tell an AWS secret key from a hash
AWS's IAM User Guide pairs each key ID with a secret access key ("You must use both"), and none of the three AWS pages we read gives the secret a prefix or length rule. Some scanners fall back on Shannon entropy, a randomness score in bits per character; gitleaks v8.30.1, released 21 March 2026, sets a threshold on 130 of its 222 rules.
AWS's published example secret scored 4.66 bits per character, below the 4.82 of a 40-character fragment of a base64 SHA-256 hash of "hello"; 1,000 random 40-character base64 strings had a median of 4.78. Two everyday English sentences scored 3.63 and 3.73, though most of the "quick brown fox" pangram, built to use every letter, reached 4.33. A threshold low enough to catch the key would also catch the hash, so a secret with no prefix can be recognised only by the name beside it, such as aws_secret_access_key.
Vendors publish prefixes and almost never lengths
Of the seven, only GitHub and Slack state lengths, and GitHub's are changing. On 27 April 2026 it began rolling out a stateless format for new GitHub App installation tokens, and its changelog of 15 May 2026 says the token "is longer (~520 characters) and contains two dots", about 13 times the 40 characters of the 2021 formats. The changelog asks for "No hardcoded token length assumptions". A rule fixed at 40 characters stops seeing these tokens, so a scanner can only set a minimum.
GitHub's push protection covers pushes, commits and uploads
GitHub's supported secret scanning patterns page listed 532 provider patterns from 207 providers when we parsed it on 22 November 2026, and 465 support push protection; Google API keys and Stripe webhook signing secrets are among those without it.
The "Push protection" page says it "blocks pushes that contain secrets". For users it "is enabled by default" on public repositories; for a repository it "is disabled by default", and by default anyone with write access can bypass it by giving a reason. It watches pushes, web commits, uploads and the API, and a key pasted into a chat window never meets it. Our guide to AI tools and company data covers what a service keeps of a paste.
Checking a paste in the browser before it is sent
Our Secret Leak Checker reads pasted text against 19 rules, from the prefixes above to private-key headers and values assigned to names such as password. Our code sends none of it anywhere; the page's ads and, if you allow it, Google Analytics run scripts that are not ours. Findings are masked. For 11 of the 19 rules the checker quotes that vendor's advice, and for the rest, such as a Slack token, general steps from GitHub and Stripe. "Copy redacted text" swaps each secret for a label such as [REDACTED: GitHub token].
Paste a line of forty zeros and the checker reports nothing matched, warning that keys with no prefix can pass unseen. Paste aws_secret_access_key = 0000000000000000000000000000000000000000 and it flags a password or key assignment by the name alone, though it never tests whether a key works.
On 23 November 2026 we put a fake value for each of the 25 secret types we could build through the checker's rule list, the file the live page loads. It flagged 22, missing GitHub's pre-2021 tokens and a bare AWS secret key, neither of which carries a prefix, and OpenAI's 17-character example admin key, shorter than the rule's minimum. A prefix rule can also fire on ordinary text that happens to begin the same way, such as a hyphenated name starting sk-, so the checker's sk- rule adds conditions of our own, among them a digit and a minimum length.
Replacing a key that has already gone out
Take a developer at a small online shop who pasted a .env file holding a Stripe secret key into an assistant to debug a failed payment. Stripe's "Best practices for managing secret API keys" says to "rotate it immediately even if you aren't sure anyone saw it", and names chat messages among places keys should never be shared.
OpenAI's "Best practices for API key safety" says to "rotate your key immediately from the API Keys page". Anthropic's article of 19 October 2026 recommends "revoking the key immediately".
GitHub's "Keeping your API credentials secure" puts the steps in order: generate a new credential, replace the old one everywhere it is stored, and only then "Delete the old compromised credential". AWS's "Secure access keys" asks for the same when it says to "update the access key and delete the previous access key". Google's API key best practices give no step for a leak, their nearest being to rotate keys periodically, and Slack's "Tokens" page gives none. For the shop's developer, GitHub's order means the new Stripe key goes into the .env file before the old one is deleted.
Go further
Relevant tools
More from AI & ML