Field Notes
A small, source-linked blog

2026-09-19 · AI-assisted

Auditing Custom Zero-Knowledge Tooling with AI Agents

Trail of Bits describes using AI agents over six months to build custom developer tooling, decompilers, static analyzers, and formal verification models for a custom zero-knowledge virtual machine assembly language.

What Changed in Tooling Development

According to Trail of Bits, security engineers spent six months using AI agents to build developer and analysis tooling from scratch for the Miden zero-knowledge virtual machine (VM) and its custom assembly language (MASM). The project produced a Language Server Protocol (LSP) server, a static analysis engine, a decompiler, and a Lean model of the VM executor.

The decompiler effort required more than 100 AI-generated commits over multiple months. Because hand-written MASM lacks declared signatures, standard calling conventions, and stack-neutral loops, the decompiler had to focus on a well-defined subset of the language rather than universal decompilation.

How It Works: Static Analysis and Formal Verification

The source notes that AI agents helped construct an abstract interpretation engine for static analysis. This analysis found over 400 unique locations where type validation could be improved. It also uncovered a high-severity vulnerability in the mod_12289 procedure caused by an unvalidated advice value supplied by the prover.

Separately, agents assisted in creating a minimal Miden VM executor in Lean along with an automatic translator from MASM to Lean. This generated 95 machine-checked correctness proofs covering the binary arithmetic components of the Miden core library. This formal modeling process caught two subtle bugs that the existing unit test suite missed.

Why a Developer Might Care

Developers working with niche languages or new architectures can apply similar strategies:

The source also highlights an economic shift: because AI agents can carry out exploratory side projects with light supervision, failed experiments primarily cost tokens rather than large human resource allocations.

Limitations

The source identifies several technical constraints:

Sources