Strip API keys and secrets out of code before you paste it
Preset for source code and configuration: secret detectors on, prose detectors off. It recognises OpenAI, Anthropic, AWS, GitHub, Google, Stripe, Slack, Twilio, SendGrid, GitLab, npm and Hugging Face key formats, JWTs, PEM private key blocks, generic API_KEY=… and password: assignments, bearer tokens, internal IP addresses and MAC addresses.
Names and company names are switched off here on purpose: a stack trace full of [NAME_1] is unreadable, and variable names are usually the context that makes the model’s answer correct.
Your text
Safe to paste
Preset: secrets, tokens, URLs and internal addresses — names and prose detectors off.
Mapping — 0 values (only visible in this tab)
| Placeholder | Real value | Uses |
|---|
Check a few rows before you paste — this is the fastest way to spot a detector that grabbed the wrong thing. Nothing here is stored or sent anywhere.
What to look for — 30 detectors, custom terms, exceptions
People & organisations
Government & health IDs
Financial
Technical & secrets
Location
Step 3 — paste the AI’s answer here to put the real values back
The model replies using the placeholders. Paste its answer below and every
[NAME_1] becomes the real name again — using the mapping held in this tab, which
is the only copy that exists.
How it works
- Open this page — the detectors are already set for “Remove API keys from code”.
- Paste your text, or drop a .txt, .md, .csv, .json or .log file onto the panel.
- Check the highlights: every match is coloured by type, and one click keeps a type as-is.
- Copy the safe version and paste it into the AI tool of your choice.
- Paste the model’s reply back into step 3 to restore the real values.
Why a key in a chat window is worse than a key in a repo
A committed secret is at least visible to your own tooling: secret scanners, pre-commit hooks and provider push-protection can find it, and you can rotate it. A secret pasted into a chatbot leaves your view entirely. It may sit in conversation history for years, it may be included in training data on a consumer plan, and there is no scanner that will tell you it happened.
The practical rule most engineering teams land on is simple: any credential that reaches a chat window is a rotated credential. Scrubbing before the paste keeps that rule cheap enough to actually follow.
What the detectors look for
Provider keys are matched on their documented prefixes and lengths — sk-ant-, AKIA…, ghp_…, xoxb-…, AIza…, glpat-… — which keeps false positives low even in minified code. Generic assignments are matched by the key name rather than the value, so password: "correct horse battery staple" is caught while a base64 blob in the middle of a diff is left alone.
JWTs are matched on their three-part structure. That matters more than it looks: the payload of a JWT is base64, not encrypted, so a token pasted into a chat often carries a user ID, an email address and an organisation ID in plain sight.
Internal addresses (10.x, 192.168.x, IPv6) and MAC addresses are on because they map your network, and they are cheap to replace with a token the model can still reason about.
Tips
- Rotate anything that has already been pasted. Scrubbing is prevention, not a fix for a leak that already happened.
- Turn URLs off if the model needs to see the endpoint shape; turn them on when the URLs are signed or carry tokens in the query string.
- Paste the failing request, not the whole file — smaller context usually gets a better answer as well as a safer one.
Detectors are pattern-based and imperfect: read the highlighted output before you paste it anywhere, and confirm your own confidentiality obligations against the current rules for your profession, employer or jurisdiction. Compiled 2026-07-29.
Frequently asked questions
Will it catch a key format you have never heard of?
Only if it looks like an assignment (SOMETHING_KEY = value), a bearer token or a PEM block. Bare high-entropy strings with no context are deliberately not matched, because in code that pattern is also hashes, IDs, base64 images and test fixtures. Add unusual formats to custom terms.
Does the tool phone home to check whether a key is live?
No — that would mean sending your key to a third party, which is the exact failure this page exists to prevent. Validation here is purely structural: prefixes, lengths, checksums for card numbers and IBANs.
Can I use this in a pre-commit hook?
Not directly; this is a browser tool. For repositories, use a dedicated secret scanner in CI. This page is for the other path secrets take out of a company: a human pasting a snippet into a chat window.