harness-writing

Create portable fuzzing harnesses for C/C++, Rust, and Go targets.

Updated Apr 5, 2026
One-click install
npx skills add https://github.com/balic-AI-ML-R-D-Resources/eliza_autonomous_agents --skill harness-writing-balic-ai-ml-r-d-resources
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: harness-writing
Source: https://github.com/balic-AI-ML-R-D-Resources/eliza_autonomous_agents/tree/main/packages/skills/skills/testing-handbook-skills/skills/harness-writing
Command: npx skills add https://github.com/balic-AI-ML-R-D-Resources/eliza_autonomous_agents --skill harness-writing-balic-ai-ml-r-d-resources

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The harness-writing technique helps teams create stable fuzzing harnesses that bridge languages (C/C++, Rust, Go) by providing entrypoint functions, deterministic input handling, and structured data extraction patterns to feed fuzzers like libFuzzer, AFL++, and cargo-fuzz, reducing flaky crashes and improving coverage.

Core Features & Use Cases

  • supports multi-language harness creation for C/C++, Rust, and Go targets
  • demonstrates use of FuzzedDataProvider, determinism, and interleaved fuzzing
  • provides patterns for harness structure, input validation, and resource cleanup

Quick Start

Create a minimal cross-language fuzz harness for your target using libFuzzer or cargo-fuzz

Frequently Asked Questions about harness-writing

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

FAQPage Schema
How do I create a fuzzing harness for a Rust project using cargo-fuzz?

To create a fuzzing harness for a Rust project, you define a fuzz_target entrypoint function using cargo-fuzz, applying deterministic input handling and structured data extraction patterns to feed the fuzzer stable inputs and improve coverage.

What is a FuzzedDataProvider and how does it improve fuzz harness determinism?

A FuzzedDataProvider is a mechanism for structured data extraction from fuzzer inputs. Using it in your fuzz harness ensures deterministic input handling and state reset, which reduces flaky crashes and produces reproducible results across test runs.

Can I use libFuzzer to build a cross-language fuzz harness for C/C++ and Go?

Yes, you can use libFuzzer alongside AFL++ and go-fuzz to build portable, cross-language fuzz harnesses for C/C++, Rust, and Go targets by creating unified entrypoint functions that handle deterministic input and resource cleanup.

Why does my fuzz harness produce flaky crashes during interleaved operation testing?

Flaky crashes during interleaved operation testing often occur due to unreset global state or blocking I/O within the fuzz harness. Enabling deterministic builds, avoiding blocking I/O, and resetting global state between operations resolves these reproducibility issues.

What is the best way to structure input validation in a fuzz harness?

The best way to structure input validation in a fuzz harness is to apply patterns that use FuzzedDataProvider for structured data extraction, ensuring deterministic input handling and proper resource cleanup to maintain reproducible testing states.