Experiments
Fuzzy: a fuzzing pipeline for LLM prompt injection.
What 31,044 malicious requests revealed about LLM defenses, using a pipeline written in Go.
The full paper
This article summarizes attached paper. Read it for all technical details, extended discussions, and references. Source code can be found here.
or read the PDF inline here.
If the viewer isn’t available, open the PDF in a new tab.
Why we built Fuzzy
Companies love AI chatbots. That’s why they integrate them everywhere (unfortunately). However, this can be abused by users in many of the current applications based on LLMs. For example, in this Reddit post, a McDonald’s support bot was used as a free Python tutor. While fun in this case, it could have more severe consequences and open doors for abuse in other cases.
Especially so when a bot has access to internal data or tools. Hence, we (that is Jan Hofer and me) built Fuzzy at KTH’s language-based security course to test whether models could be persuaded to ignore their system-instructions. It tries many prompt variations and checks whether the model complies with the attacker.
Threat model and lab setup
Our target was a fictional banking assistant. Its system prompt contained a dummy access code and instructions not to share it. The attacker controlled the user message. Their goal was make the model share the code in its reply.
We focused on prompt injection: making a model disobey the application’s instructions. This differs from trying to bypass the model maker’s general safety rules (jailbreaking). A request can be harmless in ordinary conversation and still break the rules of a particular app.
The setup gave us a clear result to check: did the secret appear in the model’s answer?
The pipeline
Fuzzy is a command-line tool written in Go. A YAML configuration selects the experiment. Each run has three stages:

Mutation
We start with 12 seed prompts. Each asks for the same secret in a different way. Fuzzy applies 42 mutations to them (plus one NULL-mutation), producing 516 prompts per target-configuration.
Some mutations change the wording or invent a role. Others encode the text (e.g. via emoji smuggling), split it up, or ask for structured outputs like JSON or YAML. The original seeds (NULL-mutation) are tested as well to serve as a baseline.
Attack
The attack stage sends each prompt to a self-hosted model through Ollama. It pairs the test prompt with the chosen target model and its system-prompt and saves the response to disk.
Evaluation
We ask two separate questions:
- Would an input guard let this prompt through? A separate model classifies the request as allowed or blocked. The share it allows is our guardrail bypass rate, or GBR.
- Did the target reveal the secret? This gives us the attack success rate, or ASR.
For the second question, we use both a regular expression and an LLM judge. The regex finds exact copies of the code. The judge can also spot replies that reformat or disguise it.
The hybrid check used below counts an attack as successful if the strict regex finds the code, or if the judge flags a leak and a looser regex confirms the code’s digits.
These checks happen during evaluation. The input guard does not stop prompts from reaching the target in our test pipeline.
Experiment design
We tested seven open-weight models from Google, Alibaba, Nvidia, and OpenAI. Most runs used 4-bit quantization to reduce memory use. We also compared 8-bit versions of Qwen 2.5 and Nemotron.
Each model faced four system prompts, ranging from a brief warning to more explicit rules. Separate experiments changed the length and placement of those rules, or translated the attack prompts into Swahili and Czech.
Gemma 4 e2B handled input-guard evaluation. Gemma 4 e4B acted as the response judge. Across the experiments, a total of 31,044 malicious requests were made.
Results
The model made a big difference. Here are selected results from the main mutation campaign. These use the hybrid check; the original, unmutated seed tests are separate.
| Target model | Successful attacks / valid runs | Success rate |
|---|---|---|
| Gemma 4 31B | 0 / 1,989 | 0.00% |
| GPT-OSS 20B (OpenAI) | 18 / 1,992 | 0.90% |
| Qwen 3.6 35B-A3B | 1 / 1,947 | 0.05% |
| Qwen 2.5 32B | 403 / 2,016 | 19.99% |
| Nemotron 3 Nano | 457 / 1,983 | 23.05% |
In our experiments, larger and newer models tended to resist attacks better. This is a pattern in the models and prompts we tested, not a universally applicable rule for a model’s security. Zero observed successes means no attack succeeded in those runs; a different prompt or another attempt could still cause a leak.
Rigid formatting requests were effective. YAML, JSON and XML output constraints were the three most successful mutations overall. Complicated encoding wasn’t automatically better. In fact, Qwen 2.5 leaked more often on the plain seeds than on the mutated prompts when measured with the strict regex check: 25.00% versus 17.56%.
See the mutation heatmap for all models and applied mutations

Repeated runs produced different outcomes. We used some model’s most successful mutation: JSON formatting for Gemma 4 26B and YAML for Qwen 3.6. Then, we tested all 12 seeds 100 times each. One Qwen prompt leaked on 50 of 100 attempts. This is something to keep in mind for everything mentioned here: LLM responses are probabilistic, so our success rates are statistical estimates from those runs. They don’t guarantee the outcome of the next request.
Prompt length and rule placement mattered. We tested Gemma 4 26B with system prompts of roughly 500, 3,000 and 7,000 tokens, containing simulated server logs. The rule against sharing the secret went at the start, middle or end. Longer prompts leaked more often than the short baseline. In longer prompts, putting the rule last worked better than putting it first, though the middle results varied.
We also tested other languages than English and checked how the system performed end-to-end. Swahili and Czech attacks bypassed the input guard more often than English ones, but secret leakage from Gemma 4 26B changed little. For the e2e evaluation, a failure meant the guard allowed the request, the model leaked, and the output judge missed it. Combining all these steps/filters reduced the failure rate by quite a lot, down to just 0.16%.
Limitations
This was a controlled test with one objective: extract a secret token from the system prompt. It doesn’t cover every way an attacker could misuse a real application.
We tested single-turn conversations and a fixed set of seeds and mutations. Fuzzy did not adapt its next prompt based on the target’s last answer. We also had limited compute and a limited model selection.
The llm-as-judge can and has made mistakes, this includes both flase negatives and false positives. Exact regex matching can miss disguised leaks too (e.g. targeted model leaks the secret base64 encoded). The success rate depends partly on how success is measured.
Takeaways
To me, these were the main learnings one should keep in mind when building an LLM-integrated app.
- Upgrade to newer, more resistant models.
- Write concise system prompts with clear security rules.
- Use multiple layers of input and output guardrails.
- Add deterministic parsing and checks wherever possible.
- And lastly, the important rule: apply least privilege. Give the model no secrets or access it doesn’t need.
A stronger model helped in our tests, but you never want to rely on it. Build your application so your AI-agent can’t reach or break anything that it shouldn’t. The probabilistic nature of LLMs is their inherent weakness and the reason why their output should always be considered potentially malicious.