# Agentic Discovery of Soundness Bugs in Safe Rust Bindings

arXiv: https://arxiv.org/abs/2611.31813 · HTML: https://mlsanity.com/paper/2611.31813/

## Key facts

- No citing papers in the map yet (data through 24 Nov 2026).
- Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use.
- Builds on 15 of its 61 references that are in the map.
- Submitted 24 Nov 2026, announced 25 Nov 2026.

## Placed in

- LLM agents and tool use / [Software engineering coding agents](https://mlsanity.com/agents/software-engineering-coding-agents/)

## Builds on (most cited first, 15 of 15)

- [ReAct: Synergizing Reasoning and Acting in Language Models](https://mlsanity.com/paper/2210.03629/) (2022)
- [Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena](https://mlsanity.com/paper/2306.05685/) (2023)
- [SoK: DARPA's AI Cyber Challenge (AIxCC): Competition Design, Architectures, and Lessons Learned](https://mlsanity.com/paper/2602.07666/) (2026)
- [RULF: Rust Library Fuzzing via API Dependency Graph Traversal](https://mlsanity.com/paper/2104.12064/) (2021)
- [SafeDrop: Detecting Memory Deallocation Bugs of Rust Programs via Static Data-Flow Analysis](https://mlsanity.com/paper/2103.15420/) (2021)
- [A Study of Undefined Behavior Across Foreign Function Boundaries in Rust Libraries](https://mlsanity.com/paper/2404.11671/) (2024)
- [Revelio: Cost-Efficient Agentic Memory Safety Vulnerability Detection For Repository-Scale Codebases](https://mlsanity.com/paper/2606.22263/) (2026)
- [Yuga: Automatically Detecting Lifetime Annotation Bugs in the Rust Language](https://mlsanity.com/paper/2310.08507/) (2023)
- [Fuzz Driver Synthesis for Rust Generic APIs](https://mlsanity.com/paper/2312.10676/) (2023)
- [TYPEPULSE: Detecting Type Confusion Bugs in Rust Programs](https://mlsanity.com/paper/2502.03271/) (2025)
- [deepSURF: Detecting Memory Safety Vulnerabilities in Rust Through Fuzzing LLM-Augmented Harnesses](https://mlsanity.com/paper/2506.15648/) (2025)
- [Kani: A Model Checker for Rust](https://mlsanity.com/paper/2607.01504/) (2026)
- [Generics-Aware Fuzz Target Generation for Rust Libraries via Structured API Analysis](https://mlsanity.com/paper/2608.08637/) (2026)
- [UnsafeChecker: Finding Soundness Bugs in Rust Safe Abstractions](https://mlsanity.com/paper/2609.09641/) (2026)
- [Crustify: Repository-Level Generation of Safe Rust Bindings with LLM Agents and Coverage-Guided Testing](https://mlsanity.com/paper/2611.10394/) (2026)

## Abstract (arXiv)

Rust crates confine unsafe code, such as calls into C or C++ libraries or system calls, behind safe interfaces that must uphold Rust's invariants. If an interface encodes one rule of the code beneath it too weakly, a program written in purely safe Rust can cause undefined behavior. Static analyzers and fuzzers are bound to fixed patterns or to the paths they execute. We propose LLM agents as auditors of these interfaces, and study how well they do it. We first define a taxonomy of the defects of such interfaces, including undefined behavior, divergences from the wrapped library, and incomplete unsafe contracts. We then measure, in repeated audits of a real-world crate by a closed and an open model, Claude Opus 5.5 and DeepSeek V4.1 Flash, which defect classes agents find, how well they triage them, and what makes them find more. 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. With the same guidance, the open model finds as many defects as the closed one at a quarter of the cost. We integrate these insights in Crustify, an agentic system for automating C-to-Rust tasks, and run it at scale. In 16 widely used crates, including the bindings to the C libraries OpenSSL, SQLite, libgit2, and libcurl and to the C++ engine V8, 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. In the Linux kernel's Rust abstractions, it found 11 more undefined-behavior bugs and 4 incomplete contracts. Maintainers have fixed 26 of the 83 findings that we reported.
