# Red teaming

> Red teaming is deliberately trying to make an AI system fail, by attacking it with misleading, harmful or adversarial inputs, to find unsafe behaviour, data leaks and weaknesses before real users or attackers do.

Also called: AI red teaming, adversarial testing, LLM red teaming, penetration testing for AI. Category: Delivery and quality. Source: https://aibuildindex.com/glossary/red-teaming

## In the index

- Customer support chatbot: median $2,000, middle half $300 to $5,300, 1,344 priced briefs (https://aibuildindex.com/cost/support-chatbot)
- Custom AI agent: median $3,850, middle half $600 to $10,000, 2,831 priced briefs (https://aibuildindex.com/cost/custom-ai-agent)
- AI voice agent: median $1,600, middle half $440 to $6,300, 1,116 priced briefs (https://aibuildindex.com/cost/voice-agent)

Most testing checks that a system does what it should. Red teaming checks what it does when someone tries to make it misbehave. Testers act as hostile or careless users: they try to make a support assistant promise refunds it cannot give, coax an agent into revealing another customer's data, or slip hidden instructions into a document the system reads. For any AI system that faces the public or acts on business systems, red teaming is how a buyer learns the worst case before launch.

## How it works

A red-team exercise usually starts by listing what would be harmful for this particular system: leaking personal data, taking an unauthorised action, giving dangerous advice, making commitments on the business's behalf, or producing offensive content. Testers then try to cause each one, using techniques such as:

- **[Jailbreaks](https://aibuildindex.com/glossary/jailbreak)**, which coax the model past its instructions with role-play or persistence.
- **[Prompt injection](https://aibuildindex.com/glossary/prompt-injection)**, hiding instructions in emails, web pages or files the system processes.
- **Probing for data**, asking the system to reveal its prompt, other users' records or internal information.
- **Abuse of tools**, pushing an agent to call functions in ways nobody intended.

Successful attacks are recorded, fixed with better [guardrails](https://aibuildindex.com/glossary/guardrails), tighter permissions or prompt changes, and added to the [evals](https://aibuildindex.com/glossary/evals) so that they are re-tested after every change.

## What it means for cost

Red teaming adds effort to a build, and how much depends on exposure. An internal tool used by a few trained staff needs a light exercise. A public chatbot, a voice agent taking calls, or an agent that can send emails or change records needs a thorough one, sometimes by people outside the build team. That difference is one reason quotes for similar-looking systems can vary.

The cost of skipping it is harder to see until something goes wrong: a public embarrassment, a data incident, or an agent action that has to be reversed. Ask a builder:

- What are the worst things this system could do, and how have you tested for them?
- What can the system access, and could it be tricked into misusing that access?
- Will red-team findings be documented and added to regular tests?

Limiting what the system can do, for example read-only access where possible, often reduces risk more cheaply than testing alone.

## Common questions

### Is red teaming only for large companies?

No. Any system that talks to the public or takes actions can be misused. A small business can run a focused exercise on its own system, concentrating on the few failures that would hurt most.

### Who should do red teaming, the builder or someone else?

The builder should test their own work, but they know how the system is meant to be used, which can blind them to other uses. For high-exposure systems, a second set of testers often finds problems the builder missed.

### Does red teaming make a system completely safe?

No. It reduces known risks and shows how the system fails, but new attack techniques appear over time. It works best combined with limited permissions, monitoring and regular re-testing.

## Related terms

- [Prompt injection](https://aibuildindex.com/glossary/prompt-injection): Prompt injection is a security attack in which hostile instructions are hidden in content an AI system processes, such as an email, web page or document, causing the model to follow the attacker's instructions instead of its own.
- [Jailbreak](https://aibuildindex.com/glossary/jailbreak): A jailbreak is an attempt by a user to trick an AI model into ignoring its safety rules or instructions, for example through role-play, hypothetical framing or carefully crafted wording, so that it produces content or actions it should refuse.
- [Guardrails](https://aibuildindex.com/glossary/guardrails): Guardrails are the checks and controls placed around an AI model, such as input filters, output validation, topic limits and action restrictions, that keep its behaviour within safe, permitted and useful bounds in a live system.
- [Evals (AI evaluation)](https://aibuildindex.com/glossary/evals): Evals are structured tests that measure how well an AI system performs on a fixed set of realistic inputs, scoring its outputs so that changes to prompts, models or data can be judged by evidence rather than impression.
- [Content moderation](https://aibuildindex.com/glossary/content-moderation): Content moderation is the process of detecting and handling harmful, abusive, illegal or off-policy material in text, images, audio or video, increasingly done by AI classifiers with human reviewers for difficult cases.
- [Production readiness](https://aibuildindex.com/glossary/production-readiness): Production readiness is the state of a system being safe and reliable enough for real users and real data, covering security, error handling, monitoring, testing, performance and support, not just working in a demo.
