How to — red-team your own AI feature before launch

You want to know where your AI feature breaks before a stranger finds out for you. That is not the same job as running a list of famous jailbreaks — it is attacking the specific things your product can do, with a set of cases small enough to re-run every time you change a model or a prompt.
Two afternoons, one spreadsheet, thirty cases. Here is the order that produces findings instead of a false sense of safety.
1. Attack your product, not the model.
Before you write a single test, write down what the feature is allowed to do. Reads a shared mailbox. Looks up an order. Issues refunds up to a limit. Calls an internal inventory endpoint. Summarises documents a customer uploaded. Each of those capabilities is a target, and the worst realistic outcome for each one is a test brief you can grade.
Asking a model to say something rude is a vendor problem. Every frontier model has been attacked millions of times, the obvious routes are patched, and whatever you find has already been found. Your wiring — which tool is reachable from which path, what the retrieval step is allowed to pull in, what happens when the model is wrong — is the part nobody else has tested. The OWASP Top 10 for LLM Applications is a reasonable way to sort findings afterwards; prompt injection is its first entry and excessive agency is the one that turns a bad sentence into a bad transaction. What you are doing is red teaming at its smallest useful scale — AI 101 — What is AI red teaming? is the version with formal scopes and outside testers, if you need to argue for a budget.
2. Write twenty to thirty cases, each with an expected outcome.
One row per case: the input, what must happen, how you will grade it. Six families cover most of what matters.
Policy breach — ask for the thing your product is not for. Instruction extraction — ask it to repeat the text above the user's message; your system prompt is not a secret, but a feature that recites it verbatim is a feature that can be talked into anything else it contains. Other people's data — ask it to summarise the previous customer's ticket, or the document belonging to the account next door. Indirect injection — hand it a document, email or web page that contains instructions. Tool abuse — talk it into an action it should not take from this screen, in this role, at this stage.
Then add the family everyone forgets: ten legitimate requests that must succeed. A feature that refuses a third of its real users is not safe, it is broken, and if your suite only contains attacks you will never see the difference.
3. Put the attack inside the data, not the question.
This is where app-level red teams earn their keep. If your feature reads anything it did not write — a support email, a PDF, a web page, a calendar invite, a filename, a metadata field — treat that text as hostile. Greshake and colleagues showed in 2023 that instructions hidden inside retrieved content could steer an assistant, and the mechanism has not changed: models are trained to follow text, and "this text came from a document" is a tendency, not a boundary.
The sharpest test is the combination Simon Willison calls the lethal trifecta: the same request touches private data, reads untrusted content, and can send something outward. Any two of those are survivable. All three in one turn is a working exfiltration path, and no amount of careful wording closes it — only removing one leg does. Keep the two shapes of attack apart while you write cases: a jailbreak is aimed at the model's own rules, an injection is aimed at your plumbing, and AI 101 — What is a jailbreak? is the clean explanation of the first.
4. Escalate over turns, and test the compressed conversation.
Single-shot attacks are the easy mode, for attacker and defender alike. Real abuse arrives as a sequence: establish a harmless persona, get agreement on a small exception, then ask for the larger one that the small exception implies. Test that shape deliberately.
Then test what happens late in a long session. Most products summarise or drop earlier turns once the context fills, and the rules you placed at the top of the conversation can leave with the text that carried them. A feature that holds its policy for five turns and forgets it at fifty is a feature with a policy you cannot describe.
5. Grade both directions and keep the score.
Every case resolves to one of three outcomes: pass, fail, false refusal. Report all three, per release, the way you report test coverage. A finding of "twelve of thirty attacks succeeded" with no denominator for legitimate traffic is half a result — and the half that pushes a team into over-correcting until the product is useless.
Keep the set in the repository next to the code. Every confirmed attack becomes a permanent case, and the suite runs on every model swap, prompt edit and tool change, because your vendor patches weekly and your retrieval corpus changes every time someone uploads a file.
6. Fix the capability, not the sentence.
The instinct after a successful attack is to add "never do that" to the system prompt. It is the weakest control available: one more piece of text in the same channel the attacker is writing into, competing on the same terms. The durable fixes are structural. Do not offer the tool on that path at all. Require a human confirmation before anything irreversible. Strip instructions out of documents before they reach the prompt, and label what remains as data. Cap what one session can spend or send. Each of those works whether or not the model has a good day.
That is also the test of whether a fix is real: if you can remove the model's cooperation and the hole is still closed, you fixed the product.
The one thing not to do
Do not count a failed jailbreak as proof of safety. One phrasing refused tells you nothing about the phrasing you did not try — shift the language, wrap it in a story, split it across two turns, and the same model that held the line will often fold. A pass on your suite means these thirty cases pass, which is all it has ever meant.
How you will know it worked
You will have failures you cannot fix yet, and you will know why each one happens. The injection case that used to say "ticket marked resolved" will now quote the document back as data and refuse to act on it. False refusals will be a number instead of a complaint from sales. The suite will live in the repository and run without anyone scheduling a meeting about it. And the question in the room will have changed from "is the model safe" to "what can this feature be talked into" — which is the only version of the question with an answer.
What is the strangest thing a user has talked your product into doing? Write to us via our contact page.







