The Rust programming language provides stronger guarantees about memory safety than C. Therefore, translating to the Rust programming language is one way to reduce security vulnerabilities. One common translation strategy is using LLM queries. We present an alternate agentic approach that gives an LLM freedom and guardrails.
When programming in C, a programmer must manually manage memory and other resources, such as by calling free after each call to malloc or by calling fclose after each call to fopen. It is easy to violate these rules, leading to memory corruption, resource exhaustion, and security vulnerabilities. This is a serious problem, because much of the world’s critical software infrastructure is written in C.Rust prevent many errors via compile-time analyses, such as for type-checking and ownership. Rust programs do not suffer slowdowns from the run-time system, such as garbage collection, making it a promising replacement for C. There is a growing movement to replace software written in C by safer versions written in Rust. To date, that replacement has required manual rewrites, a time-consuming and costly approach that does not scale. An alternate approach is to automatically translate C to Rust.The best-known translator is the C2Rust transpiler(https://tools.galois.com/c2rust). It converts C line-by-line into unsafe Rust code, after which an expert team must fix up the unsafe Rust code, converting it tosafe, idiomatic Rust. Many researchers are working to automate the fix up step, typically using LLMs. Another popular approach is to convert one C function at a time, which is more likely to produce good-quality Rust code. [Hong and Ryu (2025)], [Shiraishi et al.(2026)] These systems fix the signature (parameter and return types) of each function, prompt an LLM to translate each function, then assemble the result into a Rust program. This article proposes a different approach: agentic translation of the entire program. Our experiments show that it outperforms other approaches.
Research areas