Claude Code

Verified against Claude Code · 2026-07-28

Run Claude Code's structured security review discipline before every merge

A closed-taxonomy security review prompt that separates flagging a finding from fixing it, mirroring the mechanics of Claude Code's built-in security review command, so a vulnerability finding produces a human decision rather than a silent autonomous patch.

Claude Code4 fillable variables

The prompt

Ready to copy — highlighted parts are example details you can swap.

You are performing a security review, mirroring the discipline behind Claude Code's own security-review command — find what an attacker would actually try, not confirm that the intended feature works as described. Flag findings. Do not silently fix anything in this pass, even a one-line fix that feels obviously safe to make.

SCOPE
The new /api/users/[id]/export route and the auth middleware wrapping it, added in this pull request.

THREAT CONTEXT
This endpoint returns a full data export, so an authorization bypass here is a data-breach-severity issue, not just an inconvenience.

SENSITIVE DATA IN SCOPE
The export includes email, billing address, and the last four digits of a stored card.

DEPLOYMENT CONTEXT
Ships directly to production behind the standard auth middleware, with no additional WAF rule in front of it.

REVIEW CATEGORIES — GO THROUGH EVERY ONE, DO NOT SKIP SILENTLY
1. Injection — SQL, NoSQL, command, template, or log injection anywhere user-controlled input reaches a query, a shell call, a template renderer, or a log line that is later parsed.
2. Authentication and authorization — missing auth checks, broken object-level authorization such as one user accessing another user's resource by changing an identifier in a request, or any privilege-escalation path.
3. Secrets and sensitive data — API keys, tokens, credentials, or personal data hardcoded, logged, committed in a fixture, or returned in an API response that does not need to include it.
4. Input validation and deserialization — unbounded input size, unvalidated file uploads, unsafe deserialization of anything user-controlled.
5. Server-side request forgery and outbound calls — does any user-controlled input influence a URL, hostname, or file path fetched or opened server-side?
6. Dependency and supply-chain risk — any new or changed dependency with a known-bad reputation, an unpinned version, or a maintainer change worth a second look.
7. Output handling — unescaped output enabling cross-site scripting, unsafe raw HTML rendering, or an unvalidated redirect target.

OUTPUT FORMAT
For each category: either CLEAR, or FINDING with a severity of Low, Medium, High, or Critical, the exact file and line, a concrete exploit scenario stating the specific input or request that triggers it rather than a vague 'this could be unsafe', and a suggested fix presented as a recommendation for a human to apply, not applied automatically in this pass.

CONSTRAINTS
- Do not report a theoretical concern as a finding unless a concrete triggering input can be stated. A pattern that merely looks unusual is not automatically a vulnerability.
- Do not downgrade a real finding into a soft best-practice suggestion to make the review read cleaner. Severity reflects actual exploitability, not how the finding will be received.
- If nothing in a category applies, say CLEAR explicitly rather than omitting the category from the output — an omitted category and a checked-clear category look identical to a reader unless the omission is visible.
- Rank findings by severity in a final summary, and state which single finding, if only one could be fixed before merge, would matter most and why.

This is a review, not a remediation pass — do not modify any code. Paste the diff or files to review below this line.

Customize

Optional — swap in your own details for the highlighted parts above.

Why this works

A generic 'is this secure' prompt reliably produces a generic 'nothing obviously wrong' answer, because without named categories the model has no forcing function to check for any specific class of vulnerability it did not happen to notice first. Closed, named categories such as injection, authorization, secrets, and server-side request forgery mirror how Claude Code's own built-in security review scans systematically rather than impressionistically, and requiring an explicit CLEAR per category rather than allowing silence makes an accidentally skipped category visible instead of invisible — a reviewer reading the output can tell the difference between 'checked, found nothing' and 'never actually checked', which a freeform review cannot offer. Requiring a concrete exploit scenario per finding, rather than a hedge like 'this could potentially be unsafe', filters out the low-value speculative findings that make AI security review output hard to trust and act on, since a finding with no stateable triggering input is not yet a finding, it is a hunch dressed as one. Weighting severity against the sensitive-data and deployment-context variables rather than judging exploitability in the abstract matters because the same authorization gap is a Low finding on a page that reveals nothing and a Critical one on a page that reveals a stored card fragment, and a review that never asks what is actually being protected will rate both the same way by default. The explicit instruction to flag rather than fix is a control on the agent's own autonomy specifically because Claude Code has real Edit and Bash access in the same session: an agentic coding assistant that both finds and silently patches a security issue removes a human decision point — what to fix, how, and when to ship it — from a class of change that should not be unilateral even when the assistant is correct about the underlying vulnerability, because the fix itself can carry its own risk, such as an overly broad input filter that breaks a legitimate use case nobody asked the model to weigh.

Verified against

Claude Code Sonnet 4.6 · 2026-07-28

Changelog

  • 2026-07-28 — Initial publish, verified against Claude Code security review (Sonnet 4.6).

Building this for real?

This is a free starting point. If you'd rather have custom software built and running for your business, that's Scult's day job.

EXPLORE CUSTOM SOFTWARE
All Claude Code prompts

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY