A Rails secret_key_base / secret_key is assigned a hard-coded string literal.
Why AI tools produce this: AI coding tools produce this regularly, typically when prompted for a shortcut or a quick fix.
Why this matters
This value keys the whole application's signed/encrypted cookies (including the session cookie) and message verifiers: committed to source control it is one search away from letting an attacker forge session cookies and impersonate any user (CWE-798). Inlining a literal secret to make an app "just run" is a classic LLM-generated mistake.
Never assign the secret in code. Store it in Rails.application.credentials (encrypted) or read it from the environment, e.g. ENV.fetch("SECRET_KEY_BASE"), and rotate the leaked value out of source control and git history.
Suppressing this rule
If a finding is a genuine false positive, scope the suppression to the exact line and leave a reason, never disable the rule project-wide. Disable directives are line-scoped by design.
// oauthlint-disable-next-line auth.ruby.secret.hardcoded-secret-key-base -- <reason>