Agora: Toward Autonomous Bug Detection in Production-Level Consensus Protocols with LLM Agents
Abstract
Consensus protocols form the backbone of distributed systems and blockchains, where implementation bugs can cause data corruption and financial losses. While LLM-based approaches show promise in code analysis, they struggle with deep protocol-level logic bugs involving complex state-dependent behaviors across multiple execution stages. We present Agora, a domain-aware multi-agent framework that integrates hypothesis-driven testing with LLM capabilities for systematic protocol verification. Agora employs specialized agents that collaboratively explore protocol state spaces, synthesize attack scenarios using domain-specific constraints, and validate findings through iterative refinement. This explicit role separation enables reasoning about global protocol invariants beyond single-function code analysis. We evaluate Agora on four consensus implementations (Raft, EPaxos, HotStuff, BullShark) using four state-of-the-art LLMs. Agora discovers 15 previously unknown protocol-level logic bugs that violate safety properties, while existing LLM-based agents fail to detect any such protocol-level logic bugs. Our results demonstrate that domain-aware multi-agent collaboration is essential for detecting deep logic bugs in complex protocols.
Lay Summary
Distributed consensus protocols are the foundational guardrails of modern computer networks, cloud storage, and blockchains, ensuring everyone agrees on the correct data ledger. However, even mature, years-old implementations harbor deep, hidden logic flaws that can trigger catastrophic data corruption or massive financial losses. Standard AI tools are decent at finding basic code typos, but they completely fail to reason about these multi-stage, abstract protocol-level logic bugs. To bridge this gap, we created Agora, a domain-aware AI multi-agent framework designed specifically for deep bug hunting. Following a rigorous system-testing philosophy called hypothesis-driven testing, Agora divides the work among three specialized AI agents that act as a collaborative engineering team: an Orchestrator to control the workflow, a Strategy expert to cook up complex network attack scenarios, and a Test Generator to write and refine execution scripts. Evaluating Agora across four major consensus protocols (including production-grade systems like etcd and Sui) yielded breakthrough results. While standard state-of-the-art AIs found zero deep logic flaws, Agora successfully discovered 15 previously unknown zero-day logic bugs that violated core safety guarantees. This framework proves that collaborative, domain-specialized AI can automatically secure the critical infrastructure powering global cloud databases and blockchain economies.