Building Heimdall: an AI orchestrator for Web3 bug hunting
A single LLM can read a smart contract. It can't audit a protocol. Here's how I'm building an orchestration layer that coordinates eleven specialist agents to find bugs the way a real security team does — in parallel, with receipts.
Most "AI auditing" demos work like this: paste a contract into a chat window, ask "are there any vulnerabilities?", and read back a confident list. It's a good party trick. It is not security work. A real audit isn't a single pass over a single file — it's a team of specialists reasoning about state, money, and adversaries across an entire codebase, cross-checking each other, and refusing to stop at the first plausible finding.
Heimdall is my attempt to make an AI system behave that way. It's an orchestration layer for Web3 bug-bounty research, built with security researcher Antonio Avvigiano, the creator of Chimera. Its design draws on the AgentFlow paper and Monad's open-source bug finder: instead of one model doing everything, it coordinates a roster of narrow, specialized agents through parallel analysis, dependency graphs, iterative review cycles, and a synthesis step that turns noise into a ranked list of real leads.
Why one agent isn't enough
LLMs degrade as context grows and as a task asks for many kinds of reasoning at once. Ask a single agent to simultaneously hold reentrancy, access control, oracle assumptions, accounting invariants, and upgradeability risks in its head — across twenty contracts — and it does all of them shallowly. It also anchors: the first vulnerability it imagines colors everything after it.
Human teams don't work like that. They split by threat category, give each reviewer a focused lens, then reconcile. Heimdall copies that structure directly.
Narrow the lens and the model gets sharper. Eleven focused passes beat one omniscient prompt every time.
The specialist roster
Each agent owns one threat model and nothing else. It gets a system prompt tuned to that category, a curated set of example exploits, and the slice of the dependency graph that matters for its job. The current roster:
The pipeline
A run moves through four stages. The expensive reasoning happens in parallel; the cheap deterministic work happens around it.
Verification is the whole game
The hardest problem in AI security tooling isn't finding candidate bugs — it's not drowning a researcher in false positives. An LLM will happily report a "reentrancy risk" on a function that's already guarded. So AgentFlow treats every candidate as a hypothesis, not a finding, until a deterministic tool agrees.
That's where the fuzzing stack earns its keep. When an agent claims an invariant can be broken, Heimdall tries to break it for real with property-based tests. Confirmed findings come with a failing test case attached; unconfirmed ones are demoted, not shipped.
{
"agent": "accounting",
"target": "Vault.withdraw()",
"hypothesis": "rounding lets last withdrawer drain dust",
"severity": "medium",
"status": "CONFIRMED",
"repro": "test_invariant_totalAssets.t.sol"
}What's next
The architecture generalizes well beyond smart contracts — the same fan-out-and-synthesize pattern works for backend systems and protocol logic anywhere money and trust boundaries meet. I'm tightening the feedback loop between agents (letting one specialist's finding seed another's search) and expanding the fuzzing harness library so verification covers more of the candidate space automatically.
If you run a protocol, a bug-bounty program, or a security team and this sounds useful — I'd love to compare notes.