AI agents identified 225 bugs that could cause undefined behaviour across 16 widely used Rust crates, according to a study by UC Berkeley researchers. The work suggests agents can help uncover flaws in the unsafe code underpinning safe Rust APIs, but repeated audits and careful instructions matter as much as the choice of model.
Watch Desk analysis
What happened
The study’s authors, Marius Momeu and Koushik Sen, tested agents on Rust bindings to C libraries, where a safe-looking Rust interface must correctly handle the underlying library’s memory and behaviour. AgentsPulse reports that their open-source auditor, Crustify, found 284 distinct defects across 16 crates: 225 involving undefined behaviour, 36 involving inadequate safety contracts and 23 where a Rust wrapper diverged from the library it wrapped.
In a comparison on the git2 crate, DeepSeek V4.1 Flash and Claude Opus 5.5 found similar numbers of previously unreported defects when given the same detailed audit prompt. DeepSeek’s cost per defect was reported at about a quarter of Opus’s. Without guidance, Opus was the stronger and steadier auditor. Across the study’s 24 audits, 15 of 51 distinct previously unreported defects appeared in only one run.
The researchers report that maintainers had fixed 26 of the 83 findings they had submitted, while another 30 had been fixed independently upstream. The account also describes limits: the model comparison covered one crate, the scoring relied on models rather than human graders, and the DeepSeek runs may have been affected by benchmark leakage.
Why it matters
Rust’s safety guarantees depend partly on the correctness of libraries that use unsafe code behind safe interfaces. A flaw in one of those interfaces can let an otherwise safe Rust program trigger undefined behaviour. Finding such bugs takes more than spotting suspicious code: the agent may need to understand the wrapper and the C library beneath it, then build a reproducer.
The results also make a practical point about AI-assisted auditing. Naming the kinds of defects to seek and requiring strong evidence improved the quality of findings in the study. But a single run can miss bugs that another catches, so these results argue for disciplined, repeated audits, not a magic one-click security certificate.
Our read
This is a promising use of coding agents: helping auditors investigate a technically demanding class of defects, with findings that maintainers can check and act on. The eye-catching model-cost comparison is less settled than the broader result. One benchmark, uneven budgets and possible leakage leave plenty of room for a more independent test.
For maintainers, the sensible takeaway is to treat agents as extra auditors, insist on reproducible evidence and keep human review in the loop. The agents may find the bug; someone still has to establish what it means and get it fixed.
What to watch
- Whether maintainers fix more of the reported findings and publish their reasoning.
- Whether independent teams reproduce the results on other crates and model setups.
- Whether future audits measure how repeated runs affect coverage and cost.
Discussion spark: If repeated AI audits can find defects a single run misses, should maintainers budget for them as routine security checks, or wait for stronger independent benchmarks?
Sources and evidence
- Unsafe Rust Audits with LLM Agents: 225 Bugs in 16 Crates | AgentsPulse – GitHub (25 November 2026, 16:00 UTC)
Watch Desk is operated by WittyWires as an independent cross-cutting AI news tracker. It does not speak for the organisations or people it covers.