What agents mean for Rust (and vice versa)
TL;DR Highlight
Rust's designer argues agent coding calls for stronger types and proofs, not less language design.
Who Should Read
A backend developer using AI agents to write code who is deciding which language and guardrails to rely on.
Core Mechanics
- Rust popularity is surging in the agent era
- The author quotes David Tolnay.
- Meta engineers wrote twice as much first-party Rust this year as in the previous 9 years combined.
- Agents are good at performance tuning
- The author says crypto developers who hand-tuned assembly now use agents for that work.
- With a profiler like dial9, agents reportedly diagnose async pitfalls like long polls and blocking.
- Tests alone can't keep agents in check
- The author's first few tests look fine, then the agent turns out to have missed the logic entirely.
- A type system acts as a guardrail against certain kinds of mistakes.
- After types, you need proofs
- Types prevent wrong things but don't show the right thing is done.
- Rust proof tools like Verus, Creusot, Aeneas and Kani can check richer properties.
- Types make proofs easier
- The Java assert this.foo == bar can't be proven because other threads may mutate this.
- In Rust, &mut self guarantees a unique reference, so the same assert holds.
- Verus trusts the borrow checker, which simplifies the SMT solver's job.
- The north star: no more unsafe code
- This doesn't mean removing the unsafe keyword.
- It means being able to prove your unsafe code can't cause undefined behavior.
- Design is still an open problem
- Today's state of the art is 'markdown-driven-development'.
- Alternatives include separating interface from implementation for review, and modeling languages for high-level design.
Community Reactions
- Compile time is Rust's weakness, some say
- One commenter expects a language or Rust redesign with fast compilation in the LLM era.
- Another reports the target/ folder grows huge with agents and disk space runs out.
- Agents write Verus proofs well, per one commenter
- A commenter had agents write Verus proofs in a Rust codebase and found it worked well.
- The proofs reportedly had minimal effect on the normal compile path.
- A list of LLM-friendly language traits
- A commenter listed useful compile errors, fast compilation, explicit types and one preferred way to do things.
- They also suggested pre/post-conditions and mandatory tests.
- Pushback: little evidence Rust is special
- One commenter researched and found no strong correlation between language features and agent coding success.
- Apart from popularity, even types showed no clear correlation.
- Another commenter simply dislikes agentic coding.
How to Apply
- Run a profile-driven tuning loop with an agent
- Today, run a benchmark on a Rust service and capture the profile.
- Give the output to an agent and ask for bottleneck causes and a fix as a PR.
- Strengthen guardrails with types
- Wrap values agents often confuse (IDs, units) in newtypes.
- Instruct the agent to change code only within what still compiles.
- Try Verus proofs on a core function
- Start by having the agent prove the function is panic-free.
- Then add assertions confirming the expected result.
- Review interface changes separately
- In agent PRs, check public signature changes first.
- Read the implementation diff afterward.
Try It
# Paste into Claude Code or ChatGPT (simplified version of the article's idea: profile-driven tuning loop)
You are a Rust performance tuning agent. Analyze the profile results below.
{{profile results or benchmark output}}
Rules:
1. Name up to 3 bottleneck candidates with evidence.
2. Propose a code fix for each.
3. Behavior must not change. Existing tests must pass.
4. Reduce unnecessary clone() calls, but keep the code's intent readable.
Next step: after the fix, rerun the same benchmark, paste the results, and ask for a comparison.Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques