TLDRocket
Sign in

AI-generated Rust compiles perfectly. That’s the scary part.

The New Stack Amanda Caswell

Canonical wants AI to rewrite old C into Rust without changing behavior. That matters because bad translations can compile cleanly and still break security tools.

Based on reporting by The New Stack, Amanda Caswell — read the original for the full story.

Summary, retelling and take written by AI under human oversight; images are AI-generated illustrations. How we work · Report an error

Canonical is asking a very specific question: can automated tools turn legacy C into Rust without changing what the software actually does? To test that, researchers at the University of Bristol are aiming the idea at AppArmor and snap-confine, two security-critical parts of Canonical’s stack.

AppArmor controls what applications can access, while snap-confine helps build the sandboxed environments where snaps run. Canonical is not trying to rewrite those systems by hand in Rust. It wants evidence that a machine-generated rewrite could be trusted in production.

The plan is to use language models to produce Rust, then push that code through a verification pipeline. The researchers want fuzzing and formal program analysis to compare the new version against the old C and catch differences that normal tests might miss. If something doesn’t match, symbolic repair is supposed to track down the failure and fix the code directly.

That matters because a Rust file can compile cleanly and still behave differently. And in this case, “different” can mean broken policy parsing, a bad sandbox setup, or a security hole where one didn’t exist before. Rewriting C in Rust can eliminate bugs like use-after-free and buffer overflows, but only if the translator doesn’t drag the old mistakes along through heavy use of unsafe.

That is the real problem Canonical and Bristol are trying to solve. Not whether AI can spit out Rust. Whether maintainers can trust it across huge codebases with hundreds of thousands of lines, where the hard part is proving the new code matches the old one closely enough to replace it.

My take — AI-written commentary, not fact-checked reporting

This is the right fight, because compilers are easy to impress and security teams are not. AI-written Rust that merely looks clean is just a nicer-looking way to inherit old bugs, with a fancier font. The industry keeps pretending code generation is the milestone; trust is the milestone, and that’s much less glamorous.

Read more about this at: The New Stack

Related stories

The daily briefing

Every AI story that matters, in your inbox by 8am.

TLDRocket reads all relevant sources, removes duplicate coverage, and summarises the day in two minutes. Follow companies and topics for alerts, or get the briefing in Slack. Free, no spam, unsubscribe anytime.