Method · 3 min read
AI red teaming: how I test LLM applications and agents
What I look for in LLM applications, model APIs and tool-using agents, how an engagement runs from scope to retest, and what makes a finding worth fixing.
By Kursad AlsanPublished 3 min read
- AI red teaming
- Prompt injection
- Agents
- Methodology
- kinds of target
- 3
- attack classes
- 6
- steps, scope to retest
- 5
The short version
- I test three kinds of target: LLM applications, the model APIs behind them and agents that act through tools.
- An injected instruction matters when it reaches data or a tool, so I test the whole chain, not just the prompt.
- A finding is only useful if it reproduces: the exact prompts and requests, the model's behavior and the impact, then a retest after the fix.
AI red teaming is adversarial testing of AI systems: attacking them the way a real adversary would, under agreed rules, to find what breaks before someone else does. My work combines prompt injection and jailbreak testing with the web and API security research I have done since 2014. This is how I approach it.
What I test
The target is rarely just a model. It is an application built around one: a system prompt, retrieved documents, tools, memory and an API in front of it all. Each of those is attack surface.
Prompt injection
Input that overrides the system prompt or the developer's intent, typed straight into the app.
Indirect prompt injection
Instructions hidden in content the model reads: documents, web pages, emails or tool output. The user never sees them; the model does.
Jailbreaks and safeguard bypass
Getting the model to produce what its safeguards are meant to stop, through role play, encoding or pressure across many turns.
Tool abuse
Agents act through tools. Can attacker-influenced input make an agent call a tool it should not, or with arguments it should not use?
Data leakage
System prompts, other users' data, retrieval sources and secrets that end up in a response or a log.
Sandboxing and containment
Where an agent runs code or touches files, does the sandbox actually hold it?
Model APIs are still APIs, so the classic checks apply too: authentication, and authorization on every object a request can name. IDOR/BOLA does not go away because the client is a chatbot; it is the same class of bug I reported to Grafana.
How an engagement runs
- Scope and rulesauthorized targets, safety limits
- Map the systemmodel, tools, data, trust boundaries
- Attack and chaindirect, indirect, multi‑step
- Evidence and reportreproducible, with remediation
- Fix and retestuntil the finding is closed
Mapping is where most of the work hides. I draw the trust boundaries: what the model can read, what it can call, with whose permissions, and where its output goes next. Every arrow that crosses a boundary is a test case.
An attack path, step by step
A single injected instruction is rarely the finding on its own. What matters is where it leads. This is the shape of a typical indirect prompt injection against a tool-using agent:
- PlantInstructions hidden in a documenta page, file or email the agent will readattacker in control
- RetrieveThe agent reads itas part of an ordinary user task
- HijackThe model follows the injected textinstead of the user's requestattacker in control
- ActA tool call with attacker-chosen argumentssend, fetch or writeattacker in control
- ImpactData leaves, or an action runswithout the user's intent
An illustration of the pattern, not a client finding.
Each hop is a place to break the chain: treat retrieved content as data, not instructions; give every tool the least privilege it needs; and ask a person to confirm sensitive actions. A good report names the hop where the fix belongs.
Evidence that reproduces
Model output varies from run to run, so a single screenshot is weak evidence. For every finding I capture:
- The exact prompts and inputs, including any content planted for indirect injection.
- The requests and responses at the API level, not only the chat window.
- The model's behavior, and how often it repeats across runs.
- The impact, in one sentence a product owner can act on.
I script the repeatable parts in Python and Bash and run them in isolated Docker and Linux environments, so a retest is the same test, not a new one.
Authorized and scoped
All of this runs under agreed rules of engagement and safety constraints, against systems I am authorized to test.
Fix, then retest
A report is only useful if the fix holds. I pair every finding with remediation guidance, work with the engineering team on the change and retest until the finding is closed.
In November 2026 I earned OffSec's AI Red Teamer certifications, OSAI and OSAI+, from the Advanced AI Red Teaming course (AI-300).