AI Red Teaming: What It is and How to Run It
Published Updated
AI red teaming is an authorised exercise that tests whether misuse can make an AI system disclose information, produce harmful content or take an unsafe action. Before signing off an assistant, pick the failures that could harm users and verify that the system prevents or contains them in an isolated environment.
What Red Teaming Means
Red teaming uses the perspective of a simulated adversary to find weaknesses in a system or plan. It grew out of military exercises that assigned a team to think and act like an opponent. Security teams use the same approach to test how systems and people respond when something goes wrong.
In AI red teaming, testers examine what the model says and what the application does around it. A model can produce a safe reply while the application still attempts an unauthorised action. The exercise checks the actual outcome in the answer, the data it accessed and any action it tried to take. The US National Institute of Standards and Technology uses this broader scope in its definition of AI red teaming.
How AI Red Teaming Differs From Penetration Testing
Penetration testing typically checks exploitable weaknesses in software or infrastructure, such as broken access controls. AI red teaming also examines behaviours that can fail while the application code is running as designed. The two can overlap when a model’s output reaches software that treats it as a trusted instruction.
- Check whether the assistant produces harmful output or shares information the user is barred from seeing.
- Check whether a jailbreak, an attempt to bypass the model’s own safeguards, changes what the model will say.
- Check whether prompt injection causes the assistant to follow instructions from a source it should treat as data.
- Check whether the agent tries to take an action outside its permissions or without human approval. Enforce those limits where the action happens. Model instructions are one part of AI agent security.
Generative models can produce different answers to the same input because they may sample among likely next words. A changed conversation or a different set of retrieved records can also change the outcome. Repeat priority cases under the same settings in separate sessions. Record how many runs failed and how many ran, then investigate any failure with serious consequences even if it happened only once.
Automated Red Teaming Tools and Frameworks
Automated red teaming helps a team repeat approved cases and flag unexpected results for review. Give the automated check a clear expected outcome, such as whether a fake confidential marker appears in an answer. Have a person review results that depend on context and confirm the severity of each finding.
Microsoft’s PyRIT is an MIT-licensed toolkit for organising and scoring tests of generative AI systems. NVIDIA maintains garak, an Apache 2.0-licensed scanner that checks language model behaviour across known failure categories. The open-source Promptfoo project is part of OpenAI and uses the MIT licence. It can run saved evaluation cases and their expected-result checks as part of a release pipeline.
The OWASP Top 10 for Large Language Model Applications lists common application risks, including sensitive information disclosure and excessive agency. MITRE ATLAS catalogues adversary behaviours and mitigations for AI-enabled systems. Use OWASP to check whether your plan covers relevant risk categories. Use ATLAS to identify which system boundaries need verification.
Running a Red Team Exercise on Your Assistant
Run an authorised exercise in a test environment that preserves the application’s security controls and replaces live data and tools with safe substitutes. Assign security staff to run the exercise and engineering staff to monitor the test environment. Involve privacy or domain specialists when they can assess potential harm. Name the person who owns the release decision and the operator who can stop the exercise.
- Set the scope and harms. Write down which version, test environment and user roles are in scope. Define outcomes that block release, such as disclosure across user roles or a high-impact action without approval. Set stop conditions for unexpected access or data movement.
- Write the test cases. For each case, describe what the control must prevent and the evidence that would show a pass. Use synthetic records, test-only accounts and harmless canaries, which are distinctive markers that make a disclosure observable. Use simulated tools that record attempted actions without sending messages or changing real records.
- Run manual and automated checks. Have a tester review the interactions and traces for failures that depend on context. Replay the approved inputs automatically to compare the results with the expected outcomes. Review tool logs independently of what the assistant says it did.
- Score and record what happened. Record the test case, version, user role, expected and observed results, repeat count and supporting evidence. Give each finding a severity based on who could be affected and what the system could expose or change. Assign an owner and keep evidence in a restricted location.
- Contain, fix and retest. Stop the exercise if access crosses the agreed test boundary. If a control fails, restrict the affected capability until the team fixes the control where access or action is decided. Repeat the failed case and a nearby legitimate case to confirm the fix still allows expected use.
For example, suppose a test user can ask about public policies but has no access to a synthetic personnel record. The restricted record contains a fake marker. The test passes when the assistant can answer the public question and the trace shows that the restricted record was never retrieved. If the system retrieves the record, fix the access check at retrieval and verify it again. Hiding the marker in the final answer leaves the underlying access failure in place.
The Australian Signals Directorate’s guidance on securing AI testing environments calls for checking containment against defined actions on designated test resources and independently confirming that the controls worked.
Red Teaming as Part of Each Release
Keep the approved cases as a regression set, a collection of checks that catches the return of known failures. Run it on the candidate version before releasing any change to a model, prompt or tool. Keep the expected results and repeat counts with the cases so reviewers can compare the candidate release with the last approved version. Add cases when a new failure exposes a gap in your AI guardrails.
Set a recurring full exercise based on what the system can access and do. An agent that can change customer records warrants a shorter interval than an internal assistant that can only read approved material. Repeat the full exercise when a change introduces a new trust boundary, such as write access to a system, a new user group or a new source of sensitive data. An incident or a major change to the threat model can also trigger one. For agents used in cyber defence, the Australian Signals Directorate recommends regular red teaming and adversarial testing.
At sign-off, review red-team findings alongside the wider AI security checks. Approve the release only when the evidence shows the controls hold for the cases that would otherwise block it. Keep the reviewed results with the release so the next change starts from a known baseline.
Related reading
What is Prompt Injection? Risks and Defences
Hidden instructions in an email, web page or file can turn an AI assistant against you. See how prompt injection works and which defences hold up.
What Are AI Guardrails? Types and Examples
AI guardrails limit what an assistant can say, reveal and do. The main types, worked examples, the tools that apply them and where they fail are all here.
AI Agent Security: Sandboxing and Permissions
AI agents act with real access to your systems. Learn how to sandbox them, limit their permissions, give each agent its own identity and log its actions.
AI Security: Risks, Data Leakage and Controls
Before staff paste client files into an AI tool, know where the data goes. The main AI security risks, how data leakage happens and the controls that work.
embeddings
Embeddings is an Australian AI consultancy. We design, build and run AI systems inside the software, documents and data organisations already use, from offices in Perth and Melbourne.
About Embeddings