Secrets in config files
You asked an AI agent to 'set up the project so the app can call the payments API.' It created the config and wired everything up, and the app talks to the API successfully. Before you commit and push, what specific files and lines do you need to inspect, and what's the habit that catches the most common mistake here?
Implement
scan_staged_secrets(paths: list[str], lines: list[str]) → list[str]Examples
in
[["src/config/payments.ts","src/config/payments.ts"],["const PAYMENTS_API_KEY = \"sk_live_4eC39HqLyjWDarjt\";","export const BASE_URL = \"https://api.pay.example\";"]]out["src/config/payments.ts: hardcoded secret"]in
[[".env.local","app/api/pay/route.ts"],["STRIPE_SECRET_KEY=sk_live_51HxyzABC","const key = process.env.STRIPE_SECRET_KEY;"]]out[".env.local: env file staged"]in
[["components/Dashboard.tsx"],["const key = process.env.STRIPE_SECRET_KEY;"]]out["components/Dashboard.tsx: server secret in client code"]What a strong answer looks like
Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.
0:00 of about 10 min
Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.
Run or narrate your approach, then ask the coach.