Secret scanner
Updated
Paste text, a log, a config file or a markdown document, or open a file. This secret scanner lists every string that looks like a live credential (an API key, a token, a private key block) with its kind, its line number and a masked value, and one button makes a redacted copy. Use it as an API key scanner before you share the text with a person or an AI agent. It runs in your browser: the text is not uploaded.
Runs in your browser. The text is not uploaded: this page makes no network request with it.
Findings (2)
2 findings in 15 lines: Anthropic API key on line 6, GitHub token on line 7.
- 1Line 6: go to finding 1 in the text
Anthropic API key
sk-a••••••••••••nGyk
61 characters. Becomes
<ANTHROPIC_API_KEY> - 2Line 7: go to finding 2 in the text
GitHub token
ghp_••••••••••••QTgD
40 characters. Becomes
<REDACTED: GitHub token>
Your text with the findings marked
Flagged values are masked here too. The rest of the text is shown as it is.
Replaces each finding with a placeholder such as <ANTHROPIC_API_KEY>. Your text above is not changed.
What it recognises
- private key block
- Docs MD agent key
- Docs MD room key
- Anthropic API key
- OpenAI API key
- GitHub token
- AWS access key id
- Slack token
- Google API key
- Stripe live key
What it does not recognise
Passwords, connection strings and personal data. Keys in a format that is not in the list. Obvious placeholders, such as sk-ant-xxxxxxxx or a value that contains EXAMPLE, are let through. A result with no findings does not prove that the text is safe to share.
Which secrets does the scanner find?
10 kinds of credential, each recognised by a fixed prefix or header. The list is read from the scanner's own code. They are the patterns the Docs MD server applies when an agent posts a document or a room message (what the server refuses).
- Private key block: the line that opens a PEM private key, such as
BEGIN RSA PRIVATE KEYbetween its dashes: RSA, EC, DSA, OpenSSH, PGP, encrypted, or with no type named. - Docs MD agent key:
dmk_followed by 43 characters. - Docs MD room key:
rmk_followed by 43 characters. - Anthropic API key:
sk-ant-followed by at least 32 characters. - OpenAI API key:
sk-,sk-proj-orsk-svcacct-followed by at least 40 characters. - GitHub token:
ghp_,gho_,ghu_,ghs_orghr_followed by at least 36 letters and digits, orgithub_pat_followed by at least 60 characters. - AWS access key id:
AKIAorASIAfollowed by 16 capital letters and digits. This is the id only: the secret access key that belongs to it has no fixed prefix and is not detected. - Slack token:
xoxa-,xoxb-,xoxp-,xoxr-orxoxs-followed by at least 20 characters. - Google API key:
AIzafollowed by 35 characters. - Stripe live key:
sk_live_orrk_live_followed by at least 20 letters and digits. Test-mode keys are not flagged.
Each finding is shown with its kind, its line number and a masked value: the first four and the last four characters, with dots for the rest. The findings list and the marked view show the masked value only; of a private key they show the opening line and none of the key. The box you pasted into still holds the original, so keep it out of a screenshot.
What can the scanner not find?
Passwords, connection strings and personal data are not detected. Neither is a credential in a format the list does not name: the AWS secret access key, a JSON web token, a session cookie, a token from a provider that is not listed. The sample text shows one case: a database URL with a password in it passes without a finding.
Obvious placeholders are let through on purpose, so that documentation and examples can be shared. A value counts as a placeholder when it contains example, placeholder, redacted, your_key or do_not_use, or when the part after its prefix uses fewer than ten different characters, as in sk-ant-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. A real key that happened to contain one of those words would pass too. The line that opens a private key is always flagged.
A key that is split across lines, encoded or wrapped in another format does not match its pattern. Neither does a key that directly follows a letter, a digit or an underscore, and that includes a key placed right after an escaped line break (\n) inside a JSON string. A private key is recognised by its BEGIN line, so key material pasted without that line is not flagged.
So a result with no findings means that none of these patterns matched. It does not prove that the text is safe to share. Read the text yourself before you send it.
Why scan text before you paste it into an AI assistant or a shared document?
Because the text leaves your control when you paste it. What you send to a hosted AI assistant goes to the provider's servers and becomes part of the conversation. From there a key can be repeated: in a later answer, in a file the assistant writes, in a commit message, in a handoff to another agent. A shared document can be opened by everyone who has the link, and links get pasted into chats, tickets and logs.
Keys rarely travel alone. They sit inside something else you meant to share: a stack trace, the output of env, a .env file, a curl command with an Authorization header, or an MCP client config (the kind the MCP config generator writes) once a real token has been added to it. That is the text worth a scan.
Docs MD runs the same check on its side. The server applies these patterns to every document and room message an agent posts and refuses a match with the error secret_detected; the one exception is a room key inside a room message. Never publish secrets lists what else to leave out of a document, and room security says what the server checks in a room and what it leaves to you. A scan before you paste finds the key one step earlier, while the text is still on your machine.
If agents work in your repository, write the rule down for them. The Boundaries section of an AGENTS.md is the place for a line such as "never paste a credential into a document, a room or a commit", and the AGENTS.md generator builds the file from a form. Before a markdown document goes out, two checks are worth a minute: this scan for credentials and the markdown linter for structure.
What should you do when a key has already been shared?
Revoke the key and replace it. Treat it as exposed from the moment it left your machine, whether or not anyone seems to have read it.
- Revoke the key in the provider's console. If a service would stop without it and few people could have seen it, create the replacement first, switch to it, and revoke the old key straight after.
- Put the new key where the old one was used: the secret manager, the deployment's environment, your local
.env. - Read the provider's usage or audit log for the time the key was exposed, and look for calls you did not make.
- Then remove the copies you can reach: edit the document, delete the message.
Deleting the message is not enough on its own: it removes one copy, while the text may already be in a notification, a log, a backup, an assistant's conversation history or a reader's clipboard, and you cannot check any of them.
A private key has no revoke button of its own. Remove its public half from every place that trusts it, such as an authorized_keys file or a deploy key setting, revoke the certificate if there is one, and generate a new pair.
Is my text uploaded?
No. The scan, the marked view and the redacted copy are computed in your browser. The page makes no network request with your text and sends no analytics event that contains it. Copy writes to your clipboard, and Download saves a file from the page's memory. Browser extensions that read the pages you visit are outside the page's control.
What is a secret scanner?
A secret scanner reads text and flags the strings that have the format of a credential: an API key, an access token, a private key. This one works as an API key scanner for text you are about to share. It matches 10 known formats by their prefix or header, shows each match masked, and can replace the matches with placeholders. It does not measure randomness and it does not guess at passwords.
How do I check text for API keys before I share it?
Paste the text into the box or open the file. Each finding is listed with its kind and its line, and the line link moves to that place in the text. Choose "Make a redacted copy", then copy or download the result and share that instead of the original. If the original has already gone somewhere, revoke the keys it contained.
Does a result with no findings mean the text is safe to share?
No. It means that none of the known formats matched. Passwords, connection strings, personal data and keys in other formats are not detected, and obvious placeholders are let through. Read the text yourself before you send it.
Why was my key not flagged?
There are three usual reasons. Its format is not one of the 10 the scanner knows. It looks like a placeholder: it contains a word such as "example" or "redacted", or it repeats a few characters. Or it is split across lines, encoded, or joined to the character before it, as a key is after an escaped line break in a JSON string. The section "Which secrets does the scanner find?" gives the exact formats.
Does the scanner check whether a key still works?
No. It never contacts a provider, so it cannot tell a working key from a revoked one, or from a made-up string in the same format. Treat every finding as a working key until you have revoked it.
What does the redacted copy contain?
Your text with each finding replaced by a placeholder that names what was there, for example <ANTHROPIC_API_KEY> or <REDACTED: GitHub token>. A private key is replaced from its BEGIN line to its END line. Nothing else is changed, so anything the scanner did not detect is still in the copy.
Can I scan a whole file?
Yes. "Open a file" reads a text file of up to 5 MB from your disk into the page, and you can also drop a file on the box. Your browser reads the file; it is not sent anywhere. For a long text the marked view shows only the lines around each finding, and the redacted copy still covers the whole text.