Threat Model a Change
FreeWalk a change for spoofing, tampering, and data exposure before it ships.
Purpose
A premium security pass that stays specific to this diff.
Procedure
--- name: threat-model description: Walk a change for spoofing, tampering, and data exposure before it ships. ---
Threat Model a Change
Purpose
A premium security pass that stays specific to this diff.
Procedure
Stay on the change in front of you. Do not produce a generic OWASP essay.
For each asset the change touches (a personal row, a payment, a hidden procedure, an admin action), answer:
- Who is allowed to read it, and who is allowed to change it?
- What can a signed-out caller do by hitting the endpoint directly?
- What can a signed-in caller do to someone else's id?
- What happens if the price, the plan, or the "paid" flag in the request is edited?
- What is stored, and does that storage include a secret or a full card number? It must not.
- What is logged?
Write one row per abuse: attacker, action, current result, and whether that result is acceptable. "Acceptable" means the server denies it or only creates a pending record that does not grant the entitlement.
Must-fix anything that grants money, access, or private text on client say-so.
Do not recommend a new vendor, a pen test, or a compliance certification. Do not exploit anything against a system you do not own; this skill reviews the code you were given.
If the secret or provider is not configured, the safe behavior is failure, and you should check that failure is what the code does.
Example requests
1. Model checkout
Request: Threat-model the checkout flow. Assume the buyer can edit any request. Expected: A table of abuse cases and whether the code stops them.
Dependencies
None. Work in the repository that is already open. Do not add packages unless the procedure names one.
Compatibility
This document follows the Agent Skills layout (a folder named threat-model containing SKILL.md). Claude Code, Cursor, Codex, and Gemini CLI can load that file from the paths in the Skilling installation guide. GitHub Copilot does not load SKILL.md. Use the Copilot instructions copy, and narrow applyTo before you commit it.
Example prompts
Model checkout
Threat-model the checkout flow. Assume the buyer can edit any request.
Expected: A table of abuse cases and whether the code stops them.
Choose the agent
This skill is installed for one agent at a time. Pick the section you are using.
Related
- Session Review
Check that a feature uses the server session and never a user id sent from the browser.
- Webhook Verification
Accept a payment or provider webhook only after the signature is checked on the server.
- PR Review
Review a change for correctness, security, and scope. Lead with findings, not a summary of the diff.
Reviews
No reviews yet.
Sign in to review.
Report a problem
Inaccurate steps, an unsafe instruction, or a licensing concern.
Sign in to report.