kani

Generate and audit Kani proof harnesses for Rust codebases.

Updated Apr 3, 2026
One-click install
npx skills add https://github.com/strawgate/agent-skills --skill kani
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kani
Source: https://github.com/strawgate/agent-skills/tree/main/kani
Command: npx skills add https://github.com/strawgate/agent-skills --skill kani

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the limitations of traditional testing by providing exhaustive, formal verification for Rust code, ensuring that functions are mathematically proven to be free of panics and logic errors.

Core Features & Use Cases

  • Exhaustive Verification: Uses SAT solvers to check all possible input values rather than relying on random sampling.
  • Compositional Proofs: Supports function contracts and stubbing to verify complex call chains efficiently.
  • Use Case: Use this skill to verify critical cryptographic primitives, state machines, or complex parsing logic where edge cases are difficult to catch with standard unit tests.

Quick Start

Use the kani skill to audit the existing proof harnesses in the current directory and verify the core logic of the target module.

Frequently Asked Questions about kani

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

FAQPage Schema
How does formal verification of Rust code differ from traditional unit testing?

Formal verification uses SAT solvers and bounded model checking to exhaustively evaluate all possible input values, mathematically proving Rust code is free of panics and logic errors, rather than relying on random sampling like traditional unit tests.

How do I generate proof harnesses to verify state machine invariants in Rust?

You generate Kani proof harnesses to target critical logic paths and state machine invariants, executing symbolic execution via the CBMC solver to ensure exhaustive correctness and memory safety properties.

Does Kani support compositional proofs for complex Rust call chains?

Yes, Kani supports compositional proofs by utilizing function contracts and stubbing to verify complex Rust call chains efficiently without evaluating the entire execution path exhaustively.

Do I need the CBMC solver to perform formal verification on Rust codebases?

Yes, you need the Kani verification toolchain integrated with the CBMC solver to execute symbolic execution and bounded model checking for exhaustive mathematical proof generation.

When should I use formal verification instead of standard tests for Rust logic?

Use formal verification for critical cryptographic primitives, state machines, or complex parsing logic where edge cases are difficult to catch with standard unit tests and exhaustive correctness is required.