MAGS: Multi-agent Auto-formalization Guarantees Safety for Agentic Outputs
- Source
- arxiv.org
- Author
- Albert Wu, Nicholas Roberts, Tzu-Heng Huang, Haoran Lin, Gil Friedman, Sungjun Cho, Gabriel Orlanski, Frederic Sala
- Date

Context
MAGS applies machine-checkable safety requirements to AI-generated programs. It fixes human-audited requirements in advance, translates generated code into Dafny, a language supporting formal verification, and uses verification feedback to repair violations before producing executable code. This makes the stated requirements explicit enough for a software verifier to check. Research abstract.
The authors report programs with verified properties for all 220 evaluated examples. That guarantee depends on what the formal specification captures: separate safety and functional evaluations still found failures where the formalized behavior did not fully represent the intended task. The result makes accurate specification a central part of safety, alongside proving that code satisfies it. Results and qualification.
- MAGS routes generated code through Dafny, a machine-checkable verification language, repairing any safety violations using verifier feedback before compiling back to executable code.
- Across 220 test cases (100 CUDA kernels, 100 terminal scripts, 20 robotic-arm tasks), MAGS achieved a 100% success rate producing programs with formally verified safety guarantees against frozen specifications.
- Independent safety and functional evaluations still found failures in cases where the auto-generated formal (Dafny) version didn't fully capture the intended real-world behavior -- formal verification only guarantees what it was told to check.
- AI agent — An AI system that doesn't just answer once but works toward a goal in a loop — taking actions, reading the results, and deciding what to do next.
articleNeuro-Formal Verification: Agentic Language-Agnostic Formal Program ReasoningShuvendu K. Lahiri
articleA Large-Scale Empirical Study of Quality Assurance Practices and Gaps in AI AgentsWuyang Dai, Moses Openja, Jiho Shin, Hung Viet Pham, Song Wang
articleOpenAgentFlow: Enabling System-Wide Safety Boundaries for Heterogeneous AI Agent FleetsDongsheng Chen, Xiangyu Zhao, Xin Yao, Xuetao Wei
Checking sign-in…
Loading comments…