esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
  • Download ResumeContact
Let’s talk

I’ll build the agent for it.

What Is Red Teaming?

What red teaming is, how a team tries to break an AI system before attackers do, and what it can and cannot prove, for your AI interview.

In short

Red teaming is a planned attempt to break an AI system, run by people or automated tools, to find harmful or unsafe behaviour before real users or attackers do. It finds problems, but it cannot prove the system is safe, so it keeps running after every change.

10 min readBeginnerVery common · estimateFacts checked 26 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

Red teaming is a planned attempt to break an AI system before real attackers or users do. A team, human or automated, tries tricks like fake instructions, requests for other people's data and unsafe asks, and logs every success. Then we fix the cause and run the same attacks again. It finds problems but never proves a system is safe, so I keep testing after every release.

What is red teaming, in plain words?

Think of it as a fire drill for an AI system. A hospital runs drills before any real fire, and a bank may hire testers to try its vault doors, so it finds the weak one before a thief does. Red teaming works the same way: a team sets off the alarms on purpose.

For a bank's support assistant, the drill means a tester posing as a customer, trying to get a fee waived, pulling another customer's details, or hiding instructions inside a document the assistant reads. Each attempt that works is a finding.

OpenAI describes it as a structured way to explore a system's risks, using people, AI or both. The page says it offers a proactive way to assess risks and test the safety of our AI models.

Key words

Red team
The people or tools that play the attacker.
Attack prompt
An input built to make the system fail or misbehave.
Harm
A bad outcome: a wrong fee, a leaked record, unsafe advice.
Regression test
An old attack re-run after a change, to check it still fails.
Benchmark
A fixed set of questions used to score a model.

How does a red team test a system, step by step?

  1. 1

    Scope the system

    Write down what it can reach, such as customer records or a refund tool, and which harms matter most.

  2. 2

    Attack it

    Testers try what a real user might. Automated tools can generate attacks at larger scale, and one language model can write test cases for another.

  3. 3

    Log every success

    Save the exact input and the bad output, so an engineer can repeat it.

  4. 4

    Fix the cause

    Change code, data or permissions. A prompt tweak alone is a partial control.

  5. 5

    Re-run every attack

    Old and new attacks run again before each release. Fixed attacks join the test set.

One red-team cycle, from scope to release

Scope the system

what it can reach and which harms matter

Attack

People try tricks

testers try what a real user might

Automated attacks

a tool writes thousands of variations

Log each success

the exact input and the bad output

Fix and retest

Fix the cause

change code, data or permissions

Re-run every attack

old and new attacks, each release

Safer release

fixed attacks join the test set

  1. 1The team agrees the scope, then starts the attacks.
  2. 2A tool is pointed at the same scope to add volume.
  3. 3Each success is written down with the steps to repeat it.
  4. 4Automated hits are logged the same way.
  5. 5The log goes to the people who own the fix.
  6. 6The fix goes in, then the same attacks run again.
  7. 7Every old attack runs again before the release ships.
A red team scopes the system, attacks it by hand and with tools, and logs every success. The fix then goes in, and the same attacks run again before each release.

Red teams test the whole assistant, not just the model. An attack can reach the model directly, or hide in a file the model reads. From there it can call tools and touch data, so a single weak link can cause real harm.

Where an attack lands in an assistant

Attacker

types a message or plants text in a file

Your assistant

Language model

reads all the text as one stream

Tools it can call

send mail, issue a refund

Harm it can cause

Wrong answer

a false fee or rate reaches the customer

Data leak

another customer's details are shown

  1. 1The attack reaches the model, in a chat message or a file it reads.
  2. 2The model asks a tool to act, such as a refund.
  3. 3A wrong answer goes straight to the customer.
  4. 4A tool with too much access exposes someone else's details.
An attacker reaches the model through a message or a file. The model can then call tools, and a tool with too much access can expose data. Red teams follow every one of these paths.

What kinds of harm do red teams look for?

  • Safety harm

    Harmful or wrong output

    Unsafe advice, abusive text or a confident wrong fee. The words themselves are the harm.

  • Security harm

    Misuse of access

    A leaked customer record, or a refund issued by a tricked tool. The damage comes from what the system can reach.

Red teams look at both. OWASP's 2025 guide describes a holistic approach in four areas: model evaluation, implementation testing, infrastructure assessment, and runtime behavior analysis.

