An open API service indexing awesome lists of open source software.

https://github.com/kchousos/llm-harness

Automatic LLM-generated fuzzing harnesses for your C/C++ project.
https://github.com/kchousos/llm-harness

c-projects cpp-projects fuzzing harness llm neurosymbolic-ai

Last synced: about 1 year ago
JSON representation

Automatic LLM-generated fuzzing harnesses for your C/C++ project.

Awesome Lists containing this project

README

          

LLM-Harness (TBD)

Use LLMs to automatically generate fuzzing harnesses for your
C/C++ project.

Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.
python GitHub License GitHub Actions Workflow Status Coveralls

code formatter: ruff

type check: mypy

- Collects information of your project structure and files.
- Gives relevant context to LLM.
- Automatically writes generated harness.
- Builds any generated harness and evaluates it.
- Supports OpenAI's models.

# Getting Started

## Installation

### Dependencies

- Python >=3.10
- [uv](https://docs.astral.sh/uv/)

```bash
pipx install uv
```

### Installation Steps

1. Clone the repository:

```bash
git clone https://github.com/kchousos/llm-harness.git
```

2. Install the project:

```bash
uv sync
```

## Usage

1. Add an OpenAI API key in `.env`, such as:

```bash
# cat .env
OPENAI_API_KEY=
```
2. Execute the main script:

```bash
uv run python main.py
```

### Command-Line Options

```
$ python main.py --help
usage: main.py [-h] [-m MODEL] [-f FILES [FILES ...]] project

Generate fuzzing harnesses for C/C++ projects

positional arguments:
project Name of the project under the `assets/` directory, for which harnesses are to be generated.

options:
-h, --help show this help message and exit
-m MODEL, --model MODEL
LLM model to be used. Available: gpt-4.1-mini, o4-mini, o3-mini, gpt-4o, gpt-4o-mini
-f FILES [FILES ...], --files FILES [FILES ...]
File patterns to include in analysis (e.g. *.c *.h)
```