DeFi Security AllianceRequest an audit
Menu

Security research

AI and blockchain: a 2,000-case alert exercise

A reproducible synthetic alert exercise explains the base-rate problem, followed by evidence requirements for AI-assisted security reviews and controls on response authority.

Use AI in blockchain security to propose testable hypotheses and sort evidence. Before treating its output as a finding, reproduce the failure against the actual target. Before using an alert to trigger a response, check how many alerts deserve that response.

Compare monitoring tools and alert delivery checks when turning the exercise into a response workflow.

Our downloadable exercise contains 2,000 synthetic cases. It shows why a detector with a fixed recall can still produce a queue dominated by false alarms. No AI model was tested.

A base-rate exercise you can reproduce

DeFiSec constructed two cohorts of 1,000 fictional cases and ran the accompanying evaluator on September 5, 2026. Each row has an authored ground-truth label and an authored alert decision. The prevalence of positive cases is 10% in one cohort and 1% in the other. We deliberately assigned alerts to yield 80% recall and a 10% false-positive rate in both.

This is an educational arithmetic example, not a model benchmark or a measurement of any AI system's accuracy. There are no real transactions, inferred labels or learned predictions. The rates are inputs to the construction.

Results counted from the synthetic CSV. Percentages rounded to one decimal place.
Metric10% prevalence1% prevalence
True positives808
False positives9099
False negatives202
True negatives810891
Total alerts170107
Precision47.1%7.5%
Recall80.0%80.0%
False-positive rate10.0%10.0%

Precision is true positives divided by all alerts. Recall is true positives divided by all actual positives, including missed cases. False-positive rate divides false positives by all actual negatives. With fewer positive cases, the same false-positive rate creates a much larger share of the alert queue: 99 of 107 alerts are false in the second cohort.

Download the synthetic dataset, evaluation script and computed results. Save them together and run python3 evaluate_alerts.py. The method notes explain regeneration and limitations.

For a real pilot, report the sampled population and label-review process. Include unalerted cases when estimating recall; reviewing only the alert queue leaves missed incidents unknown. Keep confirmed findings separate from duplicates and unresolved candidates. These synthetic proportions cannot predict performance on your protocol.

Separate AI triage from testing and proof

A proposed explanation, an execution trace and a checked theorem support different conclusions. Record which one each tool actually produced.

Evidence to request at each stage
MethodInput and outputLimit
AI triageCode, documentation or alerts become candidate explanations and proposed tests.Readable reasoning does not establish reachability or impact.
Static analysisSource or intermediate representations produce rule findings and code relationships.Detector scope and assumptions constrain coverage.
FuzzingA harness and generated inputs produce execution traces or failing properties.Coverage depends on which states the harness explores and which properties it checks.
Formal verificationA model and specification produce a proof result or counterexample.Assurances cover the stated properties under the model's assumptions.

The Ethereum testing documentation explains these testing distinctions. An AI system can help draft a harness or specification; the resulting test or proof still needs review.

Reproduce a candidate before accepting it

The Ethereum Foundation's July 2026 account of agent-assisted protocol research requires an independently runnable reproducer against real code. It describes misleading candidates whose inputs cannot reach the vulnerable path and proofs whose statements fail to capture the intended property.

For each candidate, preserve the target revision and build configuration. State the entry point an attacker controls, the property allegedly violated and the observable failure. Run the reproducer in an isolated environment that matches the relevant production behavior. Have another reviewer check reachability and impact, then compare the result with known or fixed issues. Record who accepted it and why.

A successful run of generated test code is insufficient if the test bypasses the real entry point or asserts the wrong property. Keep the candidate open until those questions are resolved.

Treat repository context as untrusted input

Comments, README files and retrieved documentation can contain instructions aimed at the assistant reviewing them. OWASP's prompt-injection guidance covers external content that changes model behavior and recommends separating untrusted material from instructions.

Apply that boundary to audit inputs: a repository cannot grant permission to disclose secrets, install arbitrary software or suppress a finding. Label external content, validate structured outputs and keep credentials outside model context. Run generated code with restricted filesystem and network access. Test whether hostile documents can alter tool calls or report content; a prompt telling the model to ignore attacks is insufficient protection.

Keep response authority outside the model

Start monitoring integrations with read access and proposed actions. OWASP's excessive-agency guidance places authorization in downstream systems and calls for approval of consequential actions.

For blockchain operations, enforce permitted contracts and functions in the execution layer. Keep signing keys separate from the assistant. Require a human to review any proposal to pause a protocol, change an approval or move funds. Check the transaction target and simulated effects before approval, then log the authorized action and its outcome. Rate limits constrain damage but do not establish that an action is appropriate.

When selecting a workflow, use the security tools directory to identify the analysis methods you need. Consult security reports for supporting evidence and the DeFiSec methodology for how we assess it. Request reproducible artifacts and a defined response policy before relying on an AI security claim.

Sources

Checked . Local examples include their inputs and limits.

  1. Ethereum Foundation: The triage is the product (July 9, 2026)
  2. OWASP LLM01:2025 Prompt Injection
  3. OWASP LLM06:2025 Excessive Agency
  4. Ethereum.org: Testing smart contracts
  5. DeFiSec synthetic alert exercise: dataset, construction and evaluator

About this revision

DeFiSec editorial update dated September 5, 2026. The original archive contribution remains credited to Blaize; this rewrite is not presented as Blaize's review or endorsement. Removed unsupported product claims and historical vendor metrics, added current primary sources and a reproducible synthetic exercise. No AI model was benchmarked.

Suggest a correction with evidence

Comments

2
  1. Marcus V.

    Recording a decision on-chain does not establish that the model's input was trustworthy. The input source and the authority to act on the output need separate checks. Could the example include a rejected input and show why it never reaches transaction approval?

  2. Jonas E.

    The local example would be a useful place to test what happens when the model proposes a transaction outside its permitted actions.

Leave a comment

Share a question or observation about this article.

10 to 3,000 characters.