Security review of a diff

Looks for injection, authorization gaps, and secret leakage — and refuses to comment on anything else.

Coding securityreviewaudit Verified 2026-11-02

When to use it

A change touches authentication, user input, file paths, or SQL.

The prompt

Copy into your assistant
Review this diff for security defects only.

Look for:
- Injection: SQL, command, template, path traversal
- Authorization: missing checks, checks on the wrong object, client-supplied identity
- Secrets: credentials in code, logs, or error messages
- Data exposure: PII in responses, logs, or cache keys
- Deserialisation and file upload handling

For each finding: the vulnerable line, the attack input, the impact, and the fix.

Rules:
- Security only. No style, no performance, no architecture opinions.
- If you are unsure whether something is exploitable, say "needs human review" rather than guessing.
- If there are no findings, say so plainly.

Diff:
<diff>

What to change

Include the surrounding function when the diff is small — authorization bugs are usually visible only with the caller in view.

Why it works

Scoping to security prevents the model from padding with general advice, which is the usual failure mode of 'review this for security'.

More coding prompts

Going deeper

More prompts

All prompts