LOCALDEVTOOLBOX / PROBLEM / PASSWORD-IN-CODE

There's a password in my code — remove it before sharing

Pasting a snippet for help usually drags its secrets along: const API_KEY = "…", a .env line, a connection string. Find every occurrence and redact — locally.

Findings0
Lines0
Waiting for code…

I already shared code with a password — what now?

  1. Rotate the secret immediately — treat it as compromised the moment it left your editor.
  2. Purge history if it was committed — deleting the file is not enough; scrub git history (git filter-repo) or rotate and move on.
  3. Check access logs — was the key used between the leak and the rotation?
  4. Prevent the next one — a pre-commit secret scanner (gitleaks, trufflehog) catches these before they exist.

The env-var habit

Replace the literal with an environment reference and load it at runtime (process.env.API_KEY, os.environ, your framework's config). The code stays shareable; the secret stays private.

Is my code uploaded anywhere?

No. This page is a single static HTML file — scanning and redaction run entirely in your browser. Disconnect from the internet after it loads.

Need the full toolbox?

This page is one tool from LocalDevToolbox — 15+ local developer tools: context optimizer, log doctor, JSON sanitizer, stack trace analyzer and more.