Kani is a model checker for Rust, designed to integrate with the standard Rust toolchain [1]. It can be invoked via cargo kani on Cargo 1, making it a convenient tool for developers to check the safety and correctness of their Rust code. Kani uses model checking to analyze Rust programs, which means it will either prove the property, disprove the property with a counterexample, or may run out of resources [2]. The tool uses proof harnesses to analyze programs, similar to test harnesses, especially property-based test harnesses [3].
Kani supports a fair amount of Rust language features, but not all, such as concurrency [4]. As part of every release, Kani synchronizes with a recent nightly release of Rust, ensuring it stays up-to-date with the latest Rust language features [5]. The primary thing Kani checks for is panics, making it a valuable tool for developers to ensure the reliability of their code [6]. To get started with Kani, developers can install the latest version by running the installation guide, and then use it in their CI with the model-checking/kani-github-action [7].
Kani is distributed under the terms of both the MIT license and the Apache License (Version 2.0) [8]. Overall, Kani is a powerful tool for Rust developers to ensure the safety and correctness of their code, and its open-source nature makes it a valuable resource for the Rust community.
Sources
- https://arxiv.org/abs/2607.01504
- https://model-checking.github.io/kani
- https://github.com/model-checking/kani
- https://www.reddit.com/r/rust/comments/1up546z/kani_a_model_checker_for_rust
- https://news.ycombinator.com/item?id=48806410
- https://arxiv.org/html/2607.01504v1
- https://github.com/model-checking/kani-github-action
- https://model-checking.github.io/kani/LICENSE-APACHE


