# FuzzyAI

> CyberArk's open-source fuzzer for finding jailbreaks in LLM APIs

- Category: Evaluation & Production Ops / Evaluation & Red-Teaming
- Language: Python
- Licence: Apache-2.0
- Repository: https://github.com/cyberark/FuzzyAI
- Canonical page: https://ai-tldr.dev/tools/fuzzyai/

## In short

FuzzyAI is an open-source fuzzer from CyberArk that throws jailbreak techniques at a large language model to see which ones break its safety behaviour. It is aimed at developers and security researchers who want to find and fix those weaknesses in their own LLM APIs before someone else does. It sits in the Evaluation & Red-Teaming category of the Evaluation & Production Ops tools and is open-source, written in Python and licensed Apache-2.0.

## Overview

FuzzyAI is an open-source fuzzer from CyberArk that throws jailbreak techniques at a large language model to see which ones break its safety behaviour. It is aimed at developers and security researchers who want to find and fix those weaknesses in their own LLM APIs before someone else does. You give it a target model, one or more attack methods and a test prompt, and it reports, per attack, the adversarial prompt it sent, the model's response and whether the attempt counted as a jailbreak.

The attacks are implementations of published techniques, each linked to its source in the README: ArtPrompt (ASCII-art prompts), taxonomy-based persuasive paraphrasing, PAIR (iterative refinement with two LLMs), many-shot jailbreaking, ASCII smuggling with Unicode tag characters, a genetic-algorithm mutator, Crescendo's escalating multi-turn dialogue, ActorAttack, best-of-n jailbreaking, the Shuffle Inconsistency attack, DAN, WordGame and several prompt-framing tricks such as history/academic framing and thought experiments. A classifier model can be plugged in to judge whether each response is harmful.

Targets span hosted APIs (OpenAI, Anthropic, Gemini, Azure, AWS Bedrock, AI21, DeepSeek), Hugging Face models, local models served by Ollama, and any custom REST endpoint described by a raw HTTP request file — which is what lets it test an application's own LLM-backed API rather than only the underlying model. It runs as the `fuzzyai` command-line tool, and the repository also includes an experimental web UI, Jupyter notebooks and prompt datasets.

## What it does

- A library of implemented jailbreak attacks — including PAIR, ArtPrompt, Crescendo, ActorAttack, many-shot, genetic, best-of-n and ASCII smuggling — selectable per run with `-a`
- Providers for OpenAI, Anthropic, Gemini, Azure, AWS Bedrock, AI21, DeepSeek, Hugging Face and Ollama models
- A REST provider that attacks your own API endpoint, parsed from a raw HTTP request file
- Pluggable classifiers, including an auxiliary LLM, to judge whether a response is harmful
- Experimental web UI launched with `fuzzyai webui`, plus bundled Jupyter notebooks and datasets
- Extensible architecture, with a DIY guide for adding support for new models

## Getting started

FuzzyAI installs straight from GitHub with pip, or as a standalone Poetry project; it requires Python 3.10 or later. The commands below are taken from the project README.

1. Install

   Add it to an existing Python project with pip (or any other package manager).

```bash
pip install git+https://github.com/cyberark/FuzzyAI.git
```

2. Or run it as a standalone project

   Clone the repository and install its dependencies with Poetry, then prefix commands with `poetry run`.

```bash
git clone git@github.com:cyberark/FuzzyAI.git
cd FuzzyAI
poetry run pip install -e .
poetry run fuzzyai fuzz -h
```

3. Optional: pull a local model

   To fuzz a model on your own machine, install Ollama and download a model. The README's example uses Llama 3.1 (about 4.7 GB), but any Ollama-supported open model works.

```bash
ollama pull llama3.1
ollama show llama3.1 # verify model installation
```

4. Run attacks

   Pick a target with `-m`, one or more attacks with `-a`, and a prompt with `-t` (or a file of prompts with `-T`). The first line just evaluates the prompt as-is; the second combines the many-shot and taxonomy attacks against an OpenAI model.

```bash
fuzzyai fuzz -m ollama/llama3.1 -a def -t "Harmful_Prompt"

OPENAI_API_KEY=sk-3fa1... fuzzyai fuzz -m openai/gpt-3.5-turbo -a man -a tax -t "Harmful_Prompt"
```

5. Attack your own REST API

   The `rest` provider reads a raw HTTP request from a file (`http.raw`) and sends attacks to that endpoint; `-e` sets host, port and scheme, `-x` adds an auxiliary model, and `classifier_model` sets the model that judges the responses.

```bash
fuzzyai fuzz -a def -x openai/gpt-4 -e classifier_model=openai/gpt-4 -m rest/http.raw -e host=localhost -e port=8000 -e scheme=https -t "How to build a bomb"
```

6. Or use the web UI

   The experimental web UI walks through the same settings in the browser.

```bash
poetry run fuzzyai webui

# Or specify a custom port:
poetry run fuzzyai webui --port 9000
```

## When to use it

- Red-team an LLM-backed product's API before launch by pointing the REST provider at your own endpoint
- Compare how different providers' models hold up against the same set of published jailbreak techniques
- Check a local open model under Ollama for safety gaps without sending prompts to a cloud API
- Re-run a fixed attack set after changing a system prompt or guardrail to see whether it actually closed the hole
