Skip to main content

fermut

Agent-first mutation testing for Python — Rust-fast, ty-aware.

Line coverage tells you which lines run. fermut tells you which lines your tests actually check.

CI codecov Mutation (pytest plugin) OpenSSF Scorecard PyPI Downloads Python Docs License: MIT OR Apache-2.0 Rust 1.83+

$ fermut run src/ --tests tests/

SURVIVED  src/auth.py:42@1187 [boundary-shift] `age >= 18` → `age > 18`
TIMEOUT   src/slow.py:88@2304 [arith-op-swap] `n * 2` → `n / 2`

152 mutants — killed: 140, survived: 8, timeout: 1, skipped: 3 (coverage 3), equivalent: 0, errored: 0  | score: 94.6%

Each SURVIVED line is a real gap: a change to your source that your tests didn't notice. fermut makes thousands of these small edits (<= → <, + → -), re-runs your suite against each, and reports the ones that slipped through. In short — it answers "are my tests any good?"

  • ⚡ Fast — native-Rust hot loop, ty pre-filter drops type-invalid mutants before they ever reach pytest, per-test coverage selection runs only the tests that touch each mutant, and mutants run in forks of one pytest that already imported your suite (schemata).
  • 🤖 Agent-first — machine-readable JSON reports, deterministic mutant IDs, next/explain/score subcommands built for a coding agent in the loop.
  • 🔁 Incremental — an unchanged re-run is answered from the cache (pyjwt: ~38s cold, ~0.3s warm, measured together after the benchmark table), and --diff-only scopes mutation to lines changed vs main.
  • 🚦 CI-ready — non-zero exit when any mutant survives (or, with --fail-under, when the score drops below a threshold), wire it straight into a pull-request gate.

Hot loop is native Rust; the test runner stays Python (pytest, the pytest-compatible rstest, or unittest). Built on Astral's ruff_python_parser for mutant generation and ty for type-awareness. Humans welcome too.

Quickstart

# install — pick the path that matches you
uv tool install fermut                                             # prebuilt wheel from PyPI, no Rust needed
cargo install --git https://github.com/KovantAI/fermut --locked    # from source: needs Rust + ~2 min first compile

# in your project (needs pytest, coverage, pytest-cov on the same PATH; ty is embedded — see Installation)
fermut init                     # detect source/tests/runner, write fermut.toml
fermut baseline                 # where you stand: checks the env, builds .coverage,
                                # line coverage vs a sampled mutation score + worst files
fermut run src/ --tests tests/  # full mutation report (add -q to silence progress logs)
fermut next                     # the survivor worth a test first

For a CI gate, generate the opinionated profile instead — diff-only + coverage + a narrow operator set, tuned to fail fast on pull requests:

fermut init --profile pr-gate   # writes a CI-shaped fermut.toml (needs git + .coverage)

It scopes mutation to lines changed vs main, so run it inside a git checkout with that base available — see CI quickstart.

Install paths. Prebuilt wheels ship to PyPI, so uv tool install fermut (or pipx/pip install fermut) is the no-Rust path. The cargo install --git path (Rust required) builds from source — for hacking on fermut or platforms without a prebuilt wheel. Full prerequisites in Installation.

Why fermut

On typer (cold run, same machine, 2026-11-03):

Tool Time Mutation score
fermut 211s 69.2%
mutmut 289s 70.4%

fermut is faster at a similar score here: per-test coverage selection and a fork server that collects the suite once (schemata) cut wall-clock without dropping rigor. The win is suite-shaped: on more-itertools the two tie (~123s vs ~119s), and on a tiny suite like markupsafe mutmut's simpler model still wins (~9s vs ~15s). On the larger suites fermut finishes werkzeug (41k generated mutants, 8k run) in under 3 minutes. Full numbers and methodology: benchmarks.

Documentation

Full documentation lives at https://fermut.readthedocs.io/, sourced from the docs/ directory in this repo.

Start here:

Status

fermut is pre-1.0. The CLI, config schema, and JSON report shape may change between 0.MINOR releases. See VERSIONING.md for the full contract.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.

Metadata

Release files for fermut 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fermut 0.8.1
File Size Uploaded Provenance Actions
fermut-0.8.1.tar.gz 704.5 kB With provenance Details for fermut-0.8.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for fermut 0.8.1
File Actions
fermut-0.8.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for fermut-0.8.1-py3-none-win_amd64.whl
fermut-0.8.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for fermut-0.8.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
fermut-0.8.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for fermut-0.8.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
fermut-0.8.1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for fermut-0.8.1-py3-none-macosx_11_0_arm64.whl
fermut-0.8.1-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for fermut-0.8.1-py3-none-macosx_10_12_x86_64.whl

Total release size: 78.1 MB

Release files / fermut-0.8.1.tar.gz

Download URL fermut-0.8.1.tar.gz
Size 704.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e6028d130cc946286980e7a1f5d1d0af41fb04edd82bea8bc8f71412de3a1931
BLAKE2b-256 checksum
How to use checksums
820f27e88c469a359ea5d3db9e9029a269c816d093799ae8c7ddae863ab55570
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / fermut-0.8.1-py3-none-win_amd64.whl

Download URL fermut-0.8.1-py3-none-win_amd64.whl
Size 16.1 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
bbcb0b2932ecbc84a22e9155c996f8474dc37237fae252fc2ff0e8dfae556f68
BLAKE2b-256 checksum
How to use checksums
146459d828bf5558e8864024f93cf04b5ece3fcd09d523015d9088ad4885c8f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / fermut-0.8.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL fermut-0.8.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 15.9 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
7834a85d1b4c0325c5ef7dff43ff0f88ecff8af408604f808866a5889d9d35f7
BLAKE2b-256 checksum
How to use checksums
15188175c146e8a867e38580c7620f9a6f7b8d294c6a58516dec11baa66ebf9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / fermut-0.8.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL fermut-0.8.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 15.0 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
b8bb1e84762b62077ff4976fa5b9f3ac8140943fdc9a09d5c2bcbaed32821130
BLAKE2b-256 checksum
How to use checksums
e26b8c70bc441be63d20bb5824ee792b566961bc922ca1b296c25e60eaa2dff6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / fermut-0.8.1-py3-none-macosx_11_0_arm64.whl

Download URL fermut-0.8.1-py3-none-macosx_11_0_arm64.whl
Size 14.7 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
dc3b8844372e855031799b6bc8084c36c9817f38bf25bbc2459f1cdb79c59b99
BLAKE2b-256 checksum
How to use checksums
375d24b6f00e29ba02a31eec8fe6281ff914945040bafb3ebee520afa6ba155b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / fermut-0.8.1-py3-none-macosx_10_12_x86_64.whl

Download URL fermut-0.8.1-py3-none-macosx_10_12_x86_64.whl
Size 15.6 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
7749c8ce5e10397c3866d539014073ce0d959ce1e2efb7a0bde6e167fa5f3832
BLAKE2b-256 checksum
How to use checksums
a7ebcf85260d583d1a837ffad2e01b90e67502e3515eca3ebe4a5344e79023af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for fermut 0.8.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for fermut-0.8.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page