Keep an agent inside your Rust codebase's rules

Judgment callMedium20 minAnthropic style

Your task

Your Rust codebase has 3 hard rules. Every error goes through a custom AppError type built with thiserror, there is no unwrap() outside tests, and every public function has a doc comment.

An agent is about to add a metrics ingestion endpoint, and each of its last 3 PRs needed a cleanup pass for these rules.

How do you keep the agent inside the rules so review is not a cleanup pass? Decide what goes in the prompt and what you enforce elsewhere, and say which kinds of rules an agent reliably follows.

It covers

  • Guardrails
  • Convention adherence