Zulia Shavaeva← Back to Zulia
Free AI and security guide/Learn

Learn / AI red teaming and adversarial testing

AI red teaming and adversarial testing

Probing AI systems, especially LLMs, for exploitable weaknesses using adversary tactics and structured attack testing.

Researched on 2026-09-26 with AI assistance. Links and summaries can change; verify details with the original source. Not yet reviewed by a person.

What it is

AI red teaming is adversarial probing of a generative AI system to find failures an attacker could cause on purpose. The Microsoft team that red teamed over 100 generative AI products describes it as covering both security flaws and responsible AI harms, and argues the work of securing AI systems is never complete.2

The target is the whole system, not the model alone. OWASP's GenAI Red Teaming Guide organises the work into four areas: model evaluation, implementation testing, infrastructure assessment and runtime behaviour analysis.9

It is not the same as safety benchmarking. Benchmarks score a model on a fixed test set, while red teaming looks for new attacks under adversarial pressure, which is why live competitions still surface attacks that static benchmarks miss.26

Findings are usually written up against a shared vocabulary. MITRE ATLAS catalogues adversary tactics and techniques against AI systems and grew out of the Adversarial ML Threat Matrix, published by MITRE, Microsoft and 16 other organisations.110

Why postings ask for it

23 of 48 postings ask for it (48 percent), and it is universal in the two clusters that exist to break things: AI Red Team / Adversarial Testing (9 postings, 100 percent) and AI Security Research (4 postings, 100 percent).P

Builder roles ask too, because attacks now land through data an agent reads rather than through a user prompt: AI/Agent Security Engineer 44 percent of 16 postings, AI Security Architect 43 percent of 7, matching the indirect injection and agent hijacking patterns documented in the literature.P36

It is absent from AI Governance / GRC (7 postings) and Consulting (5 postings) at 0 percent, so if you sit in those clusters, treat it as background for reading red team reports rather than the skill you are hired for.P

Concepts you should be able to explain

If you can say each of these out loud in two minutes, with an example, you are ready for the technical part of an interview on this skill.

Direct vs indirect prompt injection

Direct injection is the user overriding instructions in their own prompt. Indirect injection puts the attacker's instructions into data the application later retrieves, such as a web page, email or repository file, so the attacker needs no interface to the model. The original paper shows this working against real systems including Bing's GPT-4 powered chat and code completion engines.3

Data and instruction boundary

LLM-integrated applications blur the line between data and instructions, so retrieved content can act like code the application executes. The indirect injection taxonomy covers data theft, worming, information ecosystem contamination and control over whether and how other APIs are called. When you test, ask which untrusted channels reach the prompt and what the model is allowed to do afterwards.3

Agent hijacking

When an agent processes emails, websites or code, malicious instructions in that data can derail it into exfiltrating credentials, sending phishing mail or downloading and running malware. NIST's CAISI treats agent hijacking as the same problem as indirect prompt injection and as a focus of its measurement work. Impact scales with the tools and permissions the agent holds.6

Jailbreaks and automated adversarial suffixes

Manual jailbreaks rely on human ingenuity and are brittle. The GCG work automates the search with greedy and gradient-based techniques to produce a suffix that pushes a model towards an affirmative answer instead of a refusal. Suffixes trained on Vicuna-7B and 13B transferred to public black-box interfaces including ChatGPT, Bard and Claude.4

You do not need gradients

One of the eight lessons from red teaming 100 generative AI products is that you do not have to compute gradients to break an AI system. System-level weaknesses in application logic, retrieval paths and permissions are often cheaper routes than optimisation attacks. The same report notes that LLMs amplify existing security risks as well as introducing new ones.2

Attack transfer and model choice

Across more than 250,000 attempts by over 400 participants against 13 frontier models, at least one successful attack was found against every model, but success rates differed sharply and did not track capability. Some universal attacks transferred across scenarios and models, and attacks found against harder-to-break models transferred to weaker ones more often than the reverse. That makes comparative red teaming useful input to model selection.6

Automation with human judgement

Automation helps cover more of the risk landscape, but the human element stays central, and responsible AI harms are pervasive and hard to measure. In practice you automate breadth with scanners and keep humans for scoping, novel attack ideas and judging whether an output is actually harmful in context.2

Probes, detectors and failure rates

Scanners such as garak combine static, dynamic and adaptive probes for prompt injection, data leakage, jailbreaks, toxicity and hallucination, and mark a response FAIL when a detector fires. Because garak makes several generations per prompt by default, results come as a failure rate rather than a yes or no. Detector output needs manual triage before it becomes a finding.7

Use fictional data and authorised sandboxes. Remove employer details and secrets from any portfolio write-up. Time estimates exclude setup. Check model and cloud costs before running tests, set spending limits, and delete lab resources afterwards.

Three exercises

In order of difficulty. Free tools. Keep what you build; it is evidence.

