Module SDD-09 — Heimdallr

Heimdallr

The reference agent harness for smart contract auditing: function-level reorganization, cascaded verification, 92.45% detection at $2.31/10K LOC, 17/20 real attack reconstructions.

60
minutes
8
artifacts
3
sub-sections
Heimdallr (arXiv 2601.17833) is the LLM-based smart contract audit agent that demonstrates structure — not a bigger model — is what closes the gap between automated scanning and human-audit depth. Its three core mechanisms: function-level reorganization rewrites the contract into context-complete units the LLM can reason over; a cascaded verification pipeline spends the LLM budget only on survivors; and exploit reconstruction reaches human-auditor depth on 17 of 20 real attacks. The 92.45% detection rate at $2.31 per 10K lines of code is the headline that makes agent-based auditing affordable at protocol scale.
Key Claims
Load-Bearing Claims

Function-level reorganization is the load-bearing idea. Rewriting the contract into context-complete function units (resolving inheritance, inlining modifiers, reconstructing state and external-call dependencies) is what lets the LLM reason at auditor depth instead of hallucinating over raw source. The same model on raw source vs reorganized units produces dramatically different results. No other harness in the roster performs this transformation.

Cascaded verification is the cost discipline behind $2.31/10K LOC. Cheap pattern checks produce candidates, LLM semantic analysis confirms or rejects, and exploit reconstruction runs only on the confirmed few. Spending the LLM budget only on survivors is what makes the agent affordable at audit scale; the naive alternative (LLM on every function) costs orders of magnitude more.

The 17/20 reconstruction rate is the headline that matters. Exploit reconstruction measures the agent at human-auditor depth — it shows how the vulnerability would be exploited, not just that it exists. Placed last, only on confirmed candidates, it is the deepest verification short of a live exploit.

92.45% detection is a high-recall first pass, not a clean bill of health. The 7.55% miss rate is the risk a client must not read as 'secure,' and symbolic reconstructions are hypotheses requiring live-chain confirmation. The read-only execution is safe; the interpretation of findings is the surface to govern.

After This Module
01
Explain Heimdallr's three core mechanisms — reorganization, cascaded verification, the cost model — and why each is necessary.
02
Defend the 92.45% detection / $2.31-per-10K-LOC / 17-20 numbers: what they measure and how to read them.
03
Distinguish cascaded verification from a single-pass LLM audit and explain why the cascade is the cost discipline.
04
Map Heimdallr's design to the 12-module rubric as an agent harness (50/60) and note the standout modules.
05
Identify what a builder must add (Patch mode, cross-audit learning, live-chain verification) to turn detection into an audit product.
Artifacts