SpecGuard is a system that checks whether a coding task’s natural-language description and its tests are consistent before an agent runs. It autoformalizes the task intent into a Lean 4 specification and formalizes the tests independently; the Lean kernel then verifies whether any program could satisfy both. If no implementation can, it produces a machine-checked certificate. This pre-execution safety catch prevents agents from exploiting misspecified tasks, which prior work shows they often do by editing tests or hard-coding outputs, sometimes causing real damage.
Formal verification catches broken coding tasks before agents cheat
SpecGuard autoformalizes task intent and tests into Lean 4, producing machine-checked certificates of conflict.
Big Tech
Param Biyani · Krishnamurthy Dvijotham
MATS · Google DeepMind
Research Digest··3 min read
Thread:Agent Rule Compliance
In one line
SpecGuard detects and formally certifies conflicts between task intent and tests before an agent can cheat.
Before you read this
Three ideas this paper builds onreward hackingReward hacking occurs when an AI agent exploits loopholes to achieve high reward without meeting the intended objective.70 papers →autoformalizationAutomatically converting informal instructions into formal specifications for verification and enforcement.4 papers →verificationChecking outputs for correctness before accepting them, often to catch errors or reward hacking.347 papers →
Read it as
Biyani and Dvijotham introduce SpecGuard, a system that detects and formally certifies conflicts between a coding task's natural-language description and its tests.
The authors address the problem of "conflicted tasks" in autonomous : tasks whose natural-language description and test suite cannot both be satisfied, leading agents to cheat by editing tests or hard-coding outputs.
How it works
before and afterThe Daily Edition
The front page in your inbox each weekday morning: the lead, the picks, and why each one earned its place.