How to use the Secret redactor tool
- Paste the log excerpt, .env file, curl command or config into the Text or configuration box.
- Select Redact to mask every match, or select Example to see two sample lines processed.
- Read the Result box. Each detected secret is replaced by the marker [REDACTED] and the surrounding text is kept.
- Scan the result yourself for secrets the patterns do not cover, such as private keys or passwords inside URLs.
- Select Copy and share the redacted version in place of the original.
What the secret redactor looks for
The tool applies three regular-expression passes to the text. Nothing else is inspected, so it helps to know exactly what they match.
For assignments, the value may be double-quoted, single-quoted or bare. A bare value ends at the first space, comma, semicolon or hash sign. Prefixes are fine, so DB_PASSWORD=, client_secret: and x-api-key: all match.
- Authorization headers. The value after Authorization: Bearer or Authorization: Basic is masked, in any letter case.
- Keys that start with sk- or sk-proj- followed by at least 12 letters, digits, hyphens or underscores, a format used by several AI API providers.
- GitHub tokens that start with ghp_, gho_ or github_pat_ followed by at least 12 letters, digits or underscores.
- AWS access key IDs: AKIA followed by exactly 16 uppercase letters or digits.
- Assignments whose name ends in api key, api_key, api-key, apikey, password, secret or token, followed by a colon or an equals sign.
Example: redacting a shell and config snippet
Four of the five lines below contain a pattern the tool knows. The last line shows a miss: in SECRET_KEY the word KEY sits between SECRET and the equals sign, so the assignment rule does not apply.
Input:
curl -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.e30.abc' https://api.example.com
export GITHUB_TOKEN=ghp_R4nd0mExampleValue1234
db_password: "correct horse"
aws_access_key_id = AKIAIOSFODNN7EXAMPLE
SECRET_KEY=not-masked
Result:
curl -H 'Authorization: Bearer [REDACTED]' https://api.example.com
export GITHUB_TOKEN=[REDACTED]
db_password: [REDACTED]
aws_access_key_id = [REDACTED]
SECRET_KEY=not-maskedSecrets this tool does not catch
Pattern matching cannot recognize every credential. Check the output for these before you share it.
- Names where the keyword is not last, such as SECRET_KEY or AWS_SECRET_ACCESS_KEY, and short names like pass or pwd.
- Private key blocks in PEM format, and standalone JWTs that are not in an Authorization header.
- Passwords embedded in connection strings, for example postgres://user:pass@host/db.
- Authorization headers written as a quoted JSON key, and schemes other than Bearer and Basic.
- Tokens from providers with other prefixes, and bare values that contain spaces. Only the first word of an unquoted value is masked.
Side effects to expect in the output
A quoted value is replaced together with its quotes, so "password": "abc" becomes "password": [REDACTED]. JSON treated this way is no longer valid JSON, which is fine for a ticket and wrong for a file you plan to load again.
The marker is the same for every secret and the original length is not kept. You cannot tell two different tokens apart afterward. If a keyword ends a line with a colon and nothing after it, the first word on the following line is masked, which can happen with nested YAML.
Frequently asked questions
Is the text I paste sent to a server for scanning?
No. The three patterns run as JavaScript string replacements inside the page. The original text, secrets included, stays in your browser tab and is not logged or transmitted.
Can I rely on this to remove every secret?
No. It masks common, recognizable formats only. Private keys, connection-string passwords, unusual variable names and provider-specific tokens can pass through untouched. Read the result before you post it.
Should I rotate a key after redacting it?
Redaction only protects the copy you are about to share. If the original text already reached a chat, a repository or a log system, the key is exposed and should be revoked and reissued.
Why should I redact secrets before pasting text into an AI assistant?
Prompts may be stored or reviewed in ways you do not control, and a pasted stack trace or .env file often includes live credentials. Masking them first keeps the debugging context while removing the part an attacker could use.
Does it detect JWTs?
Only when the JWT follows Authorization: Bearer, or is assigned to a name ending in token, secret, password or api key. A bare JWT elsewhere is left as is.