Skip to main content

LLM Red Teaming Guide: How to Plan and Run Your First Exercise

· By Natalie Walls

LLM red teaming means deliberately trying to make an AI model or app misbehave, so you find its weak spots before real users or attackers do. You plan it like a security test: pick a scope, gather testers with different backgrounds, try to break things, write everything down, fix, and repeat.

This guide pulls together advice from Microsoft's red teaming planning guide, NVIDIA's research on how practitioners work, and the OWASP Gen AI Red Teaming Guide, scaled down for a small team.

What LLM red teaming covers

NVIDIA splits it into two kinds of work (NVIDIA Technical Blog):

  • Security red teaming: prompt injection, data extraction, model extraction. This needs security skills.
  • Content red teaming: getting the model to produce biased, unsafe or off-brand output. This often needs domain or legal expertise.

Most apps need both. A support bot that leaks another customer's order is a security problem. One that gives dangerous medical advice is a content problem.

Step 1: Decide what you're testing

Microsoft recommends testing at more than one layer:

  1. The base model with its safety system, usually through the API.
  2. Your application, ideally through its real user interface.
  3. Both again, before and after you add mitigations.

Test through the production UI where you can, because it's closest to how people will use it. When you report a finding, note which endpoint you used.

If your app uses tools, reads documents or browses the web, write down every place outside text enters the model. That's where indirect injection lives. Our threat modeling post walks through mapping those inputs.

Step 2: Pick your testers

Microsoft suggests a mix of people:

  • Someone with security testing experience, for injection and system prompt extraction.
  • Ordinary users who didn't build the product, who'll hit the harms normal people run into.
  • Domain experts if the app works in a specialist area like health or finance.

Give each person written instructions: what the round is for, which features to test, what harms to look for, how long to spend, how to record results and who to ask for help.

Step 3: Explore first, then go systematic

Start open ended. Let testers poke at the app freely and record anything that looks wrong. Microsoft says this helps uncover blind spots in your understanding of the risks.

Then turn what they found into a list of harms with a definition and example for each. In the next round, testers work through that list on purpose and check whether your fixes hold up. Add new harms as they appear.

NVIDIA's research describes good red teamers as limit seeking, collaborative and never malicious, and stresses novelty. As one line in their post puts it, "if we get a failure just one time, then the failure is possible."

Step 4: Record every finding the same way

A shared spreadsheet is often enough, according to Microsoft. For each finding capture:

FieldWhy
The exact inputSo someone can reproduce it
The output, or a screenshotEvidence
The dateModels change, so results drift
A unique IDTo link fixes back to findings
NotesWhich endpoint, which feature, anything odd

Keep test inputs harmless where you can. For prompt injection, a payload that only asks the model to print a marker like CANARY-7 proves the model obeyed injected text without creating anything dangerous. Our canary payloads are built that way.

Step 5: Fix, retest and report

After each round, apply mitigations and run the same tests again to see if they worked. Microsoft suggests a short regular report that lists the top issues, links to the raw data, previews the next round and thanks the testers.

One caution from the same guide: red teaming finds risks but doesn't measure how common they are. A single example isn't a rate, so don't present it as one.

Step 6: Automate what you learned

Manual testing finds new problems. Automation makes sure old ones don't come back. NVIDIA recommends recording successful exploits so tools can test other models for the same issue. Tools like garak, promptfoo and PyRIT help here; see Open Source LLM Red Teaming Tools.

Keep going after launch

The OWASP Gen AI Red Teaming Guide covers prompt injection, agent risks and continuous monitoring, and stresses that a model is never fully "done" or "secure." Plan to rerun your tests whenever you change the model, the system prompt or the tools.

Ready to start? Run the six canary payloads against your app today, then follow How to Test Your LLM App for Prompt Injection.