atheris

Fuzz pure Python code and Python C extensions using coverage-guided libFuzzer-based testing.

Updated Apr 5, 2026
One-click install
npx skills add https://github.com/marumo333/atrox --skill atheris-marumo333
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: atheris
Source: https://github.com/marumo333/atrox/tree/main/.claude/skills/trailofbits/plugins/testing-handbook-skills/skills/atheris
Command: npx skills add https://github.com/marumo333/atrox --skill atheris-marumo333

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires atheris.

What problem does it solve? Finding crashes, memory corruption, and unexpected exceptions in Python code and Python C extensions requires systematic input generation that manual testing cannot provide. This Skill guides you through setting up Atheris, a coverage-guided fuzzer based on libFuzzer, to automatically discover bugs in Python targets. ## Core Features & Use Cases - Pure Python Fuzzing: Instrument Python functions and imports with atheris.instrument_func and atheris.instrument_imports() for coverage-guided fuzzing. - C Extension Fuzzing: Compile native extensions with clang sanitizer flags and AddressSanitizer integration to detect memory corruption, with a ready-to-use Dockerfile. - Corpus & Campaign Management: Create seed corpora, minimize them with libFuzzer merge, and run parallel fuzzing campaigns with workers and time limits. - Use Case: Fuzz the cbor2 C extension by compiling it from source with sanitizer flags, writing a harness around loads(), and running the fuzzer to surface memory safety bugs. ## Quick Start Write an Atheris fuzzing harness for my Python parser function and show me how to run it with a seed corpus.

Frequently Asked Questions about atheris

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

FAQPage Schema
How do I fuzz Python code with Atheris?▼

Write a harness defining a test_one_input(data) function, decorate it with @atheris.instrument_func, then call atheris.Setup(sys.argv, test_one_input) and atheris.Fuzz(). Run the script with python fuzz.py, optionally passing a corpus directory.

Atheris vs Hypothesis for Python testing?▼

Atheris is a coverage-guided fuzzer best for fuzzing pure Python code and C extensions with byte-level inputs. Hypothesis is a property-based testing library with type-aware generation, better suited for verifying function properties rather than raw fuzzing.

How do I fuzz Python C extensions with AddressSanitizer?▼

Compile the extension from source with clang using CFLAGS="-fsanitize=address,fuzzer-no-link" and the --no-binary pip flag. Set LD_PRELOAD to the asan_with_fuzzer.so library shipped with Atheris, then run your harness normally.

Does Atheris work on Windows?▼

Atheris supports 32-bit and 64-bit Linux and macOS only; Windows is not supported. Linux is recommended because it is simpler to manage and often faster, and a Docker setup is provided for a configured environment.

Why is my Atheris fuzzing not increasing coverage?▼

Stalled coverage usually means a poor seed corpus or uninstrumented target code. Add better seed inputs to the corpus directory and verify your imports happen inside an atheris.instrument_imports() context before atheris.Setup() is called.

Why do I get a segfault without AddressSanitizer output?▼

A segfault without ASan diagnostics means LD_PRELOAD is not set. Export LD_PRELOAD pointing to the asan_with_fuzzer.so file inside the atheris package directory so the sanitizer runtime loads before the fuzzer starts.