rust-high-assurance

Applies threat modeling, disciplined unsafe, fuzzing, and supply-chain hardening to Rust codebases.

2|Updated May 16, 2026
One-click install
npx skills add https://github.com/avbel/ai-skills --skill rust-high-assurance-avbel
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rust-high-assurance
Source: https://github.com/avbel/ai-skills/tree/main/skills/rust-high-assurance
Command: npx skills add https://github.com/avbel/ai-skills --skill rust-high-assurance-avbel

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Rust's compiler guarantees memory safety for safe code, but it does not prevent logic bugs, authorization flaws, integer overflow in release builds, supply-chain compromise, or unsound unsafe blocks. This Skill provides the assurance layer above "it compiles" for software where security and correctness must be justified with evidence. ## Core Features & Use Cases - Threat Modeling: Guides STRIDE-based threat enumeration, risk ranking (likelihood × severity), and mitigation planning before code is written. - Disciplined Unsafe & Robustness: Enforces #![forbid(unsafe_code)], // SAFETY: comments, fallible APIs with Result/try_reserve, no-panic patterns, and release-mode overflow checks. - Supply-Chain & Dynamic Assurance: Covers cargo-audit scanning, Cargo.lock/rust-toolchain.toml pinning, property-based testing, differential fuzzing with cargo-fuzz, Miri, and formal methods like kani. - Use Case: You are building a security-critical Rust service handling untrusted input. Use this Skill to write a threat model, harden the dependency graph, eliminate hidden panics, and set up fuzzing and model checking for trust-critical functions. ## Quick Start Review my Rust crate for high-assurance issues and produce a threat model plus a hardening checklist covering unsafe code, dependencies, and untrusted input handling.

Frequently Asked Questions about rust-high-assurance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I harden a Rust project for security-critical use?▼

Start with a STRIDE threat model ranking risks by likelihood times severity, then add `#![forbid(unsafe_code)]`, run clippy with `-D warnings`, scan dependencies with cargo-audit, commit Cargo.lock and rust-toolchain.toml, and fuzz all untrusted-input paths.

What does Rust memory safety not protect against?▼

Rust prevents memory-corruption bugs like use-after-free and data races in safe code, but not logic bugs, authorization flaws, integer overflow semantics in release builds, resource exhaustion, supply-chain compromise, side channels, or unsoundness introduced through unsafe and FFI.

How do I handle allocation failure in Rust without panicking?▼

Use the stable fallible allocation methods `Vec::try_reserve`, `try_reserve_exact`, and `HashMap::try_reserve`, which return a Result on allocation failure instead of aborting. For fallible Box or custom allocators, the unstable allocator_api is required.

Does Miri work with FFI or extern C calls in Rust?▼

No, Miri cannot execute FFI or extern calls, so it cannot check unsafe code that crosses the FFI boundary. For FFI-heavy code, use cargo-careful or build with AddressSanitizer and ThreadSanitizer via the nightly -Zsanitizer flag.

When should I use formal verification tools like kani in Rust?▼

Use kani or deductive verifiers like creusot and verus only for trust-critical functions where a defect is unacceptable. Most assurance value comes from the compiler, clippy, tests, and fuzzing; formal methods sit at the top of the rigor ladder.

Why does integer overflow behave differently in Rust release builds?▼

Overflow panics in debug builds but silently wraps in release by default. Set `overflow-checks = true` under `[profile.release]` for high-assurance builds, or use checked_, saturating_, or Wrapping explicitly where wrapping is intended.