{"record":{"id":"69ae17172a6f2fbe","repo":"affaan-m/ECC","slug":"openai-api-key-not-configured","errorCode":null,"errorMessage":"OPENAI_API_KEY not configured","messagePattern":"OPENAI_API_KEY not configured","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"skills/security-review/SKILL.md","lineNumber":39,"sourceCode":"\n## Security Checklist\n\n### 1. Secrets Management\n\n#### FAIL: NEVER Do This\n```typescript\nconst apiKey = \"sk-proj-xxxxx\"  // Hardcoded secret\nconst dbPassword = \"password123\" // In source code\n```\n\n#### PASS: ALWAYS Do This\n```typescript\nconst apiKey = process.env.OPENAI_API_KEY\nconst dbUrl = process.env.DATABASE_URL\n\n// Verify secrets exist\nif (!apiKey) {\n  throw new Error('OPENAI_API_KEY not configured')\n}\n```\n\n#### Verification Steps\n- [ ] No hardcoded API keys, tokens, or passwords\n- [ ] All secrets in environment variables\n- [ ] `.env.local` in .gitignore\n- [ ] No secrets in git history\n- [ ] Production secrets in hosting platform (Vercel, Railway)\n\n### 2. Input Validation\n\n#### Always Validate User Input\n```typescript\nimport { z } from 'zod'\n\n// Define validation schema\nconst CreateUserSchema = z.object({","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/affaan-m/ECC/blob/d8409a4b0813771235555e32e3d8046a73988bfa/skills/security-review/SKILL.md#L21-L57","documentation":"Illustrative snippet from the security-review skill: after reading process.env.OPENAI_API_KEY, the code throws this sentinel when the variable is absent. It marks a missing-configuration error at startup — no secret was configured, so dependent API calls cannot be made.","triggerScenarios":"Thrown at skills/security-review/SKILL.md:39 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the variable in the environment or hosting platform's secret manager","Fail fast at startup with a list of all missing required secrets","Add the key to .env.local locally and keep it out of git"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d8409a4b0813771235555e32e3d8046a73988bfa","analyzedAt":"2026-08-26T12:15:34.022Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}