AI Safety
New Framework Guarantees Safety in Self-Evolving AI Agents Through Formal Verification
SEVerA combines formal logic contracts with machine learning to create AI agents that adapt and improve while maintaining provable correctness guarantees.
A research team has introduced SEVerA, a framework designed to address a critical gap in autonomous AI systems: ensuring that self-improving agents remain safe and correct even as they evolve to tackle new problems.
The Problem with Self-Improving Agents#
AI researchers have recently shown success with self-evolving language model agents—systems that can refine their own code to solve complex tasks like program repair and scientific discovery. Yet these frameworks operate without formal safety guarantees, leaving them vulnerable to errors when deployed on unfamiliar inputs. This lack of verification creates real reliability and security risks when agents run without human oversight.
How SEVerA Works#
The core innovation is Formally Guarded Generative Models (FGGM), which lets an LLM planner specify formal contracts for each call to a language model using first-order logic. Rather than hoping the model behaves correctly, each FGGM call wraps the underlying generative model in a rejection sampler—it keeps testing outputs until one satisfies the formal contract, with a verified fallback available if needed. This guarantee holds across all possible inputs and parameter settings.
Built on this foundation, SEVerA operates in three stages:
- Search: Generates candidate programs that include FGGM calls
- Verification: Proves correctness against formal constraints for all parameter values, reducing the problem to unconstrained learning
- Learning: Uses gradient-based optimization (including GRPO-style fine-tuning) to improve task performance while preserving correctness
Evaluation and Results#
Testing on three domains—Dafny program verification, symbolic math synthesis, and policy-compliant tool use benchmarks—revealed that SEVerA achieved zero constraint violations while outperforming both unconstrained baselines and prior state-of-the-art approaches. Notably, imposing formal constraints didn't just ensure safety; it actually steered the synthesis process toward higher-quality agents.
This work suggests that formal behavioral specifications can do double duty: guaranteeing trustworthiness while paradoxically improving agent performance.

