Security checklist for AI code
You've been moving fast with an AI agent and just generated a backend feature spanning a new endpoint, a DB query, some config, and a couple of added dependencies. Rather than reviewing every line, describe the short security pass you run over AI-generated code before committing — what specific things you look for and why each one matters for AI output in particular.
Implement
scan_ai_diff_for_risks(diff_lines: list[str]) → list[str]Examples
in
[["+const API_KEY = sk_live_4eC39HqLyjWDarjt;"]]out["secrets"]in
[["+ const rows = await db.query(SELECT * FROM users WHERE name = + name);"]]out["injection"]in
[["-const API_KEY = sk_live_4eC39HqLyjWDarjt;"," const port = 3000;","+ res.json(ok);"]]out[]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 11 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.