
RedOxide is a high-performance, modular, and extensible LLM Red Teaming tool written in Rust. It is designed to evaluate the safety and robustness of Large Language Models (LLMs) by simulating various adversarial attacks.
Note
redoxide crate is available from crates.io.redoxide documentation is available on docs.rs.redoxide readme on GitHub pages.RedOxide mimics the architecture of professional security tools but remains lightweight and completely open-source. It supports:
tokio streams to run parallel attacks for high throughput.Red Teaming in the context of AI involves actively attempting to “break” or bypass the safety filters of an LLM. The goal is to elicit harmful, unethical, or illegal responses (e.g., bomb-making instructions, hate speech) to identify vulnerabilities before bad actors do.
Popular References:
RedOxide provides a Rust-native alternative that focuses on speed and developer extensibility.
The codebase is organized as a library with a CLI wrapper, enabling you to use it as a standalone tool or import its modules into your own Rust applications.
red_oxide/
├── Cargo.toml # Dependencies and Package info
├── .github/ # CI/CD Workflows
├── src/
│ ├── lib.rs # Library entry point & Error types
│ ├── main.rs # CLI application logic
│ ├── target.rs # LLM Interface (OpenAI, Local models)
│ ├── strategy.rs # Attack generators (Jailbreaks, Obfuscation)
│ ├── evaluator.rs # Grading logic (Keywords, LLM Judge)
│ └── runner.rs # Async engine using Tokio streams
└── tests/
└── integration.rs # Full pipeline tests using Mock Targets
OPENAI_API_KEY)# Clone the repository
git clone https://github.com/wkusnierczyk/redoxide.git
cd redoxide
# Build release binary
cargo build --release
Run the tool using cargo run or the compiled binary.
The primary command is scan. By default, it runs a basic jailbreak test against gpt-3.5-turbo.
export OPENAI_API_KEY=<your-api-key>
# Run a basic scan
cargo run -- scan
| Option | Short | Default | Description |
|---|---|---|---|
--model |
-m |
gpt-3.5-turbo |
The target model ID to attack. |
--file |
-f |
None |
Path to a file containing prompts (one per line). |
--strategy |
-s |
jailbreak |
The attack strategy (jailbreak, splitting, research). |
--use-judge |
false |
Use GPT-4 as a judge (more accurate, costs $). | |
--concurrency |
-c |
5 |
Number of parallel requests to run. |
--output |
-o |
report.json |
Filename for the JSON results. |
Examples:
# Attack using a file of prompts with the "Payload Splitting" strategy
cargo run -- scan --file attacks/simple.txt --strategy splitting
# Use GPT-4 as a judge for higher accuracy (slower/costlier)
cargo run -- scan --use-judge --model gpt-4
Note
You can add your strategy by implementing the Strategy trait in src/strategy.rs.
RedOxide includes a comprehensive suite of tests and benchmarks.
cargo test
strategy.rs and evaluator.rs.Runner without network costs.We use Criterion to measure the overhead of the async runner.
cargo bench
git checkout -b feature/amazing-attack).Please ensure cargo test and cargo clippy pass before submitting.