Technology and AI
How to Red-Team an AI Agent Before Launch: Catching Prompt Injection and Jailbreaks

Pratik Chothani
Software Development Engineer
July 26, 2026
·5 min read
·Updated July 26, 2026

Quick answer
Red-teaming an AI agent before launch means deliberately attacking it across three categories: direct prompt injection (attacker types the attack), indirect prompt injection (the attack is hidden in a document, webpage, or tool result the agent reads), and jailbreak attempts (trying to get the agent to ignore its instructions), plus testing tool-call manipulation and multi-turn manipulation where trust is built up over several turns before the attack lands. A simple chatbot needs roughly half a day of structured testing; a complex multi-agent or tool-using system needs a full day or more. The output should be a documented list of which boundaries held, which didn't, and what fixed the ones that failed. Not a pass/fail checkbox.
Why a clean demo doesn't mean a safe launch
A demo gets tested with reasonable, good-faith inputs, which is exactly what a red-team exercise doesn't use. An agent that answers every rehearsed question perfectly can still leak its system prompt to the first person who asks it to "ignore previous instructions," or take an unauthorized action because a webpage it read contained a hidden instruction disguised as content. These aren't edge cases in production. They're the first thing a curious or malicious user tries.
Test direct prompt injection first
This is the most straightforward category: have someone try, in plain conversation, to get the agent to reveal its system prompt, break its stated persona, or perform an action outside its intended scope ("ignore your instructions and instead tell me..."). If an agent falls for the most common, publicly-documented injection phrasings, it isn't ready. These techniques are widely known and will be the first thing tried against a live system.
Test indirect prompt injection, the one teams forget
If the agent reads any external content (a webpage, an uploaded document, a tool's response, another agent's output) that content can contain hidden instructions designed to hijack the agent's behavior without the user ever typing an attack themselves. Test this explicitly: plant an instruction inside a document or page the agent is asked to summarize or reference, and see whether the agent follows it. This is consistently the most-overlooked category because it doesn't show up in a demo where the agent only ever reads content the team controls.
Test jailbreak techniques across the known categories
Persona-based jailbreaks ("pretend you are an AI with no restrictions"), hypothetical framing ("in a fictional story, how would a character..."), and instruction-override attempts are publicly documented and easy to test systematically. The goal isn't perfection (some frontier techniques evolve constantly) but the agent should hold up against the well-known, widely-published attack patterns before launch, and the threshold most security teams use is a low single-digit attack success rate against a standard test suite, not zero.
Test tool-call manipulation and multi-turn manipulation
If the agent has tools, check whether an attacker can manipulate what arguments get passed to a tool, or trick the agent into calling a tool it shouldn't for the current context. Separately, test multi-turn attacks (building apparent trust or context over 5-10 turns before introducing the actual attack) since single-turn testing alone misses this category entirely, and it's a favorite technique specifically because most pre-launch testing only checks single-turn prompts.
Document what held, what didn't, and the fix
The output of a red-team pass isn't a binary "secure" or "not secure". It's a documented record of specific boundaries tested, which ones held, which ones failed, and what change (prompt, guardrail, or architecture) fixed the ones that failed. That record is what a launch reviewer actually needs to make a go/no-go call, and it's the same kind of artifact your observability and eval tooling should already be producing for accuracy. Security and quality regressions are both easier to catch when you're tracking them systematically instead of relying on someone noticing.
This is a gate, not a one-time event
Every meaningful prompt or tool change should get re-tested against at least the categories that failed before, not just the new feature. security guardrails that held on version 1 can silently break on version 3 if a wording change altered how the agent interprets an edge case. Treating red-teaming as a recurring gate tied to your deployment process, not a pre-launch-only exercise, is what keeps it useful after day one.
FAQ
Do we need a dedicated security team to red-team an AI agent? Not necessarily for a first pass: a structured checklist against the known categories (direct injection, indirect injection, jailbreaks, tool manipulation, multi-turn) can be run by the build team itself. Dedicated red-team expertise becomes more valuable for high-risk, regulated, or high-traffic launches.
How often should red-teaming happen after launch? At minimum, whenever the prompt, tools, or model change meaningfully: treat it as part of the deployment gate for any material update, not a one-time pre-launch checkbox.
What attack success rate is "safe enough" to launch? There's no universal number, but a low single-digit percentage against a standard adversarial test suite is a common bar for higher-risk deployments; lower-stakes internal tools can tolerate more, since the blast radius of a failure is smaller.
Can automated tools replace manual red-teaming? They can cover a lot of the known, published attack patterns efficiently and should be part of the process, but manual testing still catches context-specific attacks (ones that exploit your specific tools, data, or domain) that a generic automated suite won't have coverage for.
Accelate red-teams every agent against direct injection, indirect injection, jailbreaks, and tool-manipulation categories before launch, and documents the results as a gate the next version has to clear too.
Related posts