Get the daily emailDaily email
  1. Home
  2. Research
  3. This story

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…

Published Read the original
LeanGuard: Lean-verified guardrails for tool-using agents

Why it matters

It shows a formally verified alternative to prompt-based rules for constraining agent actions.

What happened

1 min read

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 with LeanGuard, and direct prompt-injection success on DTap fell from 57.9% to 5.9% without hurting benign tasks.

inscraper analysis

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.

More in Research