1Manual injection pass with ATLAS-mapped write-upsabout 3 h

A short report of three attempted attacks on a small chat application, each mapped to an ATLAS technique and to the OWASP area it sits in.139

  1. Pick a local open-weight chat model and wrap it in a script with a system prompt and one fake tool.
  2. Try direct instruction override, then hide the same instruction in a document the script retrieves, following the indirect injection pattern.
  3. Record prompt, output, and what the application would have done next.
  4. Map each attempt to an ATLAS tactic and technique, and label it model evaluation, implementation testing, infrastructure or runtime per OWASP.
  5. Write one paragraph per finding: impact, preconditions, suggested control.

Tools: Python, a local open-weight model, MITRE ATLAS, OWASP GenAI Red Teaming Guide

2Automated scan and triage with garakabout 5 h

Evidence that you can run a scanner, read the log and separate real findings from detector noise.72

  1. Install garak from PyPI and run garak --list_probes to see the probe families.
  2. Scan a small Hugging Face model with --target_type huggingface, first --spec probes.encoding then a jailbreak probe such as probes.dan.Dan_11_0.
  3. Read the jsonl run log and use analyse/analyse_log.py to find the probes and prompts with the most hits.
  4. Manually review 20 FAIL rows and mark each as true positive, false positive or unclear.
  5. Report failure rates per probe plus your own corrected rate, and note which detectors were unreliable.

Tools: garak, Python, Hugging Face model

3Adaptive attacks against a tool-using agent in AgentDojoabout 10 h

A measured comparison of agent task success and attack success, with at least one adaptive attack you wrote yourself.586

  1. Install AgentDojo and run its baseline tasks so you see how often the agent fails with no attacker present.
  2. Run the bundled prompt injection attacks across the security test cases and record which security properties break.
  3. Write one adaptive injection tailored to a scenario the bundled attacks fail on, and test it.
  4. Test whether your attack still works against a second model, and note the direction of transfer.
  5. Optionally script the attack loop and scoring in PyRIT so the run repeats after a prompt or model change.
  6. Report utility under attack, attack success rate, and which defence paradigm helped most.

Tools: AgentDojo, PyRIT, Python, open-weight models

Practice questions

Written from the concepts above, not collected from a named employer. Open one, answer it out loud, then tick the points you covered; the score stays in this browser.

Explain the difference between direct and indirect prompt injection, and why the second one changes your threat model.Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

How is AI red teaming different from running a safety benchmark, and when would you do each?Red teaming vs benchmarking (s3, s7)

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

You have two days to test an internal agent that reads support tickets and can email customers. What is your plan?Agent hijacking, You do not need gradients (s3, s7)

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

What does transferability mean for adversarial prompts, and how does it affect how you test?Attack transfer (s5, s7)

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

A scanner reports a 30 percent failure rate on a jailbreak probe. What do you do before reporting it?Probes, detectors and failure rates (s8)

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

Where do automated tools help in a red team engagement, and where do they not?Automation with human judgement (s3, s8, s9)

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

How would you structure a red team report so an engineering team can act on it?s1, s10, s3

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

How do you measure whether a defence against prompt injection actually works?AgentDojo (s6)

Say your answer out loud or write it down, then tick what you covered:

0 of 4 covered

Sources

Every numbered claim above links here. P = the platform's own coding of 48 job postings.

  1. MITRE ATLAS MITRE
  2. Lessons From Red Teaming 100 Generative AI Products arXiv (Microsoft AI Red Team)
  3. Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection arXiv
  4. Universal and Transferable Adversarial Attacks on Aligned Language Models arXiv
  5. AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents arXiv (ETH Zurich)
  6. Insights into AI Agent Security from a Large-Scale Red-Teaming Competition NIST CAISI
  7. garak, the LLM vulnerability scanner NVIDIA
  8. PyRIT: Python Risk Identification Tool for generative AI Microsoft
  9. GenAI Red Teaming Guide OWASP Gen AI Security Project
  10. mitre/advmlthreatmatrix: Adversarial Threat Landscape for AI Systems MITRE (GitHub)

Resources

Free first. Levels: intro means no prior knowledge of this skill; working means you can apply it on a project; advanced means research depth or specialist tooling.

Level Format

Gaps the research could not fill with a good free source: No free, structured multi-week AI red teaming course with graded labs: the free options are either 1.5 hours (DeepLearning.AI) or unstructured challenge sites, and the long paths (HTB) are paid.; No free hands-on lab found today specifically for MCP and multi-agent tool chains; agent practice is mostly benchmark code (AgentDojo) rather than a guided range.; No free multimodal red teaming lab (image, audio or document-borne injection) from a primary source; the material found is papers only.; No free rules-of-engagement, scoping or report template for AI red team engagements from a standards body; the OWASP and CSA guides describe process but templates were not confirmed.; No free hands-on training on model extraction, membership inference or poisoning attacks: coverage found sits inside paid paths.