Crustify: Repository-Level Generation of Safe Rust Bindings with LLM Agents and Coverage-Guided Testing
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
Wrapping C code in a safe Rust interface lets Rust applications use it without writing unsafe code, until the code itself is migrated to Rust. Such bindings are tedious and error-prone to write, however: their internals use unsafe code that the Rust compiler does not check, so a single mistake can introduce undefined behavior (UB), and they have so far been written mostly by hand. We present Crustify, an agentic co-translator that generates safe Rust bindings for repository-level C libraries. Crustify schedules a target's types and symbols into dependency-ordered waves of independent batches that agents bind concurrently. Its agents derive the ownership and lifecycle contract of every pointer and type they wrap, check each binding with coverage-guided equivalence and UB tests under sanitizers and Miri, and review every wave. They build on three tools that we contribute: (a) ffibox, Rust primitives for C/Rust interop that mirror Box, Arc, and Vec for C objects without ever forming a reference to memory that C may alias; (b) Wavefront, a neuro-symbolic static analyzer that orders a target's items by their dependencies, including those that casts and type-erased pointers hide; and (c) ffimap, a rustc-based analysis that maps the unsafe surface of bindings. On libgit2 and ffmpeg, with one developer in the loop, Crustify generated safe bindings for 41.9% and 42.8% of their public APIs in about 51.9 and 58.9 hours. On the interface consumers are expected to use, only 1.6% and 0.4% of the bindings' public functions are unsafe, and only 0.1% and 0.6% have a raw pointer in their signature. Their tests cover 98.92% and 99.07% of the Rust code and 45.95% and 67.20% of libgit2 and of ffmpeg's libavutil, and the reviewers fixed 8 and 13 defects that caused UB reachable from Rust. To our knowledge, this is the first work to automate the generation of safe Rust bindings for C libraries.
Key facts. Cited by 1 paper in the map (data through 24 Nov 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 26 of its 66 references that are in the map. Submitted 7 Nov 2026.
Builds on
26 of 66 references.
Closest ancestors · 2
Same direction, newest first
- 2026ReCodeAgent: A Multi-agent Workflow for Language-Agnostic Translation and Validation of Large-Scale Repositories8 Apr
- 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering6 May
Other references · 24
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 9,589
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,765
- 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,559
- 2023Large Language Models Cannot Self-Correct Reasoning Yetcited by 1,170
- 2023Teaching Large Language Models to Self-Debugcited by 1,049
- 2024LLM Evaluators Recognize and Favor Their Own Generationscited by 827
- 2022Decomposed Prompting: A Modular Approach for Solving Complex Taskscited by 585
- 2023Is Self-Repair a Silver Bullet for Code Generation?cited by 222
- 2025Context Length Alone Hurts LLM Performance Despite Perfect Retrievalcited by 154
- 2025The Illusion of Diminishing Returns: Measuring Long Horizon Execution in LLMscited by 85
- 2024CoverUp: Effective High Coverage Test Generation for Pythoncited by 43
- 2024AlphaTrans: A Neuro-Symbolic Compositional Approach for Repository-Level Code Translation and Validationcited by 34
12 more
- 2025C2SaferRust: Transforming C Projects into Safer Rust with NeuroSymbolic Techniquescited by 23
- 2025EvoC2Rust: A Skeleton-guided Framework for Project-Level C-to-Rust Translationcited by 21
- 2023Ownership guided C to Rust translationcited by 15
- 2025RustMap: Towards Project-Scale C-to-Rust Migration via Program Analysis and LLMcited by 14
- 2025SACTOR: LLM-Driven Correct and Idiomatic C to Rust Translation with Static Analysis and FFI-Based Verificationcited by 11
- 2024SmartC2Rust: Iterative, Feedback-Driven C-to-Rust Translation via Large Language Models for Safety and Equivalencecited by 6
- 2025Project-Level C-to-Rust Translation via Pointer Knowledge Graphscited by 6
- 2024A Study of Undefined Behavior Across Foreign Function Boundaries in Rust Librariescited by 4
- 2025LAMeD: LLM-generated Annotations for Memory Leak Detectioncited by 3
- 2025RustAssure: Differential Symbolic Testing for LLM-Transpiled C-to-Rust Codecited by 3
- 2026&inator: Correct, Precise C-to-Rust Interface Translationcited by 2
- 2026Auditing Rust Crates Effectivelycited by 1
Built on by
Citing papers per year: 2026: 1.
1 paper.
- 2026Agentic Discovery of Soundness Bugs in Safe Rust Bindings24 Nov 2026
Similar, not cited
Close in wording, no citation either way
- 2026ORBIT: Guided Agentic Orchestration for Autonomous C-to-Rust Transpilation
- 2026ENCRUST: Encapsulated Substitution and Agentic Refinement on a Live Scaffold for Safe C-to-Rust Translation
- 2026Documentation-Guided Agentic Codebase Migration from C to Rust
- 2026From C to Idiomatic Rust: A Ship-of-Theseus Agentic Translation ↗
- 2026His2Trans: A Knowledge-Guided Agentic Framework for Project-Level C-to-Rust Migration
- 2026Where Does the Performance Go? Understanding and Recovering Performance Regressions in C-to-Rust Translation
- 2026AdaTrans: Automated C to Rust Transformation via Error-Adaptive Repair ↗
- 2026Fine-Tuning Qwen3-27B for C-to-Rust Code Translation: A Three-Stage Curriculum of Pretraining, Debugging-Aware SFT, and Task-Specific SFT