rust-formal-verification

rust-formal-verification is a skill for Claude Code, Codex from OutlineDriven/odin-claude-plugin. It costs 51 tokens per session (2,195 once invoked), scanned A, original, Apache-2.0.

A formal-verification workflow for Rust code, especially unsafe code and paths where a panic would be serious. It creates and runs Kani, Verus, or Creusot checks against stated properties and reads their counterexamples.

In plain words
What is it for?
Use it to check Rust memory safety, overflow and panic behaviour, or function preconditions and postconditions, and to write the required proof harnesses.
Why use it?
Ordinary tests cover selected examples, while these checks can examine defined conditions under a recorded bound or prove specified conditions with contracts. Failures are tied to a code defect or missing proof.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the odin-formal plugin — 9 skills shipped together

Good fit Use it to check Rust memory safety, overflow and panic behaviour, or function preconditions and postconditions, and to write the required proof harnesses.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/outlinedriven/odin-claude-plugin/rust-formal-verification
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add OutlineDriven/odin-claude-plugin --skill rust-formal-verification
Clone the repo
git clone --depth 1 https://github.com/OutlineDriven/odin-claude-plugin

Made for: Claude Code, Codex.

Or install odin-formal, the plugin that ships this one along with the rest of its 9 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rust-formal-verification

