kani README

The project's README from github.com/model-checking/kani. As one markdown file: README.md.

Kani regression Nightly: CBMC Latest

The Kani Rust Verifier is a bit-precise model checker for Rust.

Kani is useful for checking both safety and correctness of Rust code.

Installation

To install the latest version of Kani (Rust 1.58+; Linux or Mac), run:

cargo install --locked kani-verifier
cargo kani setup

See the installation guide for more details.

How to use Kani

Similar to testing, you write a harness, but with Kani you can check all possible values using kani::any():

use my_crate::{function_under_test, meets_specification};

#[kani::proof]
fn check_my_property() {
   // Create a nondeterministic input
   let input: u8 = kani::any();

   // Call the function under verification
   let output = function_under_test(input);

   // Check that it meets the specification
   assert!(meets_specification(input, output));
}

Kani will try to prove that all valid inputs produce outputs that satisfy the specification, without panicking or exhibiting unexpected behavior. This example is simple; we highly recommend following the tutorial to learn more about how to use Kani.

GitHub Action

Use Kani in your CI with model-checking/kani-github-action@VERSION. See the GitHub Action section in the Kani book for details.

Citing Kani

If you use Kani in your research, please cite our ASE 2026 paper.

ACM Reference Format:

Rémi Delmas, Zyad Hassan, Qinheping Hu, Rahul Kumar, Felipe R. Monteiro, Thanh Nguyen, Adrián Palacios, Celina Val, Michael Tautschnig, Justus Adam, Daniel Schwartz-Narbonne, and Carolyn Zech. 2026. Kani: A Model Checker for Rust. In Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering (ASE '26), October 12–16, 2026, Munich, Germany. ACM, New York, NY, USA, 13 pages. https://doi.org/10.1145/3832783.3834499

BibTeX:

@inproceedings{kani-ase-2026,
  author    = {Delmas, R{\'e}mi and Hassan, Zyad and Hu, Qinheping and Kumar, Rahul and
               Monteiro, Felipe R. and Nguyen, Thanh and Palacios, Adri{\'a}n and
               Val, Celina and Tautschnig, Michael and Adam, Justus and
               Schwartz-Narbonne, Daniel and Zech, Carolyn},
  title     = {{Kani}: A Model Checker for {Rust}},
  year      = {2026},
  publisher = {Association for Computing Machinery},
  address   = {New York, NY, USA},
  url       = {https://doi.org/10.1145/3832783.3834499},
  doi       = {10.1145/3832783.3834499},
  booktitle = {Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering},
  numpages  = {13},
  location  = {Munich, Germany},
  series    = {ASE '26}
}

The same citation is available in machine-readable form in CITATION.cff, which powers GitHub's Cite this repository button.

Security

See SECURITY for more information.

Contributing

If you are interested in contributing to Kani, please take a look at the developer documentation.

License

Kani

Kani is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.

Rust

Kani contains code from the Rust project. Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.

See the Rust repository for details.

kani (model-checking/kani)

Searching Database…

3.5K ·GitHub
What is this?Kani is a bit-precise model checker for Rust programs: instead of sampling inputs like a test suite, it proves that your code is free of certain bugs and undefined behavior.
Is it a library I add to my project, or a separate tool?A separate command-line tool: your program stays as is, you add harness functions that look like tests, and Kani verifies them at development or CI time.
Will it run on Windows?The official install instructions name Linux and Mac only — Windows isn't mentioned in the README, so plan on a Unix-like machine or CI to run it.
Where should I start once it is installed?The README highly recommends the official tutorial as the way to learn Kani, and the Kani book is the full documentation, including a section on the GitHub Action for CI.
Why is Kani particularly useful for unsafe code?The Rust compiler leaves the guarantees behind unsafe blocks unchecked, and Kani automatically checks many kinds of undefined behavior — exactly where those unsafe superpowers go unverified.
Is Kani a research project or a production-ready tool?Both: it ships an official GitHub Action for real CI use, and the team also publishes research on it — academic users are asked to cite the Kani paper from ASE 2026.
What are similar projects?rust-clippy, perch, openqodex, knip, rector, fallow, golangci-lint, bashka
Size
36.8 MB
Stars
3.5K
Age
5y
Commits · 90 Days