Skip to content

docs: add AGENTS.md to help AI agents guide new users building a LibAFL fuzzer - #3907

Open
Aditya30ag wants to merge 1 commit into
AFLplusplus:mainfrom
Aditya30ag:docs/add-agents-md
Open

docs: add AGENTS.md to help AI agents guide new users building a LibAFL fuzzer#3907
Aditya30ag wants to merge 1 commit into
AFLplusplus:mainfrom
Aditya30ag:docs/add-agents-md

Conversation

@Aditya30ag

@Aditya30ag Aditya30ag commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Closes #3896

What

Adds AGENTS.md at the repo root a structured guide for AI coding agents (Claude Code, Cursor, Codex, etc.) to help new users build a LibAFL-based fuzzer without having to browse all 69 examples in fuzzers/ and guess which one fits their target.

Why

Following @domenukk suggestion in #3896 that a good AGENTS.md would be more practical than a dedicated scaffolding tool.

What's in it

  • Decision table mapping target type → correct fuzzers/ example to start from (source-available, binary-only, QEMU, Frida, full-system, grammar-based, etc.)
  • Concrete scaffolding steps (copy example → fix deps → swap harness → wire real coverage → verify it runs)
  • Relevant build/lint commands (just fmt, scripts/clippy.sh, scripts/precommit.sh, no_std check)
  • Explicit section deferring to CONTRIBUTING.md's AI-assistance policy — scoped to helping agents assist downstream users, not to inviting AI-assisted PRs against this repo

What it does NOT do

  • Does not touch CONTRIBUTING.md (zero diff, verified)
  • No new code, dependencies, or workspace members

Checklist

  • I have run ./scripts/precommit.sh and addressed all comments

@Aditya30ag

Copy link
Copy Markdown
Contributor Author

@domenukk is that looks good??

Comment thread AGENTS.md Outdated
- MSRV (minimum supported Rust version): see `rust-version` in the root
`Cargo.toml` and `crates/libafl/Cargo.toml` -- always read it fresh rather
than assuming, it changes over time.
- LLVM tools (clang/clang++, newer than 15.0.0, up to 18.1.3) are required

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's not have a hard coded max here? maybe not even a min, this develops over time...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the version range entirely

Comment thread AGENTS.md Outdated

## Repository layout

- `crates/` -- the actual library. `libafl` is the core; `libafl_bolts` has

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are more creates

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not even list them all

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaced the list with a pointer to crates/README.md

Comment thread AGENTS.md Outdated
`libafl_tinyinst` are instrumentation backends; `libafl_cc` wraps
compilers for source-based instrumentation; `libafl_sugar` is a
simplified high-level API for common cases.
- `fuzzers/` -- ~69 real, working example fuzzers, organized by category

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the count is irrelevant. better have less data than more in here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the count

Comment thread AGENTS.md Outdated

| Target situation | Look in | Concrete starting example |
|---|---|---|
| Source-available, single target function, want to see it work fast | `fuzzers/baby/` | `baby_fuzzer` -- the minimal in-process example |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the baby fuzzers are almost never what fuzzers should be built upon

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed that row from the table

Comment thread AGENTS.md Outdated
| Binary-only, no source access, want AFL++-style forkserver | `fuzzers/forkserver/` | `forkserver_simple` (minimal) or `libafl-fuzz` (fuller afl-fuzz-alike) |
| Binary-only via dynamic instrumentation (no recompilation, incl. closed-source) | `fuzzers/binary_only/` | `frida_libpng` (Frida) or `qemu_launcher` (QEMU user-mode, full-featured multi-core) |
| Full-system / kernel / firmware / bootloader targets | `fuzzers/full_system/` | `qemu_linux_kernel`, `qemu_baremetal`, `nyx_launcher` depending on the system |
| Structured/grammar-based input (not raw bytes) | `fuzzers/structure_aware/` | `baby_fuzzer_gramatron`, `baby_fuzzer_nautilus`, or `baby_fuzzer_tokens` depending on the grammar formalism |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'd be important to note when to use strucutred fuzzzing instead of bytes-only fuzzing (higher level / strucutred targets etc)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added guidance on when byte-level mutation isn't enough

Comment thread AGENTS.md Outdated
checking the dependency features line up).
2. Rename the package in `Cargo.toml`, and point the `libafl`/`libafl_bolts`
(and any backend-specific crate) dependencies at either a local path
(`{ path = "../../crates/libafl" }`, adjusted for the new project's

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usually the path shouldn't be local - usually you want the upstream crates.io version I think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to crates.io by default

Comment thread AGENTS.md Outdated
SanitizerCoverage (source-available) or the appropriate binary-only
backend -- don't leave a fake/manual coverage map in place for a real
target, it will misguide the fuzzer's mutation strategy.
5. Build and run (`cargo build`, `cargo run`), and confirm the corpus and

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually optimal fuzzers should have

  • cmplog / i2s / tracing stage of sorts
  • calibration stage
  • a good corpus of seed input

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added cmplog/i2s, calibration stage, and seed corpus as step 5

Bumps [vergen-git2](https://github.com/rustyhorde/vergen) from 10.0.2 to 10.0.3.
- [Release notes](https://github.com/rustyhorde/vergen/releases)
- [Commits](https://github.com/rustyhorde/vergen/commits)

---
updated-dependencies:
- dependency-name: vergen-git2
  dependency-version: 10.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@Aditya30ag

Copy link
Copy Markdown
Contributor Author

@domenukk, I had addressed the requested changes.
Please have a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: add AGENTS.md for AI agents to help someone build a new LibAFL-based fuzzer

2 participants