Security-Focused Review
A security review of a diff checking for injection, authorization, secrets and unsafe deserialization.
Advanced · Works with ChatGPT, Claude, Gemini, Copilot
The prompt
Review this diff specifically for injection, authorization gaps, exposed secrets and unsafe deserialization.
For each issue, give the concrete rewrite rather than just describing the problem, and separate what must change from what's a hardening suggestion.
Diff or code to review:
{{CODE}}
Language, framework and trust boundaries:
{{STACK}}Why this prompt works
Naming specific vulnerability classes up front keeps the review from drifting into style comments instead of actual security issues.
How to customize it
- State the trust boundary clearly — the same code is fine or dangerous depending on who can reach it.
- Treat 'must change' items as blocking regardless of deadline pressure.
Common mistakes
- Running this on code with no external input, wasting the specific focus.
- Accepting a described fix without the concrete rewrite and re-checking it.
Example
Input
Diff to review: New endpoint that deserializes uploaded JSON config files
What a good answer looks like
A findings list, each with severity, the concrete fix, and whether it's blocking.
Make this prompt fit your work
ModelCoach.ai scores your version, shows what to improve and explains why, right inside ChatGPT, Claude, Gemini and Copilot.