Teach secure code review by giving reviewers a short, risk based checklist, pairing them with an experienced reviewer on real changes, and replaying past bugs from your own codebase. Focus on where trust changes: input, authorization, data stores, secrets and dependencies. Do not ask for a line by line audit.
Why reviews miss security flaws
A normal review asks whether the change works and reads cleanly. Security needs a different question: what if the caller is hostile? Reviewers who were never taught to ask it will approve a tidy change that skips an ownership check.
Reviews also fail when they are too long. A reviewer faced with a large diff skims. Small, focused changes are easier to review for security, so training should include how to ask an author to split work.
Step 1: agree what to look for
Give reviewers one page. A sample focus table:
| Where trust changes | Question to ask |
|---|---|
| Input arrives | Is it validated, and used safely in queries, commands and output? |
| A resource is requested | Does the code check that this caller may access this item? |
| Secrets appear | Is anything sensitive written into code, logs or errors? |
| New dependency | Is it needed, maintained and pinned? |
| Data is stored or sent | Is it protected, and should it be kept at all? |
| Errors are returned | Do they reveal internals? |
The OWASP Code Review Guide is an open resource under a Creative Commons licence if you want a deeper reference, and the OWASP Cheat Sheet Series offers concise guidance on specific topics for the details behind each row.
Step 2: pair on real changes
Have a newer reviewer shadow a trained one on three or four real pull requests. The trained reviewer talks through what they check and why. Then swap: the newer reviewer leads, and the trainer watches. Pairing transfers the instinct, which a checklist alone cannot.
Step 3: replay past bugs
Pick two or three security fixes from your own history. Show the original change before the fix, and ask the group whether they would have approved it. This is humbling and effective. It also builds the habit of treating a fix as a lesson.
Step 4: make small changes the norm
Teach authors to describe in the pull request what the change touches security wise, such as new input, new permission or new package. A good description halves the reviewer's effort.
Step 5: measure carefully
| Signal | Why it helps |
|---|---|
| Security issues caught in review vs found later | Shows review quality |
| Reviewers who can name the checklist items unprompted | Shows recall |
| Share of pull requests with a security note | Shows author habit |
Do not rank reviewers by issues found. That rewards nitpicking and discourages quiet reviewers from joining.
Try it yourself
Click through it at your own pace, or open it full screen.
See how an automated gate gives feedback on a change. Use it to talk about which checks a human should still own.
Where Safeguard fits
Automated checks should take the repetitive part so people can focus on judgement. Safeguard offers SAST code scanning, dependency scanning and pull request gates through policies. It does not offer training courses. Try a free scan at gold.safeguard.sh/scan.
Quick check
Do automated scanners replace secure code review?
No. They catch known patterns. Humans catch missing checks and logic errors, which scanners often cannot see.
How long should a security focused review take?
Plan for a few extra minutes on changes that touch trust boundaries. Ask for smaller changes rather than spending hours on one large one.
Sources
- OWASP Code Review Guide project page: owasp.org/www-project-code-review-guide
- OWASP Cheat Sheet Series: cheatsheetseries.owasp.org
Last reviewed: 19 October 2026.