May 25, 2026
TCB-Expansion Attacks on Lean 4 and the LLM Proof Reviewers That (Mostly) Miss Them
Juliet Meza
Using an open Lean bug (#7463), I built 23 proofs that the kernel
accepts as valid but are actually false. The attack works by smuggling
a fake axiom through a @[csimp] rewrite, which native_decide then
compiles and runs — without the kernel ever seeing it. Lean's own
audit command, #print axioms, reports the proof as clean. There is
no warning, no flag, and nothing visually different from an honest proof.
I then tested whether three LLMs (Claude Opus, Sonnet 4.6, GPT-4o)
could catch these attacks acting as proof reviewers. The short answer:
they catch what they can see, and miss what they can't. When the attack
is in the same file, models reject it 35 out of 36 times. When it is
hidden in an imported module, they can't catch it without tool access.
Give them tools and they walk the import chain themselves and find it.
A secondary finding: GPT-4o can be socially engineered. Embedding a
fake audit approval note in the Lean file's docstring caused GPT-4o
to accept 6 out of 12 attacks. Claude models flagged the fake note
as a prompt injection attempt every time.
The fix is a 7-layer defensive stack, anchored by two new tools: a
static scanner and a recursive auditor that finds the axioms #print
axioms hides.
No reviews are available yet
Cite this work
@misc {
title={
(HckPrj) TCB-Expansion Attacks on Lean 4 and the LLM Proof Reviewers That (Mostly) Miss Them
},
author={
Juliet Meza
},
date={
5/25/26
},
organization={Apart Research},
note={Research submission to the research sprint hosted by Apart.},
howpublished={https://apartresearch.com}
}


