LLM Red-Teaming Pipeline

A framework I built to measure how well language models resist prompt-injection attacks, and where their defenses quietly break down.

RoleSolo project
ScopePrompt-injection evaluation
Tests35 in CI
47%qwen2.5:7b, local
29%llama3.1:8b, local
3%Claude Sonnet 5
46payloads in the library
Dashboard showing breakthrough rate by model under rule-based scoring
Three-model run: 34 payloads per model, 102 runs. The 26% is all three models combined. anthropic-direct is Claude Sonnet 5.

Why measure robustness

As LLMs get wired into agentic systems with tool access, prompt injection becomes a real security surface rather than a curiosity. And whether a model is safe is not a yes or no question: robustness varies by attack technique, by model size, and by the defenses layered on top. I wanted a repeatable way to measure it instead of reasoning about it anecdotally.

How the harness is built

The framework keeps the provider, target, classifier, and defense as separate, pluggable layers, so new models, attacks, and mitigations can be swapped in without touching the core.

Heatmap of 46 attack payloads across 3 models, grouped by attack category
46 payloads across 3 models, grouped by attack category

What the runs showed

In the three-model run (34 payloads each), rule-based scoring had 47% of attacks get through qwen2.5:7b (16 of 34) and 29% through llama3.1:8b, versus 3% on Claude Sonnet 5. The LLM judge scored the same runs lower (26%, 21% and 0%). Prompt hardening on llama3.1:8b only cut breakthroughs from 21% to 17%: each defense closed two or three attacks but opened one or two others, and two attacks got through all four configurations. Denylist filters were beaten by simple obfuscation.

Chart of which attacks each prompt-hardening defense closed and opened on llama3.1:8b
Which attacks each prompt-hardening defense closed and opened, llama3.1:8b
Next project → Multimodal AI Search