kani-verifier

Automate Rust verification with Kani to prove memory safety across all inputs.

Updated Jan 25, 2026
One-click install
npx skills add https://github.com/patrykgz/rust-devagent-loop-template --skill kani-verifier
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kani-verifier
Source: https://github.com/patrykgz/rust-devagent-loop-template/tree/main/.claude/skills/kani-verifier
Command: npx skills add https://github.com/patrykgz/rust-devagent-loop-template --skill kani-verifier

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Rust applications need strong guarantees about memory safety and absence of undefined behavior that go beyond conventional testing. Kani provides automated, exhaustive verification for Rust code, surfacing issues early and offering mathematical assurances.

Core Features & Use Cases

  • Proof harnesses using #[kani::proof] to verify properties for all inputs
  • Automatic checks for memory safety, arithmetic overflows, and panics, with loop unwinding and contract support
  • Modular verification through contracts, stubs, and reusable verification patterns

Quick Start

Create a Kani proof harness for a Rust function to verify memory safety and correctness across all inputs.

Frequently Asked Questions about kani-verifier

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

FAQPage Schema
How do I formally verify Rust code to prove memory safety?

You prove memory safety in Rust using Kani by automating rigorous verification with symbolic inputs and assertions. This targets specific functions to provide mathematical guarantees against undefined behavior across all possible inputs.

What is a Kani proof harness and how does it work?

A Kani proof harness uses the #[kani::proof] attribute to verify code properties for all inputs. It applies symbolic inputs and assertions to automatically check for memory safety, arithmetic overflows, and panics.

Can I use contract-based verification and loop unwinding for Rust modules?

Yes, Kani supports contract-based verification, loop unwinding, and stubs for modular verification in Rust. This allows isolating modules and applying reusable verification patterns to achieve formal guarantees.

Does Kani support automatic checks for arithmetic overflows and panics?

Yes, Kani automatically checks for arithmetic overflows and panics during verification. It performs these checks alongside memory safety validation using loop unwinding and contract support across all inputs.

When do I need formal verification instead of conventional testing for Rust?

You need formal verification when Rust applications require mathematical guarantees about memory safety beyond conventional testing. Kani provides exhaustive verification to surface issues early and prove the absence of undefined behavior.