Code Secret Scanner

Scan code files for hardcoded secrets before sharing with AI

Ad placeholder (leaderboard)

Code secret scanner

Before you paste code into ChatGPT, Claude, Copilot Chat, or any other external assistant, it pays to check that you are not handing over live credentials. The code secret scanner matches your snippet against a library of patterns for API keys, private keys, passwords, tokens, and connection strings, and flags anything that looks sensitive — all without your code ever leaving the browser.

How it works

The scanner runs a set of regular expressions over each line of the text you paste. Some patterns are precise (an AWS access key ID, an OpenAI sk- key, a PEM private-key header); others are heuristic (a long high-entropy string, or an assignment to a variable whose name contains secret, password, token, or api_key). Every match is reported with the line number, the matched fragment, and a severity so you can quickly decide what to redact. Because everything is local JavaScript, scanning a file full of real secrets here is safe.

Tips and notes

  • Redact, do not just delete. Replace a secret with a placeholder like <REDACTED> so the AI still understands the code structure.
  • Rotate anything that already leaked. If a key was pasted somewhere untrusted, the only safe fix is to revoke and reissue it.
  • A clean scan is not a guarantee. Custom or obfuscated secrets can slip past pattern matching — review the code yourself too.
  • Prefer environment variables. The cleanest fix is to never hardcode the secret in the first place; reference it from the environment instead.
Ad placeholder (rectangle)