Red Teaming Your LLM App: A Practical Guide to Adversarial Testing
Red teaming your LLM app means attacking it like a hostile user would. Here is the OWASP threat map, a workflow, and the garak, PyRIT and promptfoo tools.
By Galactic News Editorial · Published 2026-11-20T07:33:34+00:00 · Updated 2026-11-20T07:33:34+00:00
Red Teaming Your LLM App: A Practical Guide to Adversarial Testing
Red teaming your LLM app means attacking it the way a hostile user would, before a hostile user does. The goal is to find jailbreaks, prompt injections, data leaks, and unsafe tool use while the system is still in testing. This guide covers the OWASP LLM Top 10 threat map, a practical seven-step workflow, and the open-source tools that do the heavy lifting: garak, PyRIT, and promptfoo.
What red teaming an LLM app means
AI red teaming is a structured, adversarial assessment of an AI system's behavior under stress. It is designed to surface failure modes before deployment and then continuously after. It combines automated scanning, which gives broad coverage and fast feedback, with manual expert work, which covers creative attack chains, multi-turn pressure, and domain-specific harms.
A jailbreak test checks words. An agent red team checks actions. For a chatbot, the question is what the model says. For an agent with tools, the question is what the agent does: which tool ran, with which arguments, for whom. A polite reply that refunds 240 dollars to the wrong account is a failure, even though the words look fine. Test the actions, not just the text.
Red teaming is also a compliance matter now. The EU AI Act makes adversarial testing a requirement for high-risk and general-purpose AI systems, with the bulk of the act becoming operative on August 2, 2026. Procurement teams ask for evidence of adversarial testing. A documented red team program is becoming a baseline engineering practice, not a luxury.
The OWASP LLM Top 10 as your attack map
The OWASP Top 10 for Large Language Model Applications is the closest thing to an industry standard for LLM security. The 2025 edition introduced two new categories, System Prompt Leakage and Vector and Embedding Weaknesses, and reordered several entries to reflect what practitioners see in production. Do not invent your own categories until you have covered all ten.
LLM01 Prompt Injection is still the number one risk. Direct injection appends instructions to user input, such as ignore previous instructions. Indirect injection hides instructions in content the model reads from external sources: web pages, documents, database results, or emails. The indirect variant is harder to defend because the malicious payload arrives through a trusted channel.
LLM02 Sensitive Information Disclosure covers cases where the model reveals information it should not: memorized training data, system prompts, personal data from earlier conversation turns, or confidential documents it was given access to. It climbed several spots in the 2025 list after a year of well-publicized extraction attacks.
LLM03 Supply Chain covers risks from third-party models, fine-tuning datasets, and plugins. LLM06 Excessive Agency is the risk that an agent takes destructive actions beyond its intended scope because the model inferred that it should. LLM07 System Prompt Leakage is new in the 2025 list. LLM10 Unbounded Consumption covers resource exhaustion, which replaces the older denial of service category. For each category, run at least one test probe, and ideally automated test cases that exercise multiple variants of each attack.
A practical red teaming workflow in seven steps
- Define the scope. List what the app can do: answer questions, call tools, send email, issue refunds, read documents. List what it must never do. Write the rules of engagement. State which systems are in scope and which data is off limits.
- Build the threat model. Map the OWASP LLM Top 10 to the app's features. A RAG app needs injection tests on its documents. An agent needs tool misuse tests. A customer-facing bot needs data leak tests. Pick the categories that match the real attack surface.
- Run an automated scan. Point garak at the model or endpoint and run its probe families. This gives broad coverage fast: injection, jailbreaks, encoding bypasses, data replay, malware generation, and more. Record the hit rate per probe family.
- Run targeted multi-turn attacks. Use PyRIT for attacks that build over several turns, such as Crescendo and TAP, where an attacker model adapts its messages based on the target's replies. Single-turn tests miss attacks that only work after the model has been softened up.
- Add application-specific tests in CI. Use promptfoo to write test cases for the app's own features, with assertions on the output. Its redteam mode includes plugins for OWASP LLM and MITRE ATLAS categories, plus agent plugins for excessive agency and broken access control. These tests run on every deployment.
- Test the tools, not just the words. Give the agent a task with a hidden instruction in the input. Check which tool ran and with what arguments. Check whether it leaked another user's data. Check whether it acted on an approval it never got. Log every tool call during the test.
- Write findings and fix in code. Each finding needs a severity, a reproduction, and a fix. Fix in deterministic code, not in the prompt. A prompt instruction is a suggestion. A validation rule is a control. Re-run the failing test after the fix to confirm it passes.
Red teaming LLM app tools: garak, PyRIT, and promptfoo compared
The open-source tooling has consolidated around three projects, each with a different strength. In practice, teams use all three at different stages. The table below compares them based on their repositories and documentation as verified in October 2026.
| Tool | Maintainer | Best for | How it works |
|---|---|---|---|
| garak | NVIDIA | Fast vulnerability scan of a model or endpoint | CLI scanner with probe families for injection, encoding, data replay, malware, and more; JSONL report and hit log |
| PyRIT | Microsoft | Programmable multi-turn campaigns | Python framework with targets, converters, scorers, and multi-turn attacks such as Crescendo and TAP; pyrit_scan CLI and CoPyRIT GUI |
| promptfoo | OpenAI (acquired March 2026) | Red-team tests in CI next to other evals | Test runner with owasp:llm and mitre:atlas presets and agent plugins in one config file |
| DeepTeam | Confident AI | Python library mirroring DeepEval tests | 50+ vulnerabilities, 20+ attack methods, OWASP and ATLAS mappings |
| Giskard | Giskard | Multi-turn scans of a conversational agent | giskard-scan vulnerability and quality scans for agents |
Start with garak for breadth. It is the widest net at the model level, and it runs as a simple CLI scan. Add PyRIT when attacks need several turns to succeed. Add promptfoo when the tests must run in CI on every change. The three overlap less than their marketing suggests, which is why teams keep all three.
Writing findings that get fixed
A finding that cannot be reproduced will not be fixed. Each finding should include the exact prompt or attack sequence, the model output or tool call that resulted, the OWASP category, and the severity. Include the impact in plain terms: what an attacker gains, and what it costs the business.
Rank findings by impact, not by cleverness. A prompt injection that lets a user read another user's data outranks a jailbreak that makes the model swear. An agent that issues refunds without approval outranks a model that reveals its system prompt. Fix the high-impact items first.
Keep the evidence. Store the attack transcripts, the probe results, and the fix verification. Regulators, auditors, and enterprise customers ask for this evidence. The EU AI Act requires providers of general-purpose AI models with systemic risk to perform adversarial testing and share results with the EU AI Office. Even without a legal duty, the evidence shows the work was done.
How often to red team
Red team before every major release, and after every significant change: a new model version, a new tool, a new data source, or a new system prompt. Each of those changes can open a new attack path. A model upgrade alone can change jailbreak resistance.
Between releases, run the automated scans on a schedule. Weekly garak scans and promptfoo tests in CI catch regressions early. Manual red teaming is slower and more expensive, so reserve it for major releases and for new features with a large attack surface.
Track the trend, not just the count. If the same probe family fails release after release, the fix is not working. If new failures appear after a model change, the change needs review. A red team program that only produces reports is a cost. One that produces fixes is an investment.
Bottom line
Red teaming your LLM app is straightforward once the pieces are in place. Use the OWASP LLM Top 10 as the threat map. Scan broadly with garak, attack deeply with PyRIT, and keep the tests in CI with promptfoo. Test what the agent does, not only what it says. Fix findings in code, keep the evidence, and repeat the cycle on every release. The attackers will test the app eventually. Test it first.