How do we…
How do we test an LLM application the way an attacker would?
Add to board memoOpen the memo
The short answer
- Recommendation
- Write a test plan first and send nothing to the feature until the owner and the Head of Information Security have approved it in writing (SR-1). Choose attack classes with a reason for each one left out, log every attempt, and report how many selected classes were tried and how many succeeded.
- Reasoning
- An LLM application reads your instructions and an attacker's words as the same kind of thing, so the tests aim at the system around the model: what it reads, what its output reaches and what it can do. The safety rules keep a test from becoming the incident it looks for: test accounts, marked test data, harmless targets, limits and a named person who can stop it. The most serious cases arrive in content the feature reads, so plant instructions there as well as typing prompts. A test shows what the testers tried and never proves the feature secure.
- Considerations
- At Depth 3 the tester did not build and does not own the feature. At Depth 2 the plan names who tests, and a tester who did not build it is expected (SR-9). At Depth 1 the configuration checks are the test.
- Where a provider owns the model or service, its terms must allow the test or it agrees in writing. A test never reaches its own systems or other customers (SR-2).
- No test releases a payment or changes supplier bank details (SR-5).
- Report counts, never a total, a grade or a colour. A clean result lists what was not tried.
The decision, step by step
Select any step for the reasoning behind it and where the pack covers it.
- Start
- Step
- Decision
- Outcome
- Loop back
Keyboard: Tab to a step, arrow keys move along the flow, Enter pins its explanation, + and − zoom, 0 fits the diagram, Esc closes. The text version below has the same content.
Where a step quotes a number, it is the default in the CISO Times pack. Your own standard may set a different one.
Read as text
The same flow written out: each step, its reasoning and where the pack covers it. 19 steps.
Start
An LLM feature is due for an attacker-style test
An LLM application puts instructions and data in one channel, so the model reads your instructions and an attacker's words as the same kind of thing. Tests therefore aim at the system around the model: what it reads, what its output reaches and what it can do. A test shows what the testers tried and never proves the feature secure.
In the pack
- P25-A07 AI Red Team Test Plan TemplateThe idea behind the tests
- P25-A03 LLM Application Security Review ProcedureStage 5 (RP-5): Test
Decision
What review depth has the review set?
At Depth 1 the configuration checks are the test. At Depth 2 the team runs the tests for each selected class under the safety rules. At Depth 3 an independent tester runs them under a written plan. The depth rises with tools, memory, company content above Public and the rule of two. Judgement: if the depth is not known, take Depth 3.
- Depth 3, or not known: Write the plan: one feature, one version, limits, a stop contact
- Depth 2: Write the plan: one feature, one version, limits, a stop contact
- Depth 1: Depth 1: the configuration checks are the test
In the pack
- P25-A03 LLM Application Security Review ProcedureWhat sets the depth
- P25-A03 LLM Application Security Review ProcedureStage 5 (RP-5): Test (rule GS-28)
Outcome
Depth 1: the configuration checks are the test
Complete the configuration checklist with the IT owner and the developer, and keep its result as evidence. A change that raises the depth, such as a new tool or a retrieval source above Public, brings the attacker-style test with it.
In the pack
- P25-A03 LLM Application Security Review ProcedureStage 5 (RP-5): Test
- P25-A03 LLM Application Security Review ProcedureWhat forces a new review
Step
Write the plan: one feature, one version, limits, a stop contact
The tester writes the plan. Name the feature at one version and one configuration, the window, the environment, the test accounts and the marked test data. Set limits on requests, tokens and spend, and name one person who can stop the test and switch the feature off. Use harmless targets such as a test mailbox and a dummy payee. No test releases a payment or changes supplier bank details. The standard requires an independent tester at Depth 3 and expects a tester who did not build the feature at Depth 2 (SR-9). At Depth 2 the plan names who tests, and the approvers check independence.
In the pack
- P25-A07 AI Red Team Test Plan TemplateScope and rules of engagement
- P25-A07 AI Red Team Test Plan TemplateSafety and data handling rules (rules SR-3, SR-5, SR-6, SR-9)
- P25-A07 AI Red Team Test Plan TemplateRoles
Decision
Do the provider's terms or a written agreement allow the test?
Where a provider owns the model or the service, its terms must permit the test or it must agree in writing. A test never reaches the provider's own systems or other customers. Procurement asks for the agreement where the terms do not already allow the test. Answer yes if no provider is involved. If you do not know what the terms say, answer no.
- Yes, or no provider: Select attack classes, with a reason for each one left out
- No, or not known: Do not start: get the provider's written agreement first
In the pack
- P25-A07 AI Red Team Test Plan TemplateSafety and data handling rules (rule SR-2)
- P25-A07 AI Red Team Test Plan TemplateRoles
Outcome
Do not start: get the provider's written agreement first
The test does not start while the permission is outstanding. In the pack's example the request to the provider was sent on 29 Sep 2026 and had not been answered, so the safety rule was not met and the test could not start. Procurement asks again. Judgement: do not test any part of the provider's service until it permits.
In the pack
- P25-A07 AI Red Team Test Plan TemplateEXAMPLE: where the chatbot test stands
- P25-A07 AI Red Team Test Plan TemplateApproval of the plan
Step
Select attack classes, with a reason for each one left out
The Head of Information Security selects the classes and the tester checks the choice. The twelve classes are direct and indirect prompt injection, sensitive information disclosure, excessive agency, supply chain, poisoning, unbounded consumption, misinformation, hidden context exposure, vector and embedding weaknesses, improper output handling, and poisoned memory and tool descriptions. Some apply only with tools, retrieval, memory or output that reaches another component. A class is not left out because it is hard or the feature looks small. Judgement: when you cannot tell whether a class applies, select it.
In the pack
- P25-A07 AI Red Team Test Plan TemplateAttack classes
- P25-A07 AI Red Team Test Plan TemplateSelection for this feature (rule RR-2)
- P25-A03 LLM Application Security Review ProcedureStage 2 (RP-2): Select threats
Decision
Has the owner and the Head of Information Security signed the plan?
Nothing is sent to the feature until both approve the plan in writing. Before they sign they check the tester's independence, the provider's permission, the environment, the data rules, the limits, the list of classes and the incident route. The tester signs too.
- Yes: Run the tests and log every attempt, including what it reads
- No: Send nothing: get the plan signed first
In the pack
- P25-A07 AI Red Team Test Plan TemplateApproval of the plan (rule SR-1)
Outcome
Send nothing: get the plan signed first
A test run before approval is not covered by the plan, its limits or its stop contact. Change the plan until the approvers can sign it. If a safety rule cannot be met, the test does not start until the owner and the Head of Information Security have changed the plan and approved it again.
In the pack
- P25-A07 AI Red Team Test Plan TemplateSafety and data handling rules (rule SR-1)
- P25-A07 AI Red Team Test Plan TemplateApproval of the plan
Step
Run the tests and log every attempt, including what it reads
Plant marked instructions in the documents, pages, emails, tickets and tool results the feature reads, as well as typing prompts, because the most serious cases arrive in content. Record the time, class, exact input, exact output, result and whether real data was seen. Stop at any limit and tell the stop contact. Keep the log where only the owner and the stop contact can read it.
In the pack
- P25-A07 AI Red Team Test Plan TemplateRunning the test and recording it (rule SR-7)
- P25-A03 LLM Application Security Review ProcedureStage 5 (RP-5): Test
Decision
Did a test expose real sensitive data or have a real effect?
Marked test data should be all the tester sees. Anything real that is seen is reported at once and not kept. If a test exposes real sensitive data or has a real effect, stop. Judgement: if you are not sure whether what was seen is real, answer yes.
- Yes, or not sure: Stop, keep the evidence and report through the incident route
- No: Has every selected attack class been tried?
In the pack
- P25-A07 AI Red Team Test Plan TemplateIf a test finds something real (rules SR-4, SR-8)
Outcome
Stop, keep the evidence and report through the incident route
Report an event at once through the incident route. The incident pack decides whether it is an incident and whether anything must be reported, and the reporting pack holds the clocks. The incident pack sets the order (P09 IM-07). Where harm can still spread, such as a feature that can still act on content it read, made an unusual tool call or acted without the approval required, contain first by switching its access off and capture what you can in the same step. Otherwise keep what was seen as it was received, then switch off. Judgement: the owner and the Head of Information Security decide when the test resumes, after the incident route has finished with the evidence.
In the pack
- P25-A07 AI Red Team Test Plan TemplateIf a test finds something real (rules SR-8, EP-01 to EP-10)
- P25-A02 Generative AI Security StandardSignals to watch and evidence to keep
Decision
Has every selected attack class been tried?
A class that was selected and not tried is listed with the reason and is not counted as tried. A class cannot succeed unless it was tried, and a result for a class that was not selected is an error in the plan. Try the remaining classes within the window. If one cannot be tried, the report names it and gives the reason.
- Yes: Did any attack class succeed?
- No: continue: Run the tests and log every attempt, including what it reads (back to an earlier step)
- No, and it cannot be tried (report why): Did any attack class succeed?
In the pack
- P25-A07 AI Red Team Test Plan TemplateHow a result is counted
Decision
Did any attack class succeed?
A class succeeded when the tester tried it and the fixed success criterion was met, for example the feature acted on instructions that came only from content it read. Do not soften a criterion to make a result look better, and do not harden it to find more. A class that did not succeed says what the attempts showed. It does not show the feature cannot be attacked this way.
- Yes: Record the finding with steps to repeat it, and rate it
- No: Report counts: classes tried of selected, and how many succeeded
In the pack
- P25-A07 AI Red Team Test Plan TemplateSuccess criteria and results
- P25-A07 AI Red Team Test Plan TemplateAttack classes
Step
Record the finding with steps to repeat it, and rate it
Write the steps so someone else can repeat them; a problem that cannot be repeated is noted and watched, and is not rated. Name the requirement it breaks and the threat, and propose an impact and a likelihood from 1 to 4. The Head of Information Security rates the finding and sets the severity, which gives the due date, and the finding goes in the register. The owner agrees the fix. If the fix cannot be made by the due date, the owner asks for an exception before it.
In the pack
- P25-A07 AI Red Team Test Plan TemplateFindings
- P25-A03 LLM Application Security Review ProcedureWhat happens to a finding
Decision
Has every finding's fix passed its retest?
A finding closes when a retest shows the fix works. Someone other than the person who fixed it repeats the steps exactly, then tries the same class by other routes. A fail returns the finding to open. Answer yes if the test raised no finding.
- Yes, or no finding: Give the report to the release decision and set retest triggers
- Not yet: Send the report on; the findings follow their fix dates
In the pack
- P25-A07 AI Red Team Test Plan TemplateRetest (rule RR-8)
- P25-A03 LLM Application Security Review ProcedureWhat happens to a finding (rule F-5)
Step
Report counts: classes tried of selected, and how many succeeded
Write the count as 'n of m selected attack classes tried; n succeeded'. Name each class that succeeded and each one not tried. Say what the feature did well, what could not be tested, and why a clean result does not show the feature is secure. Include a retest plan for each finding. Send the report to the owner and the Head of Information Security together. Never write a total, a grade or a colour.
In the pack
- P25-A07 AI Red Team Test Plan TemplateReporting (rule RR-1 to RR-8)
- P25-A07 AI Red Team Test Plan TemplateHow a result is counted
Outcome
Send the report on; the findings follow their fix dates
Give the report to the release decision now, with each finding in the register. Each finding follows the fix date its severity sets, and stays open until a retest passes. A fix that cannot meet its date needs an exception from the approver its band sets, and a Critical one goes to the board or its equivalent.
In the pack
- P25-A03 LLM Application Security Review ProcedureWhat happens to a finding (rules F-5, F-6)
- P25-A03 LLM Application Security Review ProcedureThe release gates (rules RG-3, RG-4, RG-5)
Outcome
Give the report to the release decision and set retest triggers
At Depth 3 the release gate holds the release until the independent report is received and its findings are in the register. Retest the classes a change could affect when the model, model version, system prompt, tool, retrieval source or filter setting changes, when a provider gives notice of a new model, and when a signal is confirmed in use.
In the pack
- P25-A03 LLM Application Security Review ProcedureThe release gates (rule RG-5)
- P25-A07 AI Red Team Test Plan TemplateRetest (rules GS-18, GS-28)
Practical checklist
- Confirm the review depth, taking Depth 3 if it is not known.
- Write the plan: one feature at one version, the window, environment, test accounts, marked test data, limits and a stop contact.
- Get the provider's permission in writing where its terms do not already allow the test.
- Select attack classes, selecting any you cannot rule out, with a reason for each one left out.
- Have the owner and the Head of Information Security sign the plan before anything is sent.
- Run the tests in content the feature reads and in user input, and log every attempt.
- Stop and report through the incident route if a test exposes real data or has a real effect.
- Record each success so it can be repeated, rate it, and retest after the fix.
Evidence to have ready
- The signed test plan showing how each safety rule is met.
- The provider's written permission, where a provider owns the model or service.
- The class selection with reasons for each class left out.
- The attempt log with time, class, exact input, exact output and result.
- The report with classes tried of selected and how many succeeded, each finding with its repeat steps, and the retest results.
Assumptions
- The feature has been through the review procedure, which has set its review depth, and the AI use has not been stopped under P24.
- At Depth 3 the tester did not build and does not own the feature. At Depth 2 the team tests with the same safety rules, a tester who did not build the feature is expected, and the plan names who tests.
- You can test in a test environment with test accounts and marked test data, or you will say in the plan why production is needed.
- Where a provider owns the model or the service, its terms allow the test or it agrees in writing. The OWASP and MITRE ATLAS lists behind the attack classes are community sources, not law.
Not covered here
- How to defend the application against prompt injection. That is “How do we defend an LLM application against prompt injection?”.
- The whole review before go-live, of which this test is one stage. That is “How do we review an LLM feature or an AI agent for security before it goes live?”.
- What to do when real data leaks or the feature is manipulated in use. That is “If an LLM application leaks data or is manipulated into a harmful action, then what do we do?”.
- How to track findings and the deviations you accept. That is “How do we track AI security findings and the deviations we accept?”.
Related questions
- How do we review an LLM feature or an AI agent for security before it goes live?
- How do we defend an LLM application against prompt injection?
- What should an AI agent be allowed to do on its own, and what needs a person's approval?
- If an LLM application leaks data or is manipulated into a harmful action, then what do we do?
- How do we track AI security findings and the deviations we accept?