README.md
[![agentmods](https://agentmods.dev/badge/skills/outlinedriven/odin-claude-plugin/rust-formal-verification/github.svg)](https://agentmods.dev/skills/outlinedriven/odin-claude-plugin/rust-formal-verification)
Your own site
<a href="https://agentmods.dev/skills/outlinedriven/odin-claude-plugin/rust-formal-verification"><img src="https://agentmods.dev/badge/skills/outlinedriven/odin-claude-plugin/rust-formal-verification/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rust-formal-verification

Your own site · 80×15
<a href="https://agentmods.dev/skills/outlinedriven/odin-claude-plugin/rust-formal-verification"><img src="https://agentmods.dev/badge/skills/outlinedriven/odin-claude-plugin/rust-formal-verification.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,195 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00051 $0.02195
Opus 5 $0.00026 $0.01097
Sonnet 5 $0.00010 $0.00439
Haiku 4.5 $0.00005 $0.00219

Measured 2d ago against content hash bc27807c29c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

rust-formal-verification scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

The crate, the functions in scope, and the properties: absence of panics and overflow, memory safety of `unsafe` blocks, or functional pre- and postconditions. Tool pins from the grounded set: Kani kani-0.67.0 (`cargo in
plugins/odin-formal/skills/rust-formal-verification/SKILL.md · 38 lines

How it starts

The opening of the file, as written. The whole thing — 38 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Rust formal verification

Contract

Field Bound contract
Trigger A Rust function or module needs bounded model checking (Kani) or deductive verification (Verus, Creusot) against explicit properties, or an existing harness fails and its counterexample must be read.
Authority Reversible local: writes proof harnesses, contract attributes, and spec functions inside the crate, plus a Cargo.toml dev-dependency or feature for the verifier; rollback is reverting those files. No remote mutation.
Side effect Harness and annotation source in the crate, the verifier's build artifacts under target/, and for Kani concrete-playback unit tests when requested.
Done Every named property has a harness or contract that the chosen tool reports as passing under a recorded bound, or a counterexample mapped to a code defect and a fix.

Inputs

The crate, the functions in scope, and the properties: absence of panics and overflow, memory safety of unsafe blocks, or functional pre- and postconditions. Tool pins from the grounded set: Kani kani-0.67.0 (cargo install --locked kani-verifier && cargo kani setup; Kani tracks a pinned Rust nightly, not stable), Verus rolling release release/0.2026.08.30.b432e82 (download the release zip from GitHub Releases and run ./verus, which installs its pinned toolchain through rustup when missing), Creusot v0.13.0 (git clone the repo and run ./INSTALL, which needs cargo, opam, and curl, and installs why3 and why3find provers). Optional: an unwind bound per loop, and a solver choice.

Procedure

  1. Pick the tool by the property. Kani answers "does this code panic, overflow, or violate memory safety for any input up to a bound" and needs no specification language, so it is the default. Verus answers "does this function meet its requires and ensures for all inputs" and needs the code written inside the verus! macro with spec fn and proof fn alongside exec fn. Creusot answers the same question for ordinary Rust with #[requires] and #[ensures] attributes and discharges obligations through Why3. Prusti is a deprioritized fallback: its last release is v-2024-03-26-1504 (2024-03-26), so reach for it only when a codebase already carries Prusti annotations. Done when: one tool is named with the property class that chose it.
  2. Write a Kani harness. Add kani as a conditional import and write, next to the code under test, #[kani::proof] fn check_name() { let x: u32 = kani::any(); kani::assume(x < 1000); let r = f(x); assert!(r <= x); }. kani::any() yields every value of the type; kani::assume narrows the domain and is the harness precondition; assert! is the property. Add #[kani::unwind(N)] on a harness whose code loops, with N large enough that the unwinding assertion passes; Kani then reports whether the bound covers every iteration the inputs allow. Use kani::cover!(cond, "msg") to confirm a branch is reachable, so an assume has not emptied the input space. For a function expected to panic, mark the harness #[kani::should_panic]. Done when: the harness compiles under cargo kani --harness check_name and at least one cover is SATISFIED.
  3. Run Kani and read the result. cargo kani runs every harness; --harness NAME runs one; --default-unwind N sets a global loop bound; --output-format terse shortens the report. The report lists Check N: <harness>.<class>.<n> blocks, each with Status: SUCCESS|FAILURE|UNREACHABLE|UNDETERMINED, a Description, and a Location, then a SUMMARY and the final line VERIFICATION:- SUCCESSFUL or VERIFICATION:- FAILED. A FAILURE whose description is an unwinding assertion means the bound is too small, not that the code is wrong; raise unwind and rerun. A FAILURE on an assertion, overflow, or pointer check at a source location is a defect candidate. Turn it into a test with cargo kani --harness NAME -Z concrete-playback --concrete-playback=print, which prints a Rust unit test with the concrete inputs; inplace writes it next to the harness. Run that test under plain cargo test to confirm the failure is real. Done when: every check is SUCCESS or its failure is reproduced by a concrete test.
  4. Add Kani contracts when the bound does not scale. With -Z function-contracts, annotate the callee with #[kani::requires(...)] and #[kani::ensures(|result| ...)], verify the contract with a #[kani::proof_for_contract(f)] harness, and let callers use #[kani::stub_verified(f)] so their harnesses see the contract instead of the body. With -Z loop-contracts, write #[kani::loop_invariant(cond)] above a loop to replace unwinding with an inductive argument. Done when: the caller's harness passes without an unwind bound on the stubbed callee.
  5. Write and run Verus. Wrap the module in verus! { ... }. Give each exec fn its requires and ensures clauses; write the pure logic as spec fn with int and nat, and give every recursive spec fn a decreases clause. Move helper reasoning into proof fn lemmas and call them from the code. Use assert(P) by { ... } to scope a local sub-proof so only P survives into the context. Run verus file.rs; add --verify-module m or --verify-function f to narrow the run, --expand-errors to have Verus split a failing postcondition into the conjunct that fails, --rlimit N to change the SMT resource limit (default 10), and --time to see where verification time goes. Success prints verification results:: N verified, 0 errors; a failure is a rustc-style error: ... failed with a source span. Exit code is 0 on success and 1 on any verification or compile error. Done when: the module reports zero errors, or the failing conjunct is named by --expand-errors and traced to code or spec.
  6. Write and run Creusot. Annotate with #[requires(...)], #[ensures(...)], loop #[invariant(...)], and #[variant(...)] for termination; #[trusted] skips a body and is a stated assumption, so list every use in the output. Inside Pearlite specs, @ views a Rust value as its mathematical model (x@ for an integer), ^ is the final value of a mutable borrow, and ==> is implication. Run cargo creusot to compile the crate to Coma and run the provers; --only=coma skips proving and --only=prove skips compilation. On an unproved goal, open the Why3 IDE with cargo creusot -i (or --ide-always) and step through the goal to find the missing invariant or lemma. Done when: every goal is proved, or the unproved goal is named with the invariant that is missing.
  7. Record the result. For Kani, write the unwind bound and the solver beside each harness; a pass at unwind(8) is a proof for inputs within that bound, and nothing beyond. For Verus and Creusot, list every #[trusted] body and every assumption the tool admitted without proof; each one is an obligation the reader must accept. Done when: the output names the bound and the trust set for each property.

Read the full file on GitHub · 38 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 38 lines · 51 tokens per session scan A bc27807c29c2

Subscribe to this mod's changes

rust-formal-verification is a skill published in the GitHub repository OutlineDriven/odin-claude-plugin (35 stars, last pushed yesterday), licensed Apache-2.0. It adds 51 tokens to every session and 2,195 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-06.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 tokens