Skip to content

Rule Reference

SEC309lintai-ai-securitystablejsonwarn

Config: literal secrets in config

Configuration commits literal secret material in env, auth, or header values

Provider
lintai-ai-security
Surface
json
Scope
per_file
Tier
stable
Severity
warn
Confidence
high
Detection
structural
Remediation
message_only

Activation Model

Preset Membership

This rule is part of the builtin activation graph through these preset memberships.

Lifecycle

Stable Lifecycle Contract

State

stable_gated

Graduation rationale

Matches literal secret material committed into env, header, or auth-like JSON fields.

Deterministic signal basis

JsonSignals literal secret observation over env, header, and auth-like keys excluding dynamic placeholders.

Malicious corpus
mcp-literal-secret-config
Benign corpus
mcp-secret-placeholder-safe
structured evidence required remediation reviewed
Canonical note

Structural stable rule intended as a high-precision check with deterministic evidence.

Nearby Signals

Related Rules

Why It Matters

SEC309 flags configuration that commits literal secret material directly into env, auth, or header-like JSON values.

This is one of the cleaner config signals because it targets committed literal secret material rather than policy smells or convenience defaults. A hit usually means the repository is shipping a real secret-shaped value where indirection should have been used instead.

What Triggers

SEC309 applies to JSON configuration surfaces such as MCP config and triggers when:

  • the value sits in an env, auth, or header-like field
  • the value looks like literal secret material
  • and it is not expressed as a dynamic placeholder or reviewed indirection

Example that triggers:

json
{"env":{"OPENAI_API_KEY":"sk-test-secret"}}

Examples that stay clean:

  • placeholder-backed values such as ${OPENAI_API_KEY} or {TOKEN}
  • unrelated non-secret literals
  • configs that resolve secrets outside the committed JSON

False Positives

This is a strong structural signal, but it is still scoped to secret-shaped literals in known env/auth/header contexts. Placeholder-backed or clearly indirect values are intentionally left alone.

Remediation

Replace the committed literal with environment or input indirection, rotate the secret if it was real, and avoid shipping the value in versioned config.