Smart contracts are the backbone of decentralized finance (DeFi), managing hundreds of billions of dollars in assets. However, they operate in a "dark forest"—an adversarial environment where code is immutable, and a single bug can lead to an immediate, irreversible loss of funds. As AI models become increasingly capable of reading, writing, and executing code, it is critical to understand how well they can navigate this high-stakes landscape.
Existing cybersecurity benchmarks are often too narrow, focusing primarily on traditional software (like C++ or Python) or simplified "Capture the Flag" (CTF) challenges. Smart contract security, by contrast, requires a unique blend of skills: understanding the Ethereum Virtual Machine (EVM), reasoning about economic incentives, and managing stateful, multi-step interactions. To address this gap, researchers introduce EVMbench, a high-fidelity benchmark designed to evaluate whether AI agents are ready to act as "white-hat" defenders or "black-hat" exploiters in the Web3 ecosystem.
Methodology: Evaluating in the Dark Forest
EVMbench evaluates agents across three distinct modes of operation, ranging from static analysis to live, on-chain execution:
- DETECT: The agent audits a repository and produces a vulnerability report. Success is measured by the recall of "ground-truth" vulnerabilities identified.
- PATCH: The agent must fix a vulnerable codebase. Grading is programmatic and rigorous: the original test suite must still pass, but the known exploit must fail.
- EXPLOIT: Representing the most realistic and challenging setting, the agent is provided a funded wallet and an RPC endpoint to a local Ethereum node. It must conduct chain analysis, deploy helper contracts, and send transactions to successfully drain funds.
To ensure realism and prevent agents from "cheating" the simulation, the researchers built custom Rust-based tooling. Ploit orchestrates the local blockchain and replays agent transactions for grading, while Veto acts as a JSON-RPC gatekeeper. Veto blocks "god-mode" simulator commands (such as manually setting a wallet balance), forcing the agent to exploit the actual contract logic just as a real attacker would.
Dataset Construction
The benchmark comprises 117 curated vulnerabilities drawn from 40 distinct repositories. The majority of these originate from Code4rena, a platform for competitive smart contract audits. To minimize the risk of data contamination—where models might have seen the solutions during their pre-training—the researchers filtered for high-severity, fund-draining bugs discovered between July 2023 and 2026. Furthermore, the suite includes "oracle" (perfect) patches and exploits for every task to validate the integrity of the grading system.
Key Insights and Results
The evaluation of frontier AI agents on EVMbench yielded several critical insights into the current state of AI-driven cybersecurity:
- Discovery is the Primary Bottleneck: While models struggle to find bugs in large codebases from scratch, their performance skyrockets when given "hints" about a bug's location or type. For instance, GPT-5.2’s success rate on the PATCH task jumped from approximately 39% to over 90% when provided with a mechanism hint. This indicates that models possess the reasoning capabilities to fix bugs but lack the "eyesight" to discover them autonomously.
- Scaffolding Matters: The agent loop surrounding the model significantly impacts performance. Using a specialized scaffold like Codex CLI yielded substantially better results than a basic ReAct loop, even when powered by the same underlying model.
- Top Performers: GPT-5.3-Codex (running via Codex CLI) dominated the offensive categories, achieving a 71.0% success rate on EXPLOIT and 41.7% on PATCH. Conversely, Claude Opus 4.6 (via Claude Code) proved to be the superior "auditor," leading the DETECT category with a 45.9% recall rate.
- Human-Level Reasoning: In one qualitative example, an agent successfully executed a multi-step exploit involving a Balancer flash loan. It correctly identified that it could impersonate a vault to siphon tokens—a level of complex reasoning that mirrors professional human exploiters.
- Simulated Financial Impact: By mapping DETECT scores to real-world audit payouts, researchers calculated that Claude Opus 4.6 would have "earned" over $37,000 in simulated rewards. However, it still missed several critical bugs, falling short of the total $218,000 available.
Limitations and Future Directions
While EVMbench represents a significant step forward, it has limitations. The benchmark currently focuses exclusively on Solidity and EVM-compatible chains. Future iterations aim to incorporate Rust-based smart contracts on Solana and specialized chains like Tempo. Additionally, the current harness does not support cross-chain exploits or vulnerabilities dependent on complex mempool manipulation, such as MEV front-running.
Because setting up these high-fidelity environments is manually intensive, the PATCH and EXPLOIT modes currently feature fewer tasks (44 and 23, respectively) compared to the DETECT mode. Finally, the authors note that the infrastructure developed for EVMbench could extend beyond security, potentially serving as a foundation to evaluate "economic agents" capable of autonomously executing DeFi trades or managing stablecoin payments.
Summary updated