In the high-stakes world of software engineering, where a single memory leak or a race condition can compromise the integrity of an entire infrastructure, the emergence of AI coding agents has sparked a polarizing debate. Is AI merely a tool for code volume, or can it be a catalyst for unparalleled engineering rigor?
Predrag Gruevski, a software engineer at OpenAI and the creator of critical Rust tools like cargo-semver-checks and Trustfall, posits a provocative answer: "Some people use AI to write more code. I use AI to make my code more correct."
Gruevski’s approach represents a paradigm shift. Rather than relying on AI as a "faster horse" to churn out boilerplate, he treats it as a high-fidelity assistant capable of performing complex verification tasks that were previously too labor-intensive to sustain. This article explores how modern developers are integrating AI into their Rust workflows—not to replace human oversight, but to sharpen it.
Main Facts: The New Frontier of AI-Assisted Rust
The core philosophy shared by industry experts like Gruevski is the Risk-Based Allocation of Effort. In traditional software development, the amount of time spent on a line of code was often proportional to its complexity. Today, AI handles the low-stakes, repetitive labor, freeing human engineers to focus on the "load-bearing" parts of the system.
The methodology relies on three pillars:

- Strategic Prompt Engineering: Treating an AI agent like a highly skilled but context-deprived colleague.
- Automated Verification Pipelines: Moving beyond simple unit tests to incorporate mutation testing, state-machine analysis, and memory-safety checks (Miri/ASan).
- Risk Calibration: Categorizing code by its failure cost—differentiating between a disposable CI script and core library logic.
Chronology: From Prototyping to Production-Grade AI
The integration of AI into the Rust ecosystem has evolved rapidly over the last three years:
- 2023–2024 (The "Vibe Coding" Phase): Early adoption focused on rapid prototyping and auto-completion. Developers used AI to generate boilerplate, largely accepting code without deep formal verification.
- 2025 (The Shift to Rigor): As models became more proficient with complex type systems, power users began building "Verification Pipelines." This period saw the rise of agents that could write tests, run benchmarks, and suggest optimizations based on existing codebase patterns.
- 2026 (The Current Standard): AI agents are now being used to perform deep-dive analysis on hot code paths in critical systems. Techniques that were once considered too expensive—such as full mutation testing—have become standard practice because agents can automate the heavy lifting.
Supporting Data: Why Precision Beats Speed
To understand the impact of this approach, one must look at the performance optimizations achieved within the Rust compiler itself. Gruevski recently utilized an AI agent to identify bottlenecks in the new trait solver. By providing a prompt that specified where to look—specifically in "hot" code that hadn’t seen updates in years—and establishing strict benchmarking criteria, the agent identified a single redundant line of code.
Removing this line resulted in a 7.5% performance improvement.
"In principle, we could have done all of this work manually," Gruevski notes. "It just would have taken five years to find these optimizations." The data suggests that AI, when tasked with specific, high-intent objectives, does not just write code—it acts as a diagnostic tool for system architecture.
Official Perspectives: The Rust Foundation and Beyond
The Rust Foundation, through its collaboration with industry leaders, has been at the forefront of exploring the intersection of AI and memory safety. The consensus is that AI must never be treated as an infallible oracle.

Categorizing Risk
A core theme in the current professional discourse is the "Risk Scale":
- Low-Stakes (CI Workflows): Tasks where the failure is isolated and immediately obvious. AI is highly effective here.
- Systemic Logic (Public APIs): Code that others depend on, such as
cargo-semver-checks. Here, AI must be "stress-tested" against false positives. Gruevski suggests using AI to construct adversarial inputs that trigger false alarms, thereby hardening the logic before release. - Unsafe Blocks: The most critical layer. Here, AI serves as an assistant for creating test harnesses, but the "safety invariants" remain the sole responsibility of the human engineer.
Implications: The Evolution of the Software Engineer
The shift toward AI-assisted development has profound implications for the role of the software engineer. As coding becomes more automated, the value of the engineer shifts from syntax production to design verification.
1. The Death of "Vibe Coding" in Production
While "vibe coding"—prototyping by intuition—is useful for hobby projects, it is insufficient for production. The modern engineer must work backward from the proof: "How would I convince someone else that this code is correct?" By building a verification pipeline that forces the agent to prove its work through coverage tools and mutation testing, the engineer creates a self-validating system.
2. The Rise of the "Agentic" Workflow
We are moving away from simple chat-based interfaces toward structured agentic workflows. A standard instruction set now looks like:
- Define the state machine.
- Write tests for every state and transition.
- Execute coverage tools to ensure logic paths are hit.
- Run
cargo-mutantsto ensure tests are actually meaningful. - Review results for safety invariants.
3. Empathy as an Engineering Skill
When an AI fails, the professional response is no longer just "retry." It is an exercise in debugging the prompt. Engineers are now expected to treat an agent’s failure as a sign that their own requirements or assumptions were imprecise. Updating an AGENTS.md file or refining a persona prompt is becoming a standard part of the software development lifecycle.

Practical Advice for Modern Rust Developers
For those looking to adopt these methods, the path forward is clear:
- Don’t settle for the first output: If you ask an agent for "ten lines of code," you get mediocre code. If you provide a briefing on the design, the constraints, and the testing requirements, you get a robust implementation.
- Focus on the Test Structure: Variable names are trivial; test structure is vital. Instruct your agent to cover all edge cases, and use tools like
cargo-mutantsto identify where the agent’s tests are failing to actually verify the code. - Safety is Manual: Even with advanced AI, memory safety in
unsafeblocks remains a human-led responsibility. Use AI to generate the boilerplate for memory checks, but maintain the final audit.
Conclusion: A New Standard of Quality
The future of Rust development is not a world where AI writes code and humans sleep. It is a world where the quality bar is significantly higher. AI allows developers to run sophisticated verification techniques that were previously reserved for only the most well-funded projects.
Every piece of code pushed to a repository carries the developer’s signature. In an era of AI assistance, that signature now represents not just the code written, but the rigor of the verification pipeline used to validate it. As Gruevski concludes, "Use AI to make sure it’s code you’d be proud to put out in the world."
The technology is no longer just a tool for acceleration; it is a mechanism for discipline. For the Rust community, which has always prioritized safety and correctness above all else, this integration of AI represents the next logical step in the evolution of systems programming.
Frequently Asked Questions (FAQ)
Is AI truly useful for Rust development, or is it just hype?
AI is exceptionally useful when utilized to automate high-effort verification processes. Techniques like mutation testing and Miri-based memory checking, which were once considered "too much work," become standard when agents are tasked with managing the execution.

Do I have to read every line of AI-generated Rust code?
Not necessarily. The intensity of your review should match the risk profile of the code. If the code is a low-stakes CI script, verification through execution is often sufficient. If the code is a core logic component or an unsafe block, it demands line-by-line scrutiny.
How can I ensure my AI-generated code is production-ready?
Adopt a "work backward" approach. Define what constitutes proof of correctness for your specific module (e.g., performance benchmarks, state-machine coverage, or passing sanitizers). Once you have defined what the "proof" looks like, set up your prompt-based workflow to automatically generate that evidence.




