Rust and Go with agents: borrow-checker and simplicity traps

Rust and Go punish vague agent optimism differently. Rust via the borrow checker and rich types. Go via simplicity norms and explicit errors.

Published 2026-11-09 · Translation: VI

Rust and Go punish vague agent optimism differently. Rust via the borrow checker and rich types. Go via simplicity norms and explicit errors. Generic “write clean code” prompts produce idiomatic-looking wrong Rust, or over-abstracted Go that fights the standard library. The trap is accepting compile-green diffs that burn review time on unwrap storms and interface soup.

Language addenda, not generic style advice

For Rust: insist agents fix borrow issues properly. Ban clone storms and scattered unwrap() / expect without justification in library code. For Go: simple packages, context threading, errors wrapped with stable messages ops expect. Forbid heavy frameworks into services that were stdlib-simple unless the design gate approved them.

Related: Rules files that agents obey for where language addenda live.

Language-aware definition of done

  1. Attach idiom examples from this repo, not blog posts.
  2. Apply the language addenda in the rules file before coding.
  3. Run clippy/rustfmt or gofmt/go vet/staticcheck as part of done.
  4. Human-review concurrency. Agents invent races and leak goroutines/tasks under time pressure.

Stop when the agent “fixes” lifetimes by cloning everything, introduces panic-driven control flow, or adds interface layers nobody asked for.

Three traps that show up first

Failure modes to catch early

Failure modes to catch early

  • Clone / unwrap storm. Rust compiles by force. Fix: require proper ownership design; justify every panic path.
  • Framework inflation. Go gains a heavy stack where stdlib fit. Fix: design gate before new frameworks.
  • Concurrency fantasy. Races and leaks. Fix: small PRs, explicit review checklist for send/sync, channels, and goroutine lifetimes.

A one-week practice loop

Stop gates before you ship

Stop gates before you ship

This week: add a one-screen Rust or Go addendum with two banned patterns from recent PRs. Next agent session: require clippy/vet evidence in the PR body. If the same unwrap or interface pattern repeats, automate a lint or delete the ambiguous rule.

Bottom line

When this fits vs when it does not

When this fits vs when it does not

Language culture is a constraint, not a vibe. Give agents idiom examples, tooling gates, and concurrency review. For Python’s tooling order, see Python agent tooling; for TypeScript escapes, see TypeScript strict agents.

Share

X Facebook LinkedIn
Educational content only. Rankings reflect stated criteria at the update date—not investment advice or permanent performance guarantees.