# Kani Rust Verifier

> Write test-like proof harnesses for Rust code; Kani checks every input the harness allows, up to loop bounds, and gives a counterexample when a check fails.

- Kind: toolchain
- Verifies: Rust (Checks proof harnesses (functions marked kani::proof); inputs come from kani::any() and are limited by the harness.)
- Effort: Push-button — Run it on your code; little or no annotation.
- Stage: 1 (Usable)
- Trust: Checker partial, Semantics partial, Frontend partial, Binary gap weak, Escape hatches partial
- Licence: open-source, MIT OR Apache-2.0
- Latest release: 0.68.0 (2026-09-16) https://github.com/model-checking/kani/releases/tag/kani-0.68.0
- Links: [homepage](https://model-checking.github.io/kani/), [repo](https://github.com/model-checking/kani), [docs](https://model-checking.github.io/kani/), [paper](https://arxiv.org/abs/2607.01504), [tutorial](https://model-checking.github.io/kani/kani-tutorial.html)

## Use it if
- You want to check unsafe Rust for memory errors, overflow and panics without writing proofs.
- Your code has small or known loop bounds, such as parsers, encoders or data-structure operations.
- You want proofs that run in CI next to your tests.

## Look elsewhere if
- Your code is concurrent or async; Kani treats threads as sequential code and does not support await.
- Your loops have no small bound and you are not ready to write (experimental) loop contracts; the result then only covers runs up to the bound.
- You need to catch violations of Rust's aliasing rules or data races; Kani does not check them.

## How it works (pipeline)

| Step | Component | Assurance | Note |
|---|---|---|---|
| frontend | kani-compiler (rustc-based; translates MIR into a CBMC goto program) | trusted | Uses rustc to compile the code and its dependencies, then Kani's own code generator turns the MIR into CBMC's input format. Features it cannot translate become a failing check if reached. |
| translation | CBMC loop unwinding and symbolic execution to a SAT formula (`cbmc`) | trusted |  |
| checker | SAT solver (CaDiCaL by default; MiniSat, Kissat, Z3, Bitwuzla or cvc5 selectable) | trusted | The default may change between Kani versions. |
| compiler | rustc / LLVM | trusted |  |

## Trust

| Axis | Level | Summary | Note |
|---|---|---|---|
| Checker | Partial (amber) | CBMC and a SAT solver decide; no proof certificate. A proof only if unwinding checks pass. | A harness result is a proof for every input the harness allows only when all unwinding assertions pass (they are on by default). If a bound is too small Kani reports an unwinding-assertion failure and marks other checks UNDETERMINED. Unsupported features become failing checks when reached, but concurrent code is treated as sequential with only a warning, and the unstable --restrict-vtable flag is a known soundness issue. [source](https://model-checking.github.io/kani/soundness.html) |
| Semantics | Partial (amber) | Rust model built into Kani's code generator; tested by its own regression suite. | Kani documents which kinds of undefined behavior it does not model, such as aliasing rules and data races. [source](https://model-checking.github.io/kani/undefined-behaviour.html) |
| Frontend | Partial (amber) | rustc compiles the code; Kani's own unverified code generator translates MIR for CBMC. |  [source](https://arxiv.org/abs/2607.01504) |
| Binary gap | Weak (red) | The binary comes from rustc and LLVM, which are not verified. |  |
| Escape hatches | Partial (amber) | kani::assume, stubs and contracts can hide bugs; some vacuous checks show as UNREACHABLE. | Kani reports a check as UNREACHABLE for some assertion kinds when no execution reaches it, and kani::cover can test reachability. Over-constraining assumptions are otherwise found by reading the harness. [source](https://model-checking.github.io/kani/verification-results.html) |

## What it can prove

| Property | Support |
|---|---|
| No undefined behavior | Partial — Checks by default: arithmetic overflow, division by zero, invalid pointer dereference, out-of-bounds indexing, panics, bad shifts and memory leaks. Not checked: data races, Rust's aliasing rules (Stacked or Tree Borrows), mutation of immutable data, inline assembly. Invalid values and uninitialized memory are checked only with unstable flags. ([source](https://model-checking.github.io/kani/soundness.html)) |
| Functional correctness | Partial — Assertions in a harness are checked for every input the harness allows, but only up to the loop bounds unless the (experimental) function or loop contracts are used. ([source](https://model-checking.github.io/kani/reference/experimental/loop-contracts.html)) |
| Equivalence | Partial — No dedicated mode; you write a harness that runs two implementations on the same symbolic inputs and asserts equal results, within the loop bounds. ([source](https://model-checking.github.io/kani/tutorial-kinds-of-failure.html)) |
| Information flow | Not supported — No information-flow or constant-time checking. |
| Concurrency | Not supported — Concurrent code is out of scope; Kani emits a warning and compiles it as if it were sequential. ([source](https://model-checking.github.io/kani/rust-feature-support.html)) |
| Termination and liveness | Partial — Passing unwinding checks show that every loop finishes within the bound for the harness's inputs. There are no general termination proofs. ([source](https://model-checking.github.io/kani/tutorial-loop-unwinding.html)) |

## Common features

| Feature | Support |
|---|---|
| Machine integers | Supported — Bit-precise machine integers with overflow checks. ([source](https://model-checking.github.io/kani/soundness.html)) |
| Floating point | Supported — Bit-precise IEEE 754 arithmetic. sin, cos and sqrt are over-approximated, which is sound but can report errors that cannot happen. ([source](https://model-checking.github.io/kani/rust-feature-support.html)) |
| Heap and pointers | Supported — Box, Rc and Arc are supported; null, dangling and out-of-bounds pointers are checked. ([source](https://model-checking.github.io/kani/rust-feature-support.html)) |
| Arrays and buffers | Supported ([source](https://model-checking.github.io/kani/rust-feature-support.html)) |
| Loops | Partial — Loops are unrolled up to a bound. Unwinding assertions fail if the bound is too small, so a passing run covers every execution of the harness. Without a bound Kani may not finish. Loop contracts (experimental) give unbounded proofs. ([source](https://model-checking.github.io/kani/tutorial-loop-unwinding.html)) |
| Recursion | Partial — Recursion is unrolled up to the bound like loops; function contracts (experimental) can replace recursive calls. ([source](https://model-checking.github.io/kani/reference/experimental/contracts.html)) |
| Higher-order code | Partial — Closures and function pointer types are listed as partially supported. Unresolved function pointers are treated as a call to any function with a matching signature. ([source](https://model-checking.github.io/kani/rust-feature-support.html)) |
| Threads and shared memory | Not supported — Concurrent code is compiled as sequential code with a warning; data races are not detected. ([source](https://model-checking.github.io/kani/rust-feature-support.html)) |
| I/O and system calls | Unknown — Kani replaces print macros with its own versions; support for file, network and other system calls is not documented. ([source](https://model-checking.github.io/kani/overrides.html)) |
| Standard library | Supported — The real standard library is compiled into the model, except a few functions Kani replaces with its own models, which are then trusted. ([source](https://model-checking.github.io/kani/soundness.html)) |

## Rust-specific features

| Feature | Support |
|---|---|
| References and borrowing | Supported — References are handled like any other code, but Rust's aliasing rules are not checked. ([source](https://model-checking.github.io/kani/undefined-behaviour.html)) |
| Traits and generics | Supported — Traits and implementations are listed as supported; type parameters as partial. ([source](https://model-checking.github.io/kani/rust-feature-support.html)) |
| Closures | Partial — Closure types are listed as partially supported. ([source](https://model-checking.github.io/kani/rust-feature-support.html)) |
| unsafe and raw pointers | Partial — Raw pointer dereferences are checked, but aliasing violations and invalid values are not by default, and inline assembly is not supported. ([source](https://model-checking.github.io/kani/soundness.html)) |
| Interior mutability | Partial — Interior mutability is listed as supported, but UnsafeCell, which it is built on, is listed as partial. ([source](https://model-checking.github.io/kani/rust-feature-support.html)) |
| Trait objects | Partial — Trait object types are listed as partially supported. ([source](https://model-checking.github.io/kani/rust-feature-support.html)) |
| Iterators | Supported — Iterator code is compiled like any other code; loops over iterators still need unwinding bounds. ([source](https://model-checking.github.io/kani/rust-feature-support.html)) |
| Panics | Supported — All panic paths are checked. Stack unwinding after a panic is not modeled. ([source](https://model-checking.github.io/kani/rust-feature-support.html)) |
| async / await | Not supported — await expressions are listed as not supported. ([source](https://model-checking.github.io/kani/rust-feature-support.html)) |

## Stage

**Stage 1: Usable.**

| Stage | Criterion | Met | Evidence / note |
|---|---|---|---|
| 0 | Publicly available | yes | [evidence](https://github.com/model-checking/kani) |
| 0 | At least one published verification uses it | yes | [evidence](https://arxiv.org/abs/2607.01504) Kani: A Model Checker for Rust (ASE 2026 industry track), with industrial case studies. |
| 1 | Released or updated in the last 12 months | yes | [evidence](https://github.com/model-checking/kani/releases/tag/kani-0.68.0) Latest release: 0.68.0, 2026-09-16. |
| 1 | Installs and runs on current platforms | yes | [evidence](https://github.com/model-checking/kani/releases/tag/kani-0.68.0) Release binaries for Linux and macOS (x86-64 and Arm). |
| 1 | User documentation or tutorial | yes | [evidence](https://model-checking.github.io/kani/) |
| 1 | Used by a group other than its authors | yes | [evidence](https://github.com/google/zerocopy/blob/main/zerocopy/README.md) Google's zerocopy crate applies Kani to prove parts of its implementation. |
| 2 | Verified code in production at two or more independent organizations | no | 1 recorded: Amazon Web Services. |
| 2 | Checker axis is not red | yes |  |
| 2 | Semantics axis is not red | yes |  |
| 2 | Public channel for soundness bugs | yes | [evidence](https://github.com/model-checking/kani/issues?q=label%3A%22%5BF%5D+Soundness%22) Public GitHub issues with a "[F] Soundness" label. |

Missing for Stage 2: Verified code in production at two or more independent organizations.

## In production
- Amazon Web Services: Firecracker's I/O rate limiter and VirtIO transport checked with Kani harnesses in CI; Firecracker runs AWS Lambda and AWS Fargate. ([source](https://model-checking.github.io/kani-verifier-blog/2023/08/31/using-kani-to-validate-security-boundaries-in-aws-firecracker.html))

## Projects
- [Firecracker rate limiter and VirtIO transport](https://model-checking.github.io/kani-verifier-blog/2023/08/31/using-kani-to-validate-security-boundaries-in-aws-firecracker.html)
- [Rust standard library verification campaign](https://arxiv.org/abs/2607.01504) — The paper reports over 16000 harnesses checked on every change.
- [Google zerocopy](https://github.com/google/zerocopy/blob/main/zerocopy/README.md)

## Sources
- [Kani soundness guarantees and limitations](https://model-checking.github.io/kani/soundness.html)
- [Kani Rust feature support](https://model-checking.github.io/kani/rust-feature-support.html)
- [Kani verification results](https://model-checking.github.io/kani/verification-results.html)
- [Loops, unwinding, and bounds](https://model-checking.github.io/kani/tutorial-loop-unwinding.html)
- [Kani attributes (solver choice)](https://model-checking.github.io/kani/reference/attributes.html)
- [Kani: A Model Checker for Rust (arXiv, 2026)](https://arxiv.org/abs/2607.01504)

---
Last checked 2026-11-26. Data: [JSON](/toolchains/kani.json) · Page: [HTML](/toolchains/kani/) · Methodology v0.1: [/methodology/](/methodology/) · Corrections: [/contribute/](/contribute/)
