Code Review Prompt — the Review Contract
"Review this code" gets shallow comments. The review contract gets findings with severities, a checklist, and a verdict.
Hunt the broken-access-control bug — review code for missing per-resource checks, IDOR, and 'logged in' mistaken for 'allowed', the vulnerability class that tops the OWASP list.
Broken access control is the most common serious web vulnerability, and a generic review skims past it because the code looks fine — it authenticates, it just doesn't authorize. This prompt reviews specifically for authorization: is every object access checked against the caller's permissions, not just their login? Can a user reach another user's record by changing an ID? It finds the per-resource check that isn't there.
Gather the code and its access rules
Collect the endpoints or handlers that touch protected resources and note who is supposed to be allowed to do what. The review checks authorization, not just login.
Open this resource in Code Review Prompt Generator
Load the prompt into Code Review Prompt Generator and paste in the code. It reviews specifically for missing per-resource checks and IDOR rather than skimming past them.
Review the access-control findings
Read each finding - an object access not checked against the caller, an ID a user could change to reach another record - ranked by risk.
Close the gaps and re-review
Add the missing per-resource checks the review flags, then re-run it to confirm no broken-access path remains.
Its ROLE line scopes the review to broken access control only — not general security, just authorization — so it hunts the six flaws under REVIEW FOR AUTHORIZATION FLAWS (per-resource checks, IDOR, authenticated vs authorized, missing checks, client-side trust, scope leaks) rather than skimming XSS, injection, and secrets. For broad coverage, notFor points to the Security Code Review Prompt.
The SEVERITY section tells the model to tag every finding [CRITICAL]/[MAJOR]/[MINOR], and it hard-codes one rule: missing object-level authorization and IDOR are CRITICAL. The OUTPUT then groups findings by severity, each citing the exact location and the access it wrongly allows — and stops there, since it says Findings only, do not rewrite the code.
Treat it as a focused review pass, not an audit substitute. code-review-prompt-generator outputs a prompt you run in your own assistant; the findings are that model's read of the six checks against your pasted routes, controllers, data-access, and auth middleware — recommendations to verify, not a guarantee it caught every broken-access path. You own confirming fixes and shipping.
"Review this code" gets shallow comments. The review contract gets findings with severities, a checklist, and a verdict.
Twelve security checks — injection, auth, secrets, SSRF, privilege escalation — reviewed the way an attacker would read the code.
Architecture review for the public surface: abstractions that earn their place, dependency direction, seams, and the patterns the codebase already has.
"Refactor this code" invites silent behavior changes. The refactoring contract preserves business rules, outputs, and side effects — and flags uncertainty instead of deciding it.
getByRole over CSS chains, auto-wait over sleep, web-first assertions — Playwright tests written the way Playwright wants.
A side-by-side way to decide between two ChatGPT prompt drafts — scored on clarity, specificity, output control, and risk instead of gut feeling.
Generate code review prompts for any scope — snippet, file, diff, or full pull request — with focused review rules.
Design access control before you build it, not after a breach — choose the authentication approach, model the roles and permissions, review the design for gaps, then document the identity model.
Both of them logged in successfully. One of them is looking at a ticket from another company's workspace. Here's how to turn your real actors, resources and actions into a reviewable RBAC model and a permission matrix where every cell says allow, deny, or on what condition.