API Token Formats, Secret Scanning, DLP Detection and Rotation
How scannable API token prefixes work, what happens when tokens leak, and how to use DLP, search, and roll operations.
This page summarises Cloudflare documentation on API keys and API tokens: the prefixed scannable credential format, automatic leak detection through partner secret scanning (including GitHub Secret Scanning), Zero Trust DLP detections in Gateway traffic, and dashboard or API operations to search and roll tokens after exposure.
API token formats: what the cfk_, cfut_, and cfat_ prefixes mean
Section titled “API token formats: what the cfk_, cfut_, and cfat_ prefixes mean”Cloudflare API keys and API tokens use a prefixed, scannable format that makes them identifiable by credential scanning tools. Each credential type has a distinct prefix followed by 40 characters and a checksum.
| Credential type | Description | Format |
|---|---|---|
| Global API Key | Global key tied to your user account (full access) | cfk_ + 40 characters + checksum |
| User API Token | Scoped token for specific permissions | cfut_ + 40 characters + checksum |
| Account API Token | Token owned by the account, not tied to a specific user | cfat_ + 40 characters + checksum |
Cloudflare API keys and API tokens use a prefixed, scannable format that makes them identifiable by credential scanning tools. Each credential type in the following table has a distinct prefix followed by 40 characters and a checksum.
— Cloudflare, Token formats
Existing tokens continue to work. Every new token you create or roll uses the scannable format automatically. The Credentials and Secrets predefined DLP profile validates these Cloudflare entries algorithmically using a checksum (not plain regex alone): cfk_, cfut_, and cfat_ each followed by 40 alphanumeric characters and an 8-character hex checksum.
Service token Client Secrets and the cfast_ prefix
Section titled “Service token Client Secrets and the cfast_ prefix”Access service tokens use a separate Client Secret format. As of August 26, 2026, new Client Secrets use cfast_[40 alphanumeric characters][8-character checksum]. The prefix and checksum make the secrets easier for credential scanning tools to identify. Existing Client Secrets use a 64-character hexadecimal format; they continue to work and do not require rotation.
As of August 26, 2026, new service token Client Secrets use the format cfast_[40 alphanumeric characters][8-character checksum]. The prefix and checksum make the secrets easier for credential scanning tools to identify.
— Cloudflare, Service tokens
Pre-2026 tokens: still valid, harder to match in DLP
Section titled “Pre-2026 tokens: still valid, harder to match in DLP”Tokens created before the scannable format use unprefixed strings. They continue to work, and Cloudflare scans for and revokes leaked tokens in both old and new formats for partner secret scanning. DLP predefined entries only match credentials generated after the format change.
| Credential type | Old format |
|---|---|
| Global API Key | 37–45 character lowercase hex string |
| User API Token | 40-character alphanumeric string |
| Account API Token | 40-character alphanumeric string |
Credentials generated before this format change will not be matched by these entries.
— Cloudflare, Detect Cloudflare API tokens with DLP
Secret scanning: how leaked API tokens are found in GitHub and other repos
Section titled “Secret scanning: how leaked API tokens are found in GitHub and other repos”Cloudflare API tokens now include identifiable patterns that enable secret scanning tools to automatically detect them when leaked in code repositories, configuration files, or other public locations.
Cloudflare API tokens now include identifiable patterns that enable secret scanning tools to automatically detect them when leaked in code repositories, configuration files, or other public locations.
— Cloudflare, API tokens now detectable by secret scanning tools
API tokens generated by Cloudflare now follow a standardized format that secret scanning tools can recognize. When a Cloudflare token is accidentally committed to GitHub, GitLab, or another platform with secret scanning enabled, the tool will flag it and alert you.
The prefixed format and checksum allow high-confidence detection without requiring surrounding context such as Authorization: Bearer headers. Cloudflare partners with credential scanning providers to proactively find leaked tokens and revoke them before malicious use. For repository hosting, Token formats notes participation in GitHub Secret Scanning: GitHub scans commits in public and private repositories; for public repos, GitHub verifies the token via the checksum, sends Cloudflare a webhook, and Cloudflare automatically revokes the token and emails you. For private repos, GitHub notifies you so you can rotate.
GitHub Secret Scanning for public repositories is called out in the changelog as automatically enabled. Other platforms with secret scanning gain the same pattern recognition without extra Cloudflare-side configuration on your part.
What happens when a third-party scanner reports a leaked token
Section titled “What happens when a third-party scanner reports a leaked token”When a third-party secret scanning tool detects a leaked Cloudflare API token, Cloudflare immediately deactivates the token, emails the token creator, marks the token as Exposed in the dashboard, and you can roll or delete it from token management pages.
When a third-party secret scanning tool detects a leaked Cloudflare API token:
Cloudflare immediately deactivates the token to prevent unauthorized access. The token creator receives an email notification alerting them to the leak. The token is marked as “Exposed” in the Cloudflare dashboard. You can then roll or delete the token from the token management pages.
— Cloudflare, API tokens now detectable by secret scanning tools
Leaked credentials are a common security risk. The scannable format is meant to shorten the risk window: detect leaks faster, revoke exposed tokens before exploitation, and reuse existing secret scanning infrastructure.
DLP detection: block or log API tokens in Zero Trust Gateway HTTP traffic
Section titled “DLP detection: block or log API tokens in Zero Trust Gateway HTTP traffic”Zero Trust Data Loss Prevention adds predefined entries for Cloudflare API credentials in the Credentials and Secrets DLP profile. Detection uses the new structured prefix and CRC32 checksum suffix so matches have high confidence and low false positive rates.
| Entry name | Token prefix | Detects |
|---|---|---|
| Cloudflare User API Key | cfk_ |
User-scoped API keys |
| Cloudflare User API Token | cfut_ |
User-scoped API tokens |
| Cloudflare Account Owned API Token | cfat_ |
Account-scoped API tokens |
These detections target the new Cloudflare API credential format, which uses a structured prefix and a CRC32 checksum suffix. The identifiable prefix makes it possible to detect leaked credentials with high confidence and low false positive rates — no surrounding context such as Authorization: Bearer headers is required.
— Cloudflare, Detect Cloudflare API tokens with DLP
DLP answers a different question than repo scanning: whether a token appears in live HTTP traffic proxied through Cloudflare Gateway (for example pasted into a form, chat, or non-Git channel).
How to enable Cloudflare API token detections in a Gateway policy
Section titled “How to enable Cloudflare API token detections in a Gateway policy”- In the Cloudflare dashboard, go to Zero Trust → DLP → DLP Profiles (changelog steps).
- Select the Credentials and Secrets profile (predefined profiles).
- Turn on one or more of the new Cloudflare API token entries.
- Use the profile in a Gateway HTTP policy to log or block traffic containing these credentials.
Example policy row from the documentation:
| Selector | Operator | Value | Action |
|---|---|---|---|
| DLP Profile | in | Credentials and Secrets | Block |
You can enable individual entries to scope detection—for example, Account Owned API Token only—without enabling User API Key detection. See predefined DLP profiles for the full Credentials and Secrets list (AWS, Azure, GCP, SSH, and Cloudflare entries).
Search API tokens by name: dashboard and /user/tokens API
Section titled “Search API tokens by name: dashboard and /user/tokens API”Large token lists are easier to manage with name search on both account-owned and user-owned tokens.
You can now search API tokens by name, making it easier to find specific tokens across large token lists without manually paginating.
— Cloudflare, Search API tokens by name
Dashboard: account API tokens and user API tokens pages include a search bar; type a name to filter results.
API: the /user/tokens and /accounts/{account_id}/tokens endpoints accept a name query parameter to filter tokens by name (Search API tokens by name).
Use search after a leak alert to find the exposed token quickly before rolling or deleting it.
Roll tokens and recover from compromise: keep permissions, invalidate the secret
Section titled “Roll tokens and recover from compromise: keep permissions, invalidate the secret”If a token is lost or compromised, you can create a new token or roll the token to generate a new secret. Rolling invalidates the previous token but keeps the same access and permissions. The new token uses the scannable format.
Rolling your API token into a new one will invalidate the previous token, but the access and permissions will be the same as the previous API token. The new token uses the scannable format, which allows credential scanning tools to detect leaked tokens.
— Cloudflare, Roll tokens
Dashboard path: My Profile → API Tokens → next to the token, ⋯ → Roll → Confirm (Roll tokens, Secure compromised account).
For the legacy Global API Key (full account access tied to the user), use Change in the API Keys section instead of roll (Get Global API key (legacy)).
Pre-commit secret checks: pattern matching plus judgment (Perplexity Decider)
Section titled “Pre-commit secret checks: pattern matching plus judgment (Perplexity Decider)”Repo and Gateway controls catch many leaks; developers can add a local pre-commit hook that combines regex for known formats with a secondary check for unstructured secrets. Perplexity’s Decider for Mac documents a hook that blocks commits when staged added lines match patterns (private keys, AWS, GitHub, Slack, Perplexity keys) or when a Decider noul question scores a configured threshold for “real password, API key, access token, or private key.”
The hook fails closed if Decider is unreachable. It only inspects text added in the commit on that machine; the doc recommends also running a dedicated secret scanner in CI for full coverage—complementary to Cloudflare’s own scannable token format and GitHub partner revocation, not a substitute.
Common mistakes
Section titled “Common mistakes”- Assuming DLP will catch old tokens. Only post-format-change credentials match the predefined Cloudflare DLP entries; plan rotation if you still rely on legacy formats (Detect Cloudflare API tokens with DLP).
- Rolling without updating every consumer. Automation, CASB, CI variables, and secrets managers must receive the new value (Troubleshoot compute accounts).
- Treating private-repo GitHub alerts like automatic revocation. Public repos trigger partner revocation; private repos notify you to rotate (Token formats).
- Using Global API Key where scoped tokens suffice. The Global API Key grants full user-level access; prefer scoped tokens and roll or change keys using the paths above if compromised.
How to check this on your site
Section titled “How to check this on your site”- Open Token formats and confirm newly created or rolled tokens in My Profile → API Tokens match the documented
cfut_orcfat_(orcfk_for Global API Key) prefix and checksum layout. - In Zero Trust → DLP → DLP Profiles, verify Credentials and Secrets includes the Cloudflare entries you need (predefined profiles) and that a test Gateway HTTP policy references that profile (Detect Cloudflare API tokens with DLP).
- On a token list page, use the name search bar or call
/user/tokens?name=...to confirm search works for a known token name (Search API tokens by name). - After any test rotation, confirm integrations still authenticate and no token shows status Exposed in the dashboard (Roll tokens).
- You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about, and we will correct or clarify it.