Red Teaming LLMs: Methodology and Tooling
Red Teaming LLMs is for builders who need the term to survive contact with real products, tools, and failure modes. The goal is a practical mental model you can use in design review, not a glossary definition.
We will follow one concrete workflow, separate mechanism from product language, and end with a checkable practice. For nearby background, connect this with Agent Evals and Observability and Jailbreaking vs Prompt Injection.
Red Teaming Starts With a Threat Model
LLM red teaming is structured adversarial testing. The goal is not to collect scary prompts; it is to discover where the product violates its safety, security, privacy, or reliability contract under realistic attacker behavior.
The running example is a customer-support agent with email, CRM, and refund tools. The red team asks what a malicious user, malicious email, compromised document, or confused employee could cause the agent to do.
Quick reference
- Define assets: data, money, credentials, reputation, availability.
- Define actors: direct user, external content, insider, compromised integration.
- Define allowed and forbidden outcomes before testing.
- Separate model behavior tests from tool-permission tests.
Remember this
A useful red team test begins with a product threat model, not a prompt list.
Use Layers: Probe, Scenario, Review, Regression
Automated probes are good for breadth: jailbreak strings, injection templates, policy edge cases, and malformed tool arguments. Human scenario testing is better for chained attacks where one harmless step sets up the next. Both need severity scoring and reproducible evidence.
For the support agent, one scenario might place an instruction in an email, ask the agent to summarize it, then attempt a refund. The important result is whether the harness blocks the risky action, not whether the model says something odd.
Quick reference
- Run broad automated prompt suites for known patterns.
- Add human-authored scenarios for realistic chains.
- Record prompt, context, tool calls, output, and policy violated.
- Turn every confirmed issue into a regression test.
Remember this
Red teaming finds bugs; regression gates keep the same bug from shipping again.
Failure Story: Tool Permissions Were Never Tested
Trigger: the model refuses a direct jailbreak in chat, so the team marks the feature safe. Symptom: a malicious email later causes the agent to send private account notes to an external address. Root mechanism: testing focused on model refusal, while tool authorization accepted model intent too easily.
Recovery is to disable the risky tool path, inspect audit logs, and add approval gates. Prevention is to test model, retrieval, tools, memory, and UI confirmation as one system.
Quick reference
- Score impact by executed action, not only text output.
- Test each tool with malicious arguments and wrong principals.
- Include indirect prompt injection in RAG/email/browser scenarios.
- Review traces for near misses, not only failures.
Remember this
An LLM can pass chat safety tests while the agent system fails action safety.
Practice: Build a Ten-Case Red Team Set
Write ten cases across four categories: direct jailbreak, indirect prompt injection, data exfiltration, and unsafe tool action. For each case, define expected behavior and severity if it fails.
Pass when the suite can run before each release and reports the exact failed boundary. Break it by allowing one external-send tool call without confirmation; recover by adding a policy gate and a regression test.
Quick reference
- Starter: store cases as JSON with
attack,context,expected, andseverity. - Expected success: failures identify model, retrieval, tool, or UI layer.
- Intentional break: remove approval from an external email action.
- Recovery: add a blocking assertion around that action.
Remember this
Red teaming becomes engineering when every finding turns into a repeatable gate.
Key takeaway
Use the concept when it gives you a clearer boundary, measurement, or operating rule. Skip the label when it only makes the system sound more advanced.
Practice should leave behind an artifact: a table, eval set, trace, or checklist that another engineer can inspect. Pass when the artifact catches the intentional failure described above and gives a concrete recovery path.
Related Articles
Explore this topic