Pipeline Active
Last: 18:00 UTC|Next: 00:00 UTC
← Back to Insights

AI Writing Code, AI Breaking Code: The $400B DeFi Security Crisis

AI agents can now exploit 55.88% of smart contracts at $1.22 per scan while simultaneously writing vulnerable code, creating an unprecedented security feedback loop that existing defense frameworks cannot address.

TL;DRBearish 🔴
  • AI agents can autonomously exploit 55.88% of smart contracts at $1.22 per scan—a 10x economic advantage over defenders
  • Moonwell's February 15 oracle failure ($1.78M) featured AI-co-authored code, marking the third oracle failure in four months ($7.25M cumulative bad debt)
  • AI discovered two novel zero-day vulnerabilities in 2,849 recently-deployed contracts with no prior known exploits—the first autonomous zero-day generation in blockchain
  • Ethereum's ePBS upgrade introduces an 8-second builder free option that enables real-time attack optimization alongside slower governance defense timelines
  • The 10x attacker-to-defender profitability asymmetry cannot be closed through incremental security improvements
ai-securitysmart-contractsoracle-failuredefi-riskmev5 min readFeb 23, 2026

Key Takeaways

  • AI agents can autonomously exploit 55.88% of smart contracts at $1.22 per scan—a 10x economic advantage over defenders
  • Moonwell's February 15 oracle failure ($1.78M) featured AI-co-authored code, marking the third oracle failure in four months ($7.25M cumulative bad debt)
  • AI discovered two novel zero-day vulnerabilities in 2,849 recently-deployed contracts with no prior known exploits—the first autonomous zero-day generation in blockchain
  • Ethereum's ePBS upgrade introduces an 8-second builder free option that enables real-time attack optimization alongside slower governance defense timelines
  • The 10x attacker-to-defender profitability asymmetry cannot be closed through incremental security improvements

The Offensive Breakthrough: AI Autonomously Exploiting 55.88% of Contracts

Anthropic's SCONE-bench research demonstrated that AI agents (Claude Opus 4.5, Sonnet 4.5, GPT-5) can autonomously exploit 207 of 405 real-world smart contracts, generating $550 million in simulated revenue. The capability trajectory is exponential: from 2% to 55.88% of post-knowledge-cutoff contracts in one year, with exploit revenue doubling every 1.3 months.

The economics are devastating for defenders: AI-powered attackers reach profitability at just $6,000 in exploit value, while defenders require $60,000—a structural 10x asymmetry that cannot be closed through incremental improvements. Most alarming, AI agents discovered two novel zero-day vulnerabilities in 2,849 recently-deployed contracts with no prior known exploits.

The scan cost? $1.22 per contract. A criminal with $500 in compute can scan 400+ contracts for exploitable vulnerabilities.

The Moonwell Case Study: When AI-Assisted Code Meets Governance Attacks

Moonwell's February 15 oracle failure caused $1.78M in bad debt—the third failure in four months. The MIP-X43 proposal migrating to Chainlink OEV wrappers contained a fundamental error: cbETH was priced at $1.12 instead of ~$2,200 because the oracle used raw cbETH/ETH exchange rate without multiplying by ETH/USD.

Within minutes, liquidation bots exploited the 2,000x discrepancy, seizing 1,096 cbETH ($2.44M) before emergency containment. The pull request for the affected code showed commits co-authored by Claude Opus 4.6. While no causal link between AI assistance and the bug has been established, the incident crystallizes a new risk category: AI-assisted code generation in governance proposals that bypass traditional audit workflows.

Smart contract audits examine deployed code; governance proposal implementations that change oracle configurations operate in a different review pipeline entirely. This was Moonwell's cumulative problem: October 2025 ($1.7M bad debt from AERO/VIRTUAL/MORPHO mispricing), November 2025 ($3.7M from wrsETH malfunction), February 2026 ($1.78M from cbETH misconfiguration). Total: $7.25M in preventable bad debt.

The Feedback Loop Nobody Planned For: Accelerating Code, Accelerating Exploits

The structural danger is the convergence of two trends:

  1. AI agents increasingly writing and reviewing smart contract code
  2. AI agents increasingly capable of finding and exploiting vulnerabilities in that code

This creates a novel feedback loop: as AI assistance accelerates code production (reducing cost and time for governance proposals, deployments, configurations), it simultaneously accelerates the rate at which vulnerabilities can be discovered and exploited. The 88% of organizations reporting AI security incidents (CyberArk 2026) combined with 45.6% still using shared API keys for agent authentication suggests the infrastructure to manage AI-assisted code is fundamentally immature.

