Agentic AI
New AI system detects millions in smart contract vulnerabilities before they're exploited
An agentic approach to auditing DeFi protocols uncovers security flaws by learning patterns from historical hacks and translating them into automated searches.
Securing the billions locked in decentralized finance protocols requires catching bugs before attackers do. But finding vulnerabilities in smart contracts remains elusive—each project's unique business logic hides flaws that generic tools miss.
A new system called Knowdit tackles this problem by teaching machines to recognize recurring patterns across DeFi hacks and apply them systematically to new code. Researchers from arXiv describe how the tool combines human audit knowledge with multi-agent workflows to outperform existing vulnerability detectors.
How Knowdit Works#
The system starts by extracting lessons from historical human audits. Rather than memorizing individual bugs, it builds a knowledge graph that connects DeFi semantics—the underlying economic mechanisms that recur across different protocols—with the specific vulnerability patterns they enable. This abstraction means patterns learned from one lending protocol can apply to another, even if the code looks different.
When analyzing a new project, Knowdit runs a pipeline of AI agents that work together:
- An agent generates formal security specifications
- Another synthesizes Proof-of-Concept (PoC) exploits
- A third executes those PoCs to confirm real vulnerabilities
- Finally, agents reflect on findings and refine the search
The agents share a central knowledge repository, iterating until they've thoroughly explored the attack surface.
Real-World Performance#
In tests on 11 recent Code4rena audit competitions, Knowdit caught all 21 high-severity vulnerabilities without false positives and found 90% of medium-severity flaws. It fully covered eight of the 11 projects tested.
Applied to seven real-world DeFi protocols not in the training set, the system uncovered 9 previously unknown high-severity and 36 medium-severity vulnerabilities—securing millions in locked liquidity.
Why It Matters#
Current automated tools struggle with vulnerabilities deeply rooted in project-specific logic. Knowdit's insight—that different protocols reuse the same economic patterns and therefore the same attack vectors—enables a more systematic approach. By elevating auditing from code scanning to semantic understanding, the method sets a new bar for autonomous security analysis in DeFi.

