MAGS routes coding-agent output through Dafny and reports 100% success at producing verified programs on 220 tasks
arXiv 2609.19391 (2026-09-16) uses Dafny as a verification-aware intermediate representation between an LLM coding agent and shipped code. MAGS freezes human-audited APIs and safety requirements as specifications, translates generated code into Dafny, repairs violations using verifier feedback, then compiles the verified program back to executable form. On 100 CUDA kernels, 100 terminal scripts and 20 robotic-arm tasks, all 220 examples produced programs carrying non-trivial safety guarantees against the frozen specs. The honest caveat is in the paper: independent safety and functional evaluations still found failures wherever the auto-formalized semantics did not fully capture the intended behavior, which relocates the trust problem to specification quality rather than removing it.
Source
↳ Follow the thread