1---2name: adversarial-review3description: Use when reviewing a PR, patch, or design. Attack the change as a skeptic: enumerate failure modes, missing tests, unsafe defaults, and privilege edges before approving or merging.4---56# Adversarial Review78## When to use910- Reviewing a pull request, patch diff, or proposed design.11- The user asks for a "critical review", "threat model pass", or "what could go wrong".12- Before merging high-risk changes (auth, payments, data deletion, public APIs).1314## When not to use1516- Rubber-stamping typo/docs-only PRs where risk is negligible.17- Pairing sessions where the goal is collaborative drafting, not gatekeeping (switch to review mode when ready).18- Replacing formal security audit/penetration test engagements.1920## Assumptions2122- Access to the full diff, linked issue, and ability to run or reason about tests.23- Product/security context may be incomplete — call out assumptions explicitly.24- Do **not** merge, push to protected branches, or dismiss required reviews without authorization.25- Do **not** exfiltrate secrets found in the diff; follow secrets-hygiene instead.2627## Workflow28291. Restate the change's purpose and trust boundaries in your own words.302. Hunt for failure modes: nulls, races, authz gaps, injection, unsafe defaults, partial failure.313. Check tests for gaps relative to those failure modes.324. File concrete, severity-tagged findings (blocker / should-fix / nit).335. Approve only when blockers are addressed or explicitly accepted by the owner.3435## Steps36371. **Intent check** — Does the diff match the claimed purpose? Flag unrelated churn.382. **Abuse cases** — For each new input/surface: unauthenticated access, confused deputy, oversized payloads, replay, TOCTOU, and error-path leaks.393. **Defaults & footguns** — Fail-open vs fail-closed; permissive CORS; debug flags; default passwords; broad IAM.404. **Data & teardown** — Migrations, deletes, and retries: idempotency, backup/rollback, PII exposure in logs.415. **Test gaps** — Map each serious risk to a missing test; demand or add coverage for blockers.426. **Report** — Structured findings with file/line references and a clear merge recommendation.4344## Success criteria4546- [ ] Review names specific failure modes, not only style nits.47- [ ] Missing tests for high-severity risks are called out.48- [ ] Unsafe defaults and authz edges are explicitly assessed.49- [ ] Findings are prioritized (blocker vs non-blocking).50- [ ] No unauthorized merge or secret leakage occurred during review.5152## Out of scope5354- Full formal threat modeling workshops for an entire product.55- Legal/compliance sign-off.56- Rewriting the feature for the author unless asked.