LeanGuard: Lean-verified guardrails for tool-using agents
LeanGuard is a fail-closed runtime that checks every proposed agent tool call against a Lean4 policy, with temporal rules over execution history, before it runs. On Tau-Bench with five Qwen models, unguarded agents made at least 33 forbidden calls versus none…
Why it matters
It shows a formally verified alternative to prompt-based rules for constraining agent actions.
What happened
1 min readLeanGuard is a fail-closed runtime that checks every proposed agent tool call against a Lean4 policy, with temporal rules over execution history, before it runs. On Tau-Bench with five Qwen models, unguarded agents made at least 33 forbidden calls versus none with LeanGuard, and direct prompt-injection success on DTap fell from 57.9% to 5.9% without hurting benign tasks.
Our analysis
It fits the trend of moving policy out of the prompt (as in CUGA's ToolGuard) but adds formal guarantees. The practical hurdle is writing policies in Lean4, which few teams can do. Experiments used only small Qwen models, and proof-guided repair succeeded on about a third of value-caused denials.