redline
HighSecurityhardcoded-secret

Secret in source

Secret in source. Looks like a real credential in source.

This is how the comment reads inline, under the flagged line.

Why it matters

Anything committed is copied to every clone, fork and CI log, and stays in history after you delete it.

What to do

Revoke it now, then load it from a secret store or the environment.

Examples

Flagged
const apiKey = "sk-live-4f9a…";
Better
const apiKey = config.apiKey;

What it catches

It reads a pattern on each line, aware of strings and comments. Languages: Any file. Scope: All files. These cases are the rule's own tests: the first set must be flagged and the second must not.

Flagged

const k = "AKIAABCDEFGHIJKLMNOP";
password = "hunter2hunter2"

Left alone

const k = process.env.KEY;
password = "changeme-example"

Research

Credentials in source, and secrets read with a fallback default. A committed secret stays exposed, even after it is deleted.

Turn it off or change it

In a config file for the CLI, or in the API's rules field:

{
  "rules": {
    "disable": [
      "hardcoded-secret"
    ],
    "severity": {
      "hardcoded-secret": "low"
    }
  }
}

Read the source or report a false positive.