Glossary

What is Red Teaming? Adversarial Testing for AI Systems

AI red teaming is adversarial testing of a model or AI application: attacking it the way a real adversary would to find harmful or unsafe behavior first.

Reviewed Red TeamingSecurityEvaluation

Definition

Red teaming, for AI systems, is structured adversarial testing in which people or attacker models deliberately try to make a model or application behave harmfully, so that the failures can be found and fixed before real attackers find them.

Definition

Red teaming is adversarial testing: a team plays the attacker against its own system to find weaknesses before someone else does. The term comes from military exercises and security practice. For AI, the targets are models and the applications built on them, and the weaknesses include harmful outputs, policy violations, leaked system prompts or data, and agents that take unauthorized actions.

AI red teaming has two broad forms:

  • Manual red teaming. People write attacks. Ganguli et al. (2022) at Anthropic described red-teaming models from 2.7B to 52B parameters and released 38,961 red team attacks.
  • Automated red teaming. A model writes the attacks. Perez et al. (2022), "Red Teaming Language Models with Language Models", used one LM to generate test cases for another and found tens of thousands of offensive replies in a 280B-parameter chatbot.

How it works

A typical automated run has four parts:

  1. Scope and policy. What the system is for, what it must never do, and which systems you are authorized to test.
  2. Attacker. A model generates inputs aimed at each policy, using strategies such as jailbreak framing, encoding, multi-turn escalation and prompt injection through documents or tool output.
  3. Target. The model or application under test receives the attacks, single-turn or as conversations.
  4. Grader. A model or classifier decides whether each response violated the policy. HarmBench, for example, uses a fine-tuned Llama 2 13B classifier.

Findings become regression tests that run on every release.

Tools that implement this loop include promptfoo, Microsoft's PyRIT, NVIDIA's garak and the UK AI Security Institute's Inspect.

Example

A company's support bot can look up the signed-in customer's orders. The red team's policy says it must never reveal another customer's data. The attacker writes 200 attempts: a caller claiming to be the account holder's spouse, a fake internal-audit message, a pasted "system notice" asking for an order export. Over six-turn conversations, 3 attempts get the bot to confirm another customer's shipping city. The grader flags them, engineers add an authorization check in the lookup tool, and the 3 transcripts become permanent test cases.

How it relates to Abliterator

Abliterator is an attacker and grader for red teaming your own systems. Mainstream models often decline to write attacks; abliterated models write them. On DeepSeek V4.1 Flash Abliterated, refusals on JailbreakBench harmful prompts fell from 94% to 1% and on HarmBench (chemical and biological excluded) from 84.9% to 0.6% (benchmarks). The API is OpenAI-compatible, so it plugs into the tools above as a provider. Testing systems without authorization is prohibited by the acceptable use policy. See AI red teaming for a worked promptfoo config.

  • Jailbreak: a class of attack prompts used in red teaming.
  • Prompt injection: attacks through untrusted content an application reads.
  • HarmBench: a standardized benchmark for automated red teaming.
  • Refusal rate: one of the metrics red teams report.

Frequently asked questions

What is automated red teaming?

Using one language model as the attacker to generate test inputs for another, then scoring the target's responses with a grader. Perez et al. described the approach in 2022, and tools such as promptfoo, PyRIT and garak implement it.

Why use an abliterated model for red teaming?

A safety-tuned attacker often refuses to write attacks or writes weak ones, which leaves untested gaps. An abliterated attacker writes the attack you asked for, so coverage reflects your test plan.