A 10-minute pre-merge security check you can hand to your AI coding agent A developer published a 10-minute pre-merge security checklist that scans a git diff for leaked credentials, injection patterns, missing authorization checks, CI/Docker misconfigurations and untested functions, then packaged it as a SKILL.md file so coding agents like Claude Code, Codex CLI and Cursor can run it automatically. The writeup stresses two guardrails for the agent version: requiring it to confirm or discard each grep hit before reporting a vulnerability, and forbidding it from printing full secrets into the chat log. The checklist returns a BLOCK, FIX or SHIP verdict with a ranked fix list. Most leaked keys and injection bugs that reach main were not hard to find. Nobody looked. The reviewer read the logic, the tests passed, and the .env value pasted into a config file went out with the rest. Here is a check to run on every diff before it merges. It takes about ten minutes by hand. Further down, I show how to make an AI coding agent run it for you. Reviewing the whole repo is how checks get skipped. Start from the diff: git diff -U0 origin/main...HEAD -U0 drops context lines, so every + line is new code. That is the code you are responsible for. Search the added lines for anything that looks like a credential: git diff -U0 origin/main...HEAD | grep -E '^\+' | \ grep -Ei " api - ?key|secret|token|passw or ?d \s := \s '\" A-Za-z0-9 /+=- {12,} '\" |AKIA 0-9A-Z {16}|BEGIN RSA |EC |OPENSSH ?PRIVATE KEY" If a real secret shows up, deleting it in the next commit is not enough. It is in the history. Rotate it. Three patterns cover most injection bugs in Python web code: | Pattern | Example | Fix | |---|---|---| | SQL built from strings | f"SELECT FROM users WHERE id = {uid}" | Parameterized query: cur.execute "... WHERE id = %s", uid, | | Shell with user input | subprocess.run cmd, shell=True | Pass a list, drop shell=True | | Unsafe deserialization | pickle.loads body , yaml.load f | json.loads , yaml.safe load | A grep finds candidates. It does not find bugs. For each hit, trace where the input comes from. A query built from a constant is fine. A query built from request.args is not. Grep cannot do this one. For every new route or handler in the diff, answer two questions: The second one is the one that gets missed. GET /invoices/