A JWTKit HMAC signing key is registered from a hard-coded string literal (add(hmac: "...", ...)).
Why AI tools produce this: AI coding tools produce this regularly, typically when prompted for a shortcut or a quick fix.
Why this matters
HMACKey is ExpressibleByStringLiteral, so the literal becomes the key that signs and verifies every token: committed to source control it is one search away from compromise, letting an attacker forge a token for any user or role (CWE-798). AI-generated Vapor/JWTKit samples inline the secret to make the snippet "just work".
Read the key from the environment or a secret store instead, e.g. add(hmac: HMACKey(from: Environment.get("JWT_KEY")!), digestAlgorithm: .sha256), and rotate the leaked secret out of source control.
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.swift.jwt.hardcoded-hmac-key -- <reason>