S6Safetyscope: coreweight: 3fix: manual
S6: No hardcoded secrets
Why this rule exists (Empirical Evidence)
Hardcoded API keys, tokens, and private keys in source code are the most common credential leak vector. AI agents may copy-paste patterns with embedded secrets.
Multi-Project Dev Discipline Audit (2026)
Anti-pattern (Triggers S6)
const OPENAI_KEY = 'sk-proj-xxxxxxxxxxxx'; // Hardcoded secret in repo!
Compliant pattern (Passes S6)
const OPENAI_KEY = process.env.OPENAI_API_KEY; // Loaded from env
Verify locally or online
npm install -g agentlint-ai && agentlint check --check S6