Code Review Prompt — the Review Contract
"Review this code" gets shallow comments. The review contract gets findings with severities, a checklist, and a verdict.
Find the path from user to admin — audit for vertical and horizontal escalation: mass-assignment of roles, unchecked elevation, and operations that trust client-supplied privilege.
Privilege escalation is when a normal user becomes more than they should be — by setting their own role in a form, hitting an admin route that forgot its check, or editing a record they horizontally shouldn't reach. This prompt audits for both vertical (user→admin) and horizontal (user→other user) escalation, focusing on the places privilege is assigned, changed, or assumed.
Gather where privilege is assigned
Collect the code where roles are set, elevation happens, and records are accessed. The audit looks for the path from user to admin and from user to other user.
Open this resource in Code Review Prompt Generator
Load the prompt into Code Review Prompt Generator and paste in the code. It audits for both vertical and horizontal escalation rather than a generic pass.
Review the escalation findings
Read each finding - mass-assignment of a role, an admin route missing its check, an operation trusting client-supplied privilege - by severity.
Fix the paths and re-audit
Close each escalation path the audit names, then re-run it to confirm a normal user cannot become more than they should be.
It splits the audit into distinct numbered checks. Only HORIZONTAL is named for the same-level case (a user acting on another user resources, the IDOR-flavored escalation), while MASS ASSIGNMENT, ELEVATION ENDPOINTS, UNCHECKED ADMIN PATHS and TRUST OF CLIENT DATA cover the user-to-admin direction. Each finding traces the path from what, to what, via what, returning findings only.
This one hunts only escalation paths, so its notFor points you to the Authorization Review Prompt for general broken-access-control and the RBAC Design Prompt for designing the role model. It focuses on where privilege is assigned or assumed, forcing self-service role assignment and unchecked admin paths to CRITICAL rather than doing a broad access pass.
Paste the user/role models, the endpoints that assign or change privilege, and the sensitive operations named in the INPUT block. INDIRECT PATHS only surfaces when the audit can see the full sequence, since its example (invite-self-as-admin) is where each step is allowed but the chain yields elevation. Missing endpoints leave that path invisible.
It does not. Loading this into Code Review Prompt Generator outputs a review prompt you run in your own assistant; the findings-only, from-what/to-what/via-what report is a recommendation, not proof. Workflow step 4 has you fix each named path and re-audit, and you own confirming a normal user cannot become more than intended before 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.