← Lab /AI/ML

LLM agents uncover hundreds of safety bugs in Rust bindings

LLM agents can reliably audit Rust FFI interfaces and discover real undefined-behavior bugs and contract issues

AI/ML arXiv 24 Nov 2026 Measurement Prototype evidence

Published as “Agentic Discovery of Soundness Bugs in Safe Rust Bindings”

Why it matters

LLM agents can cheaply and accurately uncover real soundness bugs in Rust bindings, enabling faster remediation without needing traditional static analysis or fuzzing pipelines.

Summary

CRUSTIFY discovered 225 undefined-behavior bugs across 16 widely used crates (plus additional bugs in the Linux kernel), and maintainers have already fixed 26 of the 83 reported findings. The study shows that LLM agents can reliably find real soundness defects in Rust FFI bindings, but they need explicit guidance to achieve good triage and coverage. Evidence is strong: a blind judge rated only one of 838 findings false, and the open-source auditor matches a closed-source model at a quarter of the cost, though audits are only partly reproducible.

What they found 2

  1. CRUSTIFY discovered 225 undefined-behavior bugs across 16 crates

    “CRUSTIFY found 225 undefined-behavior bugs, 23 behavioral divergences, and 36 incomplete unsafe contracts, between 3 and 61 per crate at a median cost under $50 per audit.”

  2. Maintainers fixed 26 of the 83 reported findings

    “Maintainers have fixed 26 of the 83 findings that we reported.”

Caveats 7

  • Agents find the first two classes unprompted, but find few incomplete contracts even when asked. Their findings are almost always real, even without an independent reviewer, yet they lack triage discipline: they seldom confirm with a sanitizer, and they stop early.
  • Without the triage rules, at most 51% of the findings meet them: the others rest on an argument rather than a run, bundle several root causes, or split one into several findings.
  • Audits are only partly reproducible: of the 51 distinct non-public defects that the study found, 15 were found by a single audit.
  • One crate, no ground truth.
  • The study audits one crate at one revision, and its results on guidance may not transfer to crates of another size or domain, although the audits at scale find defects of the same hazards (Table 8).
  • We developed the prompt in pilot rounds on the same crate, so it may fit git2 better than other crates.
  • Without ground truth, we report what audits find and how much they agree, not recall.

What’s new here 4

  • First systematic measurement of LLM agents as auditors for Rust safe bindings to C/C++ libraries.
  • A taxonomy of defect classes (UB, contracts, equivalence) and triage rules for auditing.
  • Open-source CRUSTIFY system that automates audits without fuzzers or static analyzers, finding hundreds of bugs at low cost.
  • Demonstration that an open-source model can match a closed-source model’s bug-finding ability while spending only 25% of the budget.