{"id": "review", "title": "Line-by-line review for one class", "prompt": "You are a smart-contract security reviewer. Review only the code below, for {CLASS} only.\nFor each finding give, in this order: function and line; why the existing checks do not stop it; the attacker's call sequence (authorized local-fork research only); Defense / Mitigation (the concrete code-level fix); Detection (a test, CI check, or production monitor); and your confidence (low/medium/high).\nDo not output an attack sequence without both a mitigation and a detection method in the same finding. If you find nothing, say \"no finding\", list what you checked, and list the defenses that already hold.\nDo not invent code that is not shown.\n\nCODE:\n{PASTE CONTRACT}", "requires_defense": true, "license": "CC-BY-4.0", "schema": "bsv.security.prompt/1.1"}
{"id": "invariants", "title": "Extract invariants and how to enforce them", "prompt": "Read the contracts below. List the invariants the protocol must keep, one sentence each, grouped as: solvency, accounting, access, liveness.\nThen, for each invariant, give: (1) a Solidity boolean expression over public state, usable in a Foundry invariant test; (2) Defense / Mitigation — whether the code already enforces it, and the check or revert to add if it does not; (3) Detection — an off-chain monitor or event that should fire if the invariant breaks in production.\nMark any invariant you are unsure the code intends. Do not list an invariant without mitigation and detection.\n\nCODE:\n{PASTE}", "requires_defense": true, "license": "CC-BY-4.0", "schema": "bsv.security.prompt/1.1"}
{"id": "entrypoints", "title": "Attack-surface map with existing and missing defenses", "prompt": "From the code below, produce a table: contract, function, visibility, modifiers, state written, external calls made, tokens moved, existing defenses (modifiers, checks, guards), missing defenses.\nThen list the 5 functions a reviewer would examine first and, for each, the Defense / Mitigation to add or confirm and the Detection (test or monitor) that shows the defense holds.\nFacts from the code only. Do not list a function as a target without the matching defense and detection.\n\nCODE:\n{PASTE}", "requires_defense": true, "license": "CC-BY-4.0", "schema": "bsv.security.prompt/1.1"}
{"id": "poc", "title": "Foundry PoC and fix tests on a local fork (authorized scope)", "prompt": "Write Foundry tests that reproduce AND close the issue below on a LOCAL fork only. Pair the attack-side test with Defense / Mitigation (test_fix) and Detection.\nUse vm.createSelectFork(vm.envString(\"RPC_URL\"), {BLOCK}); never broadcast. No hard-coded private keys. Use interfaces for the in-scope contracts at the addresses given.\n\nYou must produce all three, in one file:\n1. test_poc — set up with deal(); perform the call sequence; assert impact with assertGt/assertEq; log balances before and after. This test is for authorized local-fork research only and must never be broadcast.\n2. test_fix — apply the mitigation first (patched logic, guard, check, or oracle), replay the exact sequence, and assert there is no profit and the invariant holds.\n3. A Detection comment block — the invariant, event, or monitor that would fire if this bug returned, and a test or assertion that encodes it.\n\nDo not output test_poc without test_fix and the Detection block.\n\nISSUE: {DESCRIPTION}\nCONTRACTS AND ADDRESSES (in program scope): {LIST}", "requires_defense": true, "license": "CC-BY-4.0", "schema": "bsv.security.prompt/1.1"}
{"id": "report", "title": "Bug report in program format (fix and detection required)", "prompt": "Turn my notes into a bug report with these sections: Title (impact first), Impact (use the program's exact impact wording: {IMPACT}), Severity with justification, Root cause (file:line), Attack path (numbered calls; authorized local-fork research only), Proof of concept (the forge command and the relevant test output), Recommendation — Defense / Mitigation (minimal code-level fix), Detection (CI invariant, monitor, or on-chain check that would catch a repeat), References.\nDo not overstate impact. If a precondition is needed, state it.\nDo not write an attack path without both the mitigation and the detection sections.\n\nNOTES:\n{PASTE}", "requires_defense": true, "license": "CC-BY-4.0", "schema": "bsv.security.prompt/1.1"}
{"id": "diff", "title": "Upgrade / diff review with defense impact", "prompt": "Compare the old and new versions below. List every behavioural change, then for each: can it break an invariant, change storage layout, add an unprotected entry point, change rounding direction, or weaken an existing defense? Quote the lines.\nFor every change that adds risk, give Defense / Mitigation (what to change or add back) and Detection (a test or monitor). Do not list a risky change without both.\n\nOLD:\n{OLD}\nNEW:\n{NEW}", "requires_defense": true, "license": "CC-BY-4.0", "schema": "bsv.security.prompt/1.1"}
{"id": "triage", "title": "Static-analysis triage with mitigation", "prompt": "Below is Slither output and the code it refers to. For each finding say: true positive, false positive, or needs-a-test, with one sentence of reasoning from the code. Order true positives by impact.\nFor every true positive, add Defense / Mitigation (concrete fix) and Detection (test, CI rule, or monitor). Do not list a true positive as an attack lead without both.\n\nSLITHER:\n{PASTE}\nCODE:\n{PASTE}", "requires_defense": true, "license": "CC-BY-4.0", "schema": "bsv.security.prompt/1.1"}
