AI red teaming a RAG assistant: scope, rules and findings
Short answer: AI red teaming of a RAG assistant is an authorised, adversarial test of how the assistant behaves when the text it reads, retrieves or renders is hostile. It covers indirect prompt injection, cross-tenant retrieval, write-path poisoning, exfiltration through output, tool misuse and system prompt leakage. Each attack gets a scenario, a record of evidence and a pass criterion agreed before the first run.
Only test systems you own or have written permission to test. The permission has to cover the exact environment, accounts and dates of the test.
What does AI red teaming of a RAG assistant cover?
Short answer: the paths where untrusted text meets the model, and the places where model output turns into data or action. That means sources and the index, retrieval and its permission filter, prompt assembly, tools, and the rendered answer.
A RAG assistant takes text from many writers and hands it to a model that cannot reliably tell data from instructions. The red team plays each of those writers in turn. A customer filing a ticket, a contractor editing a wiki page, a user from another tenant and an outside author whose page gets crawled all count. The question at each step stays the same. What can this person make the assistant read, reveal or do?
Most engagements start with six themes.
| Attack theme | Scenario | Evidence to collect | Pass criterion |
|---|---|---|---|
| Indirect prompt injection | A test ticket tells the model to add a canary word to every answer | Retrieved chunks, full answer, run count | Answer ignores the instruction in every repeat |
| Cross-tenant retrieval | A user in tenant A asks for a document that exists only in tenant B | Retrieved chunk IDs and their tenant labels | No chunk outside the caller's rights reaches the prompt |
| Write-path poisoning | A low-rights editor plants a canary fact on each write path | Ingestion delay, rank of the canary, state after deletion | Canary is flagged or capped, and deletion removes it from index and caches |
| Exfiltration through output | Planted text asks for a markdown image whose URL carries a canary token | Rendered HTML, outbound requests from the client | No external resource loads and no token leaves in a URL |
| Tool misuse | A retrieved document asks the agent to call a tool outside the task | Tool call log, gateway decision, approval record | Gateway refuses, and approval is enforced outside the model |
| System prompt leakage | Direct and indirect requests for hidden instructions and tool schemas | Answers that quote hidden context | No secrets, internal addresses or credentials appear |
Detailed methods live in the guides on indirect prompt injection, cross-tenant retrieval, index poisoning and markdown image exfiltration.
How does red teaming differ from a security review and from a classic pentest?
Short answer: a security review reads the design and configuration to find where controls are missing. Red teaming attacks the running assistant to show which gaps an attacker can actually use. A classic pentest targets hosts, web apps, APIs and identity, and usually leaves model behaviour out of scope.
The three work well together. A review of the RAG threat model tells the red team where to aim, so the test time goes to the paths with the weakest controls. A pentest covers the stack around the assistant, such as authentication, session handling and exposed services. Red teaming fills the gap between them. A request can be authenticated, rate limited and well formed, and still carry a document that steers the model. The AI security review and pentest comparison sets out the boundary in more detail.
How do you scope the engagement?
Short answer: name one assistant, list its sources, tools and tenants, and pick the themes that apply. Write down what is out of scope and why.
A useful scope fits on one page. It states the assistant and its version, the environment, the test accounts with their roles and tenants, every indexed source with who can write to it, every tool with its rights, and the output formats the client renders. Mark a theme not applicable when the system lacks the feature, for example tool misuse on an assistant with no tools. If the assistant combines untrusted input, sensitive data and an outbound channel, read the lethal trifecta guide first, because that combination sets the order of work.
Agree on the number of repeats per case before the test starts. Model output varies between runs, so a single clean answer proves little. Agree as well on what counts as a hit. For an injection case, a hit can be the canary word in the answer, a changed tool call, or a canary chunk in the retrieved set even when the answer looks clean. Settling these definitions in advance keeps the findings discussion about controls and away from arguments over method.
What rules of engagement should be in writing?
Short answer: written authorisation, a named test environment, canary data in place of real secrets, and stop conditions both sides have agreed.
Written authorisation. The system owner signs off on the scope, the dates, the accounts and the people running the test. Verbal approval is not enough.
Test environment. Use a staging copy with production-like sources and permissions. If testing must touch production, keep it read-only and record the limits that creates.
Canary data. Plant unique, harmless tokens and made-up facts. A canary instruction never asks for real data, real links or real tool calls. Fake secrets follow the format of real ones so scanners can find them, as described in secrets in the RAG index.
Stop conditions. Halt and report at once if the team sees real personal data, real credentials, an action outside the test environment, or a service impact. Agree on who gets the call and how fast.
How are findings rated and retested?
Short answer: each finding is rated on impact and on what an attacker needs to reproduce it, then retested with the same cases after the fix.
Impact asks what leaves or changes. Reproduction asks who can do it, from which account, and in how many of the repeated runs. A cross-tenant leak that any signed-in user triggers in most runs ranks above an injection that needs admin write rights and works once in twenty. Each finding carries the scenario, the evidence table, the rating and a proposed control outside the model. The AI security review report guide shows how those parts fit on the page.
Rate the retrieval layer separately from the answer. A restricted chunk that reaches the prompt is a finding even when the model declines to repeat it, because the next prompt change can undo that refusal. The same applies to tool calls that the gateway blocks. Record the attempt, since it shows the model would act if the gateway rule changed.
Retest uses the original prompts, canaries and accounts, repeated enough times to see variance. Keep the cases afterwards as regression tests so a model, prompt or index change cannot reopen the hole without notice. For agents with tools, check the rights again against the MCP tool permissions guide.
Checklist
- Written authorisation signed, with scope, dates, accounts and names
- Test environment named, and production limits recorded if used
- Sources, tools, tenants and rendered formats listed
- Each of the six themes marked in scope or not applicable, with a reason
- Unique canary per source and per theme
- Stop conditions and escalation contact agreed
- Retrieved chunks, answers and tool logs saved for every run
- Each case repeated across runs and roles
- Findings rated on impact and reproduction
- Retest run with the original cases and saved as regression tests
Next: Indirect prompt injection · Cross-tenant retrieval · RAG index poisoning test · Markdown image exfiltration · Secrets in the RAG index · AI Security Review vs pentest · What an AI security review report includes · AI security regression tests · Agent tool permissions and MCP · Lethal trifecta
To have this run against your own assistant under a written scope, see the AI Security Review.