AI Agents Forge Custom Security Tools, Uncover Critical Miden VM Vulnerability
Trail of Bits leveraged AI agents to develop bespoke auditing tools for the Miden VM, discovering a critical flaw allowing forged signatures and fund theft.

Security researchers are increasingly turning to artificial intelligence agents not just for code review, but also for the foundational development of custom security tooling. Trail of Bits recently detailed how they employed AI agents to build a suite of specialized tools for auditing the Miden VM, a new zero-knowledge virtual machine with a custom assembly language and limited existing developer support.
This proactive approach involved a six-month effort where AI agents were tasked with creating an Language Server Protocol (LSP) server, a decompiler, a static analysis engine, and a formal Lean model of the VM's executor. These custom-built tools were instrumental in enhancing the depth and quality of the subsequent security review.
The development of the LSP server, for instance, provided essential IDE features like syntax highlighting, code navigation, and hover-over documentation. This significantly improved the readability of the Miden assembly language (MASM) and allowed reviewers to better track data flow within the codebase.
Decompiling MASM presented unique challenges due to its stack-machine architecture and implicit instruction inputs/outputs. Trail of Bits focused on correctly decompiling a well-defined subset of MASM, using AI agents to both develop the decompiler and to perform regression testing by comparing decompiled output against original MASM code.
These AI-generated tools were not merely theoretical exercises; they directly contributed to uncovering significant security vulnerabilities. A critical flaw was identified where unvalidated prover-supplied input could be exploited to forge Falcon signatures, potentially leading to the theft of funds from Miden account holders.
Beyond vulnerability discovery, the project also achieved a high degree of assurance through formal verification. The AI-assisted efforts in Lean resulted in the generation of 95 machine-checked correctness proofs for a substantial portion of the Miden core library, bolstering confidence in its cryptographic primitives.
This case study highlights a paradigm shift in security auditing, where AI agents are now capable of building sophisticated, bespoke tools tailored to the specific needs of a complex system like a zero-knowledge VM. The success with Miden VM demonstrates the potential for AI to accelerate the development of high-assurance security tooling and uncover critical vulnerabilities that might be missed by conventional methods.
The implications extend beyond this single audit, suggesting a future where AI-powered agent teams can rapidly equip security professionals with the precise instruments needed to tackle novel and complex security challenges in emerging technologies.