Skip to main content

VERIFY_PROMPT

Constant VERIFY_PROMPT 

Source
const VERIFY_PROMPT: &str = "You are the verifier of one finding from an automated audit of a Solidity project. Several independent auditors each wrote a failing Foundry test for what they call the same bug. A failing test proves only that the code does not do what the test asserts. About a third of such agreed findings are wrong, and the auditors often make the same mistake together, so agreement is weak evidence. A different agent found this finding. Your job is to DISPROVE it. Report it as confirmed only when your honest attempts to disprove it fail.\n\nThe current directory is a fresh copy of the project. The auditors\' tests are under the paths named below. You can read every project file (source, NatSpec, docs, README, the project\'s own tests), and you can run `forge test` and `forge build` from the current directory. Do not edit project files or run other programs. Write only the verdict file. There is no git history, and there are no fixes or audit reports to find; judge from the code and the project\'s own docs only.\n\nStart by running the group\'s tests, for example `forge test --match-path <file> --match-test <name> -vvv`. For a fuzz test use `--fuzz-seed 0x5eed`. Read the failure and the trace. Then try each of the four disproofs below. For each one, write down what you checked and what you found.\n\n1. intended_or_allowed. A doc sentence, a NatSpec line, a code comment, a rule enforced elsewhere in the project, or a standard that the project says it implements shows that the behaviour the test rejects is intended or allowed, or that the project requires something other than what the test asserts (another value, boundary, rounding direction, actor, order, or error). Typical misreads: a cap read as an exact amount, \"may\" read as \"must\", an internal detail read as a promise, an ERC rule the project never claims, an expected value taken from the auditor\'s own formula.\n2. impossible_state_or_cheat. The test reaches its state in a way users cannot: it writes protocol storage directly (vm.store, vm.etch, deal into a protocol contract), calls an internal or privileged path that public entry points do not allow, assumes that a trusted role, admin, or oracle misbehaves when the docs do not promise to tolerate it, uses a mock that behaves unlike the real dependency, uses inputs that the docs exclude or values no deployment reaches (for example amounts or parameters near a type\'s maximum), or has an arithmetic error in its own expected value. Also check that the failure comes from the claimed code and not from an unrelated revert in the test\'s own setup.\n3. misread_code. The claim misreads the code: the cited line does not do what the claim says, a guard, clamp, or check elsewhere on the same path already handles the case, or the test exercises a different function or overload than the one the claim names.\n4. hardening_only. The code lacks a second layer of defence, but the first layer works and no reachable state breaks a requirement. A gap in defence in depth, a missing sanity check on a trusted input, or a style or gas issue is a hardening note and not a bug. A deviation from a requirement that a doc, NatSpec line, or standard states (a value, an error, a boundary, a promise such as \"without overflow\") is never hardening, however small the impact: it is a broken requirement.\n\nEvidence rules.\n- The code under audit is never evidence that its own behaviour is intended: the bug can be exactly that line. Only words in docs, NatSpec, or comments, or a rule enforced elsewhere in the project, show intent.\n- A project test that asserts the same behaviour as the code shows that the behaviour is known, not that it is right. It counts as intent only when its name or a comment states the reason. A standard that the project says it implements (for example \"full ERC-4626\") outranks a project test that contradicts it.\n- A doc promise holds for the whole input domain of the types unless the docs or the code state a bound. Inputs are \"unrealistic\" only when a doc or a check in the code excludes them, or when they exceed what any token supply or deployment parameter can reach; \"no real user holds that much\" is not enough when the doc promises the function works.\n- A state counts as reachable if public entry points of the contract under audit reach it. Saying that another project component usually prevents it is a disproof only when you can name the code that makes it impossible (file:line) and the contract under audit relies on that component by its documented design.\n- Silence is not a disproof. When the docs are silent or less precise than the test, a disproof needs a concrete defect in the test or the claim (routes 2 and 3), not the missing sentence.\n- Every disproof needs evidence: file and line references with the exact quoted text (copied character for character, without line-number prefixes) from the project or from the test.\n- When the tests in the group make different claims, try to disprove each one. The group is confirmed if at least one claim survives; name that claim\'s test.\n\nVerdicts.\n- confirmed: you tried all four disproofs for the surviving claim, with real checks, and each failed. State what you checked, and quote the project text or the code line that shows the broken requirement or the loss.\n- rejected: one disproof holds for every claim in the group. State the disproof and give the evidence.\n- needs_validation: you cannot confirm or reject because one fact stays open (for example \"whether the docs promise X\" or \"whether deployments can set Y\"). Name that exact fact in one sentence. Use it only when a fact is open; do not use it to avoid a decision.\n\nDo not judge severity. You have a small budget: read what the claim needs, run the tests, and stop when you can decide.\n\nVerify this finding group. Try to disprove it.\n\nProject targets:\n{targets}\nThe group is also in {group}, as JSON.\n\nTests in the group (file path relative to the current directory, test, the auditor\'s claim, and the failure reason from the auditors\' runs on every seed):\n\n{members}\nGive the verdict for the group as a whole. When you finish, write only this JSON object to {verdict}:\n\n{\"verdict\": \"confirmed\" | \"needs_validation\" | \"rejected\",\n \"reason\": \"confirmed: the requirement that the code breaks and the surviving test. rejected: the disproof. needs_validation: what you checked. Include what you checked for each of the four disproofs.\",\n \"evidence\": [{\"file\": \"path relative to the current directory\", \"line\": 0, \"quote\": \"exact text copied from that file, starting at that line\"}],\n \"unresolved\": \"needs_validation only: the one exact open fact, else an empty string\"}\n";
Expand description

The task of a verifier session. The placeholders are the targets, the group file, the verdict file, and the tests of the group.