Practical notes on AI/LLM red teaming
Welcome. These are practical, hands-on notes on red teaming LLMs, written from a pentester's point of view. Use the tabs above to move around: Foundation explains what you are really testing, Attacks and Methodology are the how, Bootcamp is a guided course and PortSwigger has worked labs, Scope and Attack Flow help you scope a target, and Terminology is the quick dictionary. New here? Just keep reading this tab from top to bottom. Press / any time to search everything.
Read this first. In one minute it shows you what an "AI feature" really is, the words model / chatbot / agent, and how the AI makes an answer. Once you see the picture, the other tabs make sense.
An "AI feature" is just a normal app with an AI model plugged in. You test the app the client built. The model's brain is usually the vendor's (Claude, OpenAI) and out of scope.
These three words confuse everyone. It is just a ladder - each step adds one thing.
The further right, the more it can do - and the more you can attack.
The model does not "think". It reads text and guesses the next word, again and again. Here is what happens when you hit send:
Look at steps 2 and 3 again. The rules and your input get mixed into one block, and the model treats it all the same.
Each layer you saw above has its own bug. This is the OWASP LLM Top 10, in plain words:
| Layer | The bug |
|---|---|
| Your input | Prompt injection - your text acts like a command. |
| The model | Jailbreak (break its safety); if fine-tuned, leak its training data. |
| Documents / RAG | Poison the documents so the model obeys them (indirect injection). |
| Tools | Make it use a tool it shouldn't, or attack the tool's input (SQLi, SSRF, run code). |
| The answer being shown | Insecure output handling - the app runs the answer as HTML/SQL, so XSS and friends. |
The same answer can be fine in one app and a disaster in another. So before you test, ask: what is this app for, and what would count as "bad" here?
| App | What "bad" looks like |
|---|---|
| Story / game generator | wants wild, creative output - almost anything goes. |
| Internal HR or support bot | must stick to the facts - making up a policy is the bug. |
| Email writer for the company | should be honest but on-brand - rude or dishonest text is the bug. |
You usually want the model's intelligence (good language and reasoning), not its knowledge - it should answer from your data and say "I don't know" otherwise.
Sources: OWASP Top 10 for LLM Apps, PortSwigger Web LLM attacks, MITRE ATLAS. Next: the Terminology tab for the words, then Methodology for the plan.