rust-review: A Security Review Skill for Rust Codebases

Preface

Rust is being used increasingly in infrastructure and B2B products, but “it compiles” does not mean “it is safe to ship.” Once unsafe, FFI, concurrency, or async runtimes are involved, the borrow checker cannot help if you make a mistake; furthermore, server-side reachable panics can become denial-of-service vectors. Manually scanning crates against a checklist is slow and prone to missing categories. Below is an introduction to rust-review provided by Trail of Bits in the Claude Code / Codex plugin marketplace: it uses an orchestrated multi-subagent approach to perform systematic Rust security reviews and outputs SARIF and human-readable reports.

What is this

rust-review is a Skill under the “Code Auditing” category in the Trail of Bits Skills Marketplace. The official path is:

https://github.com/trailofbits/skills/tree/main/plugins/rust-review/skills/rust-review

In a nutshell: it performs a comprehensive security review of Rust applications, services, or libraries, covering safe/unsafe boundaries, memory safety inside unsafe blocks, concurrency hazards, panic-induced DoS, FFI safety, and async runtime misuse. It is suitable for auditing crates containing unsafe, FFI, or concurrent code. Review results are exchanged as markdown-with-YAML findings in a shared output directory, ultimately generating REPORT.md and REPORT.sarif.

Invoke it via a slash command in the main conversation:

/rust-review:rust-review

The orchestrator manages the Task* ledger and retries; workers and judges are named plugin subagents, and their tool sets are declared in plugins/rust-review/agents/*.md.

Core Functions

Audit Scope (Official When to Use)

  • safe/unsafe boundary audit
  • Memory safety inside unsafe blocks
  • Concurrency hazards
  • Server-side panic-induced DoS
  • FFI safety
  • Async runtime-related errors

Subagent Division of Labor

Subagent Role Toolset (Summary)
rust-review:rust-review-worker Execute assigned clusters, write findings Read, Write, Edit, Bash
rust-review:rust-review-dedup-judge Merge duplicates (runs first) Read, Write, Edit, Glob
rust-review:rust-review-fp-judge False positive filtering, severity rating, and final draft (runs later) Read, Write, Edit, Bash

Workers and fp-judge use find / rg / grep under Bash for path and search operations; when cluster seeds use ripgrep regex syntax, rg must be used (a clear error will occur if it is not installed; you can fall back to grep -E and switch to POSIX character classes). dedup-judge does not have Bash, so it uses Glob.

Execution Architecture (Overview)

The coordinator’s rough flow: write context.md → run build_run_plan.py → create multiple Tasks → spawn primer in the foreground → spawn multiple workers in parallel → categorize Phase-7 results and write findings-index.txt → dedup-judge → fp-judge → safety net generating SARIF and REPORT.md → return REPORT.md.

Common artifacts in the output directory include: context.md, plan.json, worker-prompts/, findings/, findings-index.txt, coverage/, run-summary.md, dedup-summary.md, fp-summary.md, REPORT.md, REPORT.sarif.

Scope conventions (must be distinguished during review):

  • finding_scope_root: The audit subtree specified by the user; vulnerability locations can only be registered within this subtree.
  • context_roots: Read-only context roots, used for verifying reachability, callers, mitigations, etc.; defaults to . unless the user forbids expanding the reading scope.

The plugin root directory needs to be resolved to RUST_REVIEW_PLUGIN_ROOT (containing prompts/clusters/unsafe-boundary.md and scripts/build_run_plan.py); subsequent phases call scripts via ${RUST_REVIEW_PLUGIN_ROOT}/scripts/*.py. build_run_plan.py is the single authority for cluster selection and rendering; hand-written plans should not replace it.

Capabilities Explicitly Not Covered

The official When NOT to Use includes:

  • Pure C / pure C++ codebases → use c-review
  • Smart contracts like Solana / NEAR / Ink! → use the corresponding contract-type Skills
  • Kernel-mode Rust drivers without a user-mode allocator → coverage is incomplete, only provides advisory annotations
  • Secret memory zeroization (Zeroize, secrecy, etc.) → use zeroize-audit; rust-review does not cover memory zeroization audits

Even if has_unsafe=false, always-enabled clusters (such as panic-DoS, atomic race conditions, etc.) should still be run; the memory-safety cluster is included by the planner when has_unsafe=true, and the unsafe-boundary cluster has no requires and always runs.

Installation and Activation

The Skill is installed via the trailofbits/skills marketplace, rather than by separately git cloning a subdirectory.

Claude Code Marketplace:

/plugin marketplace add trailofbits/skills

Browse and install the plugin:

/plugin menu

Codex (supports Claude plugin marketplace compatibility):

codex plugin marketplace add trailofbits/skills
codex plugin list
codex plugin add <plugin-name>@trailofbits

For local development, execute in the parent directory of the repository:

cd /path/to/parent
/plugins marketplace add ./skills

The documentation does not provide specific installation steps for Cursor; if you use similar plugin mechanisms in Cursor, follow the marketplace/plugin documentation for your current environment.

Typical Usage

  1. Install the rust-review plugin in Claude Code or Codex (with the marketplace loaded) (see the previous section).
  2. Open the Rust repository to be audited, clearly specifying the audit subtree (corresponding to finding_scope_root) and whether reading a broader context is allowed (context_roots).
  3. Execute in the main conversation:
   /rust-review:rust-review
  1. Complete context creation, run build_run_plan.py, parallel workers, two rounds of judges, and the Phase 8 report following the Skill flow; view REPORT.md and REPORT.sarif in the output directory, and integrate SARIF into existing SAST/defect tracking pipelines (combined with the SARIF consuming tools your team uses).

The orchestrator’s allowed-tools include: Agent, AskUserQuestion, SendMessage, TaskCreate, TaskUpdate, TaskList, Read, Write, Bash.

Applicable Scenarios and Notes

Suitable for:

  • Auditing Rust crates, services, or libraries, especially code containing unsafe, FFI, concurrency, or async
  • ToB security reviews or internal audits requiring structured output (SARIF + human-readable report)
  • Collaborating with Skills like c-review, zeroize-audit, static-analysis in the same Trail of Bits repository, dividing labor by language and theme

Notes:

  • Do not use “the compiler passed” as a substitute for reviewing unsafe, panic reachability, FFI ABI, concurrency ordering, etc.
  • If any Phase-5 cluster is not completed, do not disguise it as a fully successful report; unfinished items should be highlighted in run-summary.md and the final reply.
  • Even with zero findings, dedup-judge, fp-judge, and Phase 8b must still be run.
  • When spawning workers in parallel, do not use run_in_background=true by default to avoid breaking the primer cache and repeatedly consuming the ~15K token primer.

Conclusion

rust-review turns several categories of risks in Rust that the borrow checker cannot manage (unsafe/FFI, concurrency, panic-DoS, async misuse) into an orchestrable review process that can output SARIF, and has clear boundaries with Skills for pure C review and secret zeroization audits. For official Skill descriptions and plugin structure, see:

https://github.com/trailofbits/skills/tree/main/plugins/rust-review/skills/rust-review

Marketplace installation entry:

https://github.com/trailofbits/skills

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye