TestUnity LLC
    TestUnity LLC

    Securing Technology, Empowering Innovation

    All articles
    AI SecurityLLMRed Teaming

    AI Red Teaming: How to Actually Test an LLM Application

    TestUnity Security Team8 October 20269 min read

    Most teams shipping an AI feature know they should test it. Fewer know what that testing actually looks like. "AI red teaming" gets used loosely — sometimes it means running a checklist against the OWASP Top 10 for LLMs, sometimes it means a single afternoon of trying a few jailbreak prompts. Neither is what the term describes. Here's what a real AI red-teaming engagement involves, how it differs from both a standard penetration test and a compliance checklist, and how to scope one properly.

    Red teaming vs. checklist testing

    A checklist test asks: "does this application have known category-X weaknesses?" It's valuable and necessary, but it's static — it tests against a known list, not against an adversary adapting to your specific system.

    AI red teaming asks a different question: "what can a motivated, creative attacker actually make this model do?" It's an adversarial simulation, not an audit. A red teamer doesn't stop at confirming a model refuses an obviously malicious prompt — they iterate: rephrasing, encoding, role-play framing, multi-turn escalation, and combining weak findings into a working exploit chain. The output isn't a list of categories; it's a set of reproducible transcripts showing exactly how the model was manipulated and what it did as a result.

    What a red team actually probes

    System prompt and instruction extraction. Can the model be made to reveal its system prompt, hidden instructions, or internal tool definitions? Even if the prompt contains no secrets, extraction often reveals exploitable detail about how the application is wired together.

    Guardrail bypass. Most production LLM apps sit behind content filters or refusal training. Red teamers test whether those guardrails hold under adversarial phrasing — translation tricks, fictional framing, token-level obfuscation, and multi-step prompts that each look benign individually but combine into a disallowed outcome.

    Excessive agency abuse. If the model can call tools, trigger workflows, or take actions, the real question is what an attacker can make it do, not just say. This is where prompt injection becomes dangerous in practice: a hijacked model with access to send email, query a database, or move funds is a very different risk than a hijacked model that can only produce text.

    Indirect injection via untrusted content. Many LLM apps read content the model wasn't designed to treat as instructions — a web page, an uploaded document, an email, a retrieved chunk in a RAG pipeline. Red teamers plant instructions in that content and see whether the model obeys them over its actual system instructions.

    Data leakage under pressure. Can the model be coaxed into revealing other users' data, training data artefacts, or information it was told to withhold? This matters most for multi-tenant products and anything handling regulated data under the UAE PDPL or GDPR.

    Output-handling exploitation. If model output flows into a shell, a database query, a browser render, or another system without validation, testers try to steer the model into producing a payload that exploits whatever receives that output.

    Scoping an engagement properly

    A red-teaming engagement needs more upfront definition than a web app pentest, because "the target" is behavioural, not a fixed set of endpoints. A proper scope defines:

    • The threat model. Who is the realistic adversary — an anonymous end user, an authenticated but malicious customer, or someone who controls content the model ingests (a document, a web page)? Each implies different attack paths.
    • What "success" looks like for the attacker. Jailbreaking the model into saying something embarrassing is a low-severity finding. Getting it to leak another tenant's data, execute an unauthorised tool call, or produce a working exploit payload is high-severity. Agree on severity criteria before testing starts, not after.
    • What's off-limits. Testing against a production environment with real customer data needs clear rules — most engagements run against a staging environment seeded with synthetic data that mirrors production structure.
    • How many turns and how much iteration is in scope. A single-prompt test and a sustained multi-turn adversarial conversation surface different vulnerabilities; budget for the latter if the application supports ongoing conversations.

    Where this fits with other testing

    AI red teaming doesn't replace standard application security testing — it sits alongside it. The infrastructure around your model (the API layer, authentication, the vector store if you're running RAG) still needs conventional web and API testing. Red teaming covers the part those tests structurally can't reach: the model's own behaviour under adversarial pressure. Teams that run only a standard pentest and skip AI-specific testing routinely ship LLM features with no adversarial testing of the one component most exposed to manipulation.

    Acting on the findings

    A red-teaming report is only useful if it changes the system, not just the prompt. The common mistake is patching every finding by adding another line to the system prompt ("don't do X"). System-prompt patches are brittle — they're bypassed by the next rephrasing, and the prompt itself can leak. Durable fixes live in code: input/output filtering, tool-call permissioning, rate limits, and architectural separation between untrusted content and instructions. Treat the system prompt as a behavioural nudge, never a security boundary.

    FAQ

    How is AI red teaming different from a normal penetration test?

    A standard penetration test looks for technical vulnerabilities in infrastructure, code, and configuration. AI red teaming adversarially probes the model's behaviour — manipulating it through conversation and crafted input rather than exploiting a code-level flaw. Both are needed for a complete picture of an AI application's risk.

    Does AI red teaming replace OWASP LLM Top 10 testing?

    No — they complement each other. The OWASP Top 10 for LLMs gives you the categories of risk to cover; red teaming is the adversarial method for actually testing whether your specific application is vulnerable to them in practice, including combinations the checklist doesn't anticipate.

    How long does an AI red-teaming engagement take?

    It varies with the application's complexity and how much agency the model has (plain chatbot vs. one with tool access). A focused engagement typically runs one to three weeks, covering scoping, adversarial testing across multiple sessions, and a report with reproducible transcripts and remediation guidance.

    Can automated tools do AI red teaming on their own?

    Automated scanners can run a library of known jailbreak prompts quickly and cheaply, which is useful for regression testing after changes. They don't replace human testers for novel exploit chaining, multi-turn escalation, or reasoning about what a specific application's unique tool access makes dangerous — the creative, adaptive part of red teaming still needs a person.

    Test your AI application properly

    TestUnity runs LLM security testing and AI red teaming for UAE organisations shipping chatbots, copilots, and agentic AI features. Talk to our AI security team before your next release.