The oracle failure category is particularly vulnerable because oracle configurations exist at the intersection of three risk domains simultaneously: governance execution risk (proposal review quality), smart contract risk (configuration correctness), and economic risk (arbitrage incentives). AI excels at finding economic arbitrage opportunities—exactly the kind of vulnerability that oracle misconfigurations create.

Ethereum's ePBS Compounds the Risk: Governance Defense Meets Attack-Speed Execution

Ethereum's planned ePBS upgrade introduces an 8-second 'free option' for block builders to conditionally reveal execution payloads. The 0.82% average block exercise probability escalates to 6% on high-volatility days.

Now consider the risk convergence: if an AI agent discovers an oracle mispricing (like Moonwell's), it can simultaneously exploit the vulnerability AND use the ePBS free option to maximize extraction by timing block inclusion to its advantage. The combination of autonomous vulnerability discovery + builder-level execution timing creates an exploitation pipeline that operates at protocol speed, not human speed. Governance timelocks prevent real-time defense while ePBS enables real-time attack optimization—the asymmetry between defense response time (days) and attack execution time (seconds) is growing.

Scale of the Threat: $400B TVL in Immutable Code

With $400B+ in DeFi TVL and smart contract immutability as a design principle, the combination of:

  • 55.88% exploitation success rate (and growing)
  • $1.22/scan cost (and falling)
  • 10x attacker/defender economic asymmetry
  • Governance-layer attack surface bypassing smart contract audits
  • ePBS-enabled execution timing optimization

...creates a threat that existing security frameworks—code audits, bug bounties, insurance pools—were not designed to address. OpenAI and Paradigm have launched EVMbench, a defensive smart contract security benchmark, as a necessary response. But the economic asymmetry means defense must be subsidized by the ecosystem rather than sustained by market economics alone.

The Contrarian Case: AI Defense Could Leapfrog Offense

The same AI capability that enables autonomous exploitation also enables autonomous defense. SCONE-bench's immediate vulnerability detection achieves 86-89% success rate versus 6-21% with week-long delay—suggesting that real-time AI monitoring could close the vulnerability window if deployed at protocol level rather than as an external audit service. Anthropic has committed to open-sourcing the SCONE-bench dataset, which could accelerate defensive tooling.

The question is whether protocol governance can integrate AI-powered real-time monitoring before the exponential attack capability curve overwhelms the current audit-based defense model.

What This Means

DeFi faces a structural security crisis that is not a result of any individual protocol failure but rather the convergence of AI capabilities with the immutability and transparency of blockchain design. The Moonwell incident is not an outlier—it is a preview of what autonomous contract exploitation looks like when it meets real capital at risk.

For protocol designers: governance timelocks are now liabilities, not securities. For investors: expect increased oracle failures and governance attacks before protocols can implement real-time AI monitoring. For regulators: this is precisely why DeFi remains less systemically safe than regulated alternatives. The technical innovation that made DeFi possible (immutable, transparent, composable smart contracts) is now its primary vulnerability surface.

AI Smart Contract Attack Economics: The 10x Asymmetry

Key metrics showing the structural economic advantage of AI-powered smart contract attacks over AI-powered defense

55.88%
Contracts Exploitable by AI
+53.88pp in 1 year
$1.22
Cost Per Contract Scan
$6,000
Attacker Profitability Threshold
$60,000
Defender Profitability Threshold
$7.25M
Moonwell Cumulative Bad Debt (4 months)
3 incidents

Source: Anthropic SCONE-bench, Moonwell governance forum

The AI-Oracle Convergence: How Autonomous Attacks Met Governance Failures

Timeline showing simultaneous acceleration of AI exploit capability and real-world oracle failures

Oct 2025Moonwell Oracle Failure #1

AERO/VIRTUAL/MORPHO mispricing, $1.7M bad debt

Nov 2025Moonwell Oracle Failure #2

wrsETH malfunction, $3.7M bad debt

Feb 1Anthropic SCONE-bench Published

55.88% exploit rate, $550M simulated, 2 zero-days found

Feb 15Moonwell Oracle Failure #3

AI-co-authored cbETH config, $1.78M bad debt

Feb 16OpenAI/Paradigm EVMbench

Defensive benchmark launched in response to SCONE-bench

Source: Anthropic, OpenAI, Decrypt, The Block

Share