Detection reference · Credentials and secrets · Updated 2026-11-09
Anthropic API keys (sk-ant-)
Anthropic API keys carry the sk-ant- prefix, which makes them one of the few sk- keys that can be attributed to a provider from the value alone.
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
sk-ant- followed by the rest of the key (Redaxa's rule needs at least 16 letters, digits, hyphens or underscores after sk-).
Example
You paste
ANTHROPIC_API_KEY=sk-ant-api03-RedaxaDocsSampleNotRealRedaxaDocsSampleN
Redaxa returns
ANTHROPIC_API_KEY=[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 | Anthropic / Claude |
| Credential type | API key |
| Evidence | Anthropic-specific prefix; ownership and permissions are unverified. |
| 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
- What Anthropic documents. The key is a static
sk-ant-api...secret (the docs' own example issk-ant-api03-...), sent asAuthorization: Bearer <key>or in the legacyx-api-keyheader. The official SDKs read it from theANTHROPIC_API_KEYenvironment variable, which is why that name is the first thing to look for in a pasted shell session,.envfile or CI log. - Three key types. Personal keys act as you, service account keys act as a service account, and workspace keys (now legacy) belong to the workspace alone. Personal and service account keys stop working when the user or service account is removed from the organization; a workspace key does not, so an old workspace key is the one most likely to outlive its owner.
- Disable or delete. In the Claude Console, Disable is reversible (the key can be re-enabled); Delete is permanent and the key is archived. Anthropic's guidance is to disable or delete any key you suspect has leaked. Our advice: disable first if you need a minute to deploy the replacement, then delete it, so nobody can switch an exposed key back on by mistake.
- Expiry is set once. When a key is created you pick a preset of 3 hours, 1 day, one week or 30 days, a custom duration, or Never; it cannot be changed afterwards, and a key that has expired returns a 401 authentication error and cannot be reactivated. A short expiry limits how long a leaked key stays useful, but Anthropic is explicit that it does not replace keeping keys in a secrets manager.
- Keep it out of browsers. Anthropic tells developers to call the API from their own back end, because anyone who loads a web page can read a key that sits in that page's code. For production workloads on AWS, Google Cloud or Azure, Workload Identity Federation exchanges a short-lived token instead, so there is no
sk-ant-api...string to leak.
In a repository check
The same example, committed to a public repository and run through the free repository check:
.env.production: 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/.env.production: 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
ANTHROPIC_API_KEY=sk-ant-api03-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: not flagged as API key or token; flagged as Secret in a configuration value. A run of x after the prefix is a placeholder, so it is not reported as an Anthropic key. Because the value still contains digits (api03), the configuration-value rule flags it: a placeholder that is cheap to dismiss.
If it already leaked
Disable or delete the key in the Claude Console (API keys), create a replacement, and review usage and spend for the period the key was exposed.
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: platform.claude.com.
Step by step: pasted a key into ChatGPT, or committed one to GitHub.
Common questions
What should I do if my Anthropic API key leaked?
Disable or delete the key in the Claude Console under API keys, create a replacement, and review usage and spend for the period the key was exposed. Disable can be reversed; Delete is permanent.
What does an Anthropic API key look like?
It starts with sk-ant-. The example in Anthropic's own docs is sk-ant-api03-... and the official SDKs read the key from the ANTHROPIC_API_KEY environment variable.
Where should I look for a leaked Anthropic key?
Start with the name ANTHROPIC_API_KEY in pasted shell sessions, .env files and CI logs, because that is the variable the official SDKs read.
Can I put an Anthropic API key in a web page?
No. Anthropic tells developers to call the API from their own back end, because anyone who loads a web page can read a key that sits in its code.
Does an expired Anthropic API key still work?
No. A key that has expired returns a 401 authentication error and cannot be reactivated.
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
- GitHub tokens
- GitLab personal access tokens
- OpenAI 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 31 (Anthropic / Claude). Every output on this page was produced by that code when the page was built.
- Claude Docs: Authentication (key types, Disable and Delete, expiration)