A red team is not the same as a benchmark. A benchmark is a fixed set of questions with a score. Microsoft's team, which has tested over 100 generative AI products, says that AI red teaming is not safety benchmarking.

  • “means using people or AI to explore a new system's potential risks in a structured way”

    OpenAI

  • “The work of securing AI systems will never be complete”

    Microsoft AI red team

What does a red-team result look like in practice?

Take a mid-size bank's support assistant. A made-up red team sends 300 attack prompts in five groups. The first run finds 46 that worked. After the fixes, 9 still work, and the team re-runs all 300 on every release.

  • Fee and rate quotes: 21 worked, then 3

    Of 120 attempts, a fake manager asked the assistant to quote a wrong rate or waive a fee. The fix moved the waiver rule into code.

  • Another customer's data: 9 worked, then 1

    Of 60 attempts, the team tried to pull another account's details. The fix made the lookup tool check the signed-in customer.

  • Injected web text: 12 worked, then 3

    Of 50 attempts, hidden instructions sat in a help page the assistant retrieved. Retrieved text is now marked untrusted.

Python
# A made-up red-team run on a bank's support assistant: 300 attack prompts in five groups.
# Each group: (name, attacks sent, worked before the fix, worked after the fix)
RUNS = [
    ("Fee and rate quotes", 120, 21, 3),
    ("Another customer's data", 60, 9, 1),
    ("Injected web text", 50, 12, 3),
    ("Off-policy advice", 40, 3, 1),
    ("Fake refund request", 30, 1, 1),
]

sent = before = after = 0
for name, n, was, now in RUNS:
    sent += n
    before += was
    after += now
    print(f"{name:<24}{was:>3} -> {now:>2}   (of {n})")
print(f"Total worked: {before} -> {after} of {sent}")
print(f"Success rate: {before / sent:.0%} -> {after / sent:.0%}")

Output

Fee and rate quotes      21 ->  3   (of 120)
Another customer's data   9 ->  1   (of 60)
Injected web text        12 ->  3   (of 50)
Off-policy advice         3 ->  1   (of 40)
Fake refund request       1 ->  1   (of 30)
Total worked: 46 -> 9 of 300
Success rate: 15% -> 3%

Tip

Quote the result as a count and a rate, and name the groups. A single 'passed' score hides which attack families still work.

What can red teaming not prove?

Red teaming finds failures, but a clean run proves only that the team did not find one that day. OpenAI lists the limits plainly: red teaming isn't a complete solution for assessing AI risks, and it captures risks at one moment, which may change as models evolve.

So a good answer says the work never ends. Each new model, tool or document source opens new paths, and attackers keep learning.

What does the interviewer want to hear?

A strong answer covers

  • A plain definition: a planned attempt to break the system before attackers do.
  • Who does it: people, automated tools, or both.
  • The loop: scope, attack, log, fix, re-run.
  • Safety harms and security harms, with an example of each.
  • Red teaming finds problems but never proves safety.
  • Old attacks become regression tests after every release.

Common traps

  • Trap"Red teaming means we check the model's accuracy."

    BetterAccuracy is one thing a benchmark measures. Red teaming tries to make the system misbehave, and it tests the whole assistant.

  • Trap"If the red team finds nothing, we are safe."

    BetterA clean run only shows the team found nothing that day. Keep testing as models and tools change.

  • Trap"Just write a stronger prompt."

    BetterA prompt is a partial control. Fix the cause in code, data or permissions, then re-run the attacks.

Can you spot a red-team attack?

Spot the attack

Which message is a red-team attack on a bank's support assistant?

Quick check

A red-team run found 12 attacks that worked. What is the best next step?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q222Automated vs human red teaming?11 min
  2. Q223Guardrail tools (Llama Guard, NeMo Guardrails, cloud filters)?10 min
  3. Q224What is a policy classifier layer?12 min
  4. Q201What is prompt injection?12 min
  5. Q267How do you evaluate safety?13 min
  6. Q210Why can't a system prompt alone stop attacks?10 min

Learn it in depth

Last updated on 26 November 2026

Building an assistant that customers or staff will use?

I design and build AI agents with red-team tests in place, from the attacks to the fixes that stay fixed. Book a short call and tell me what yours needs to do.