16 minute read

“We ran our standard pen test methodology against the LLM. The report came back clean. Two weeks later, a customer extracted every system prompt.”

TL;DR

Traditional pen testing methodology breaks down against LLM applications. The attack surface is natural language, outputs are probabilistic, and most vulnerabilities can’t be patched with code. This playbook covers scoping, the five attack categories that matter, tooling (Garak, PyRIT, DeepTeam, Promptfoo), when automated testing works versus when you need humans, and how to write findings that engineering teams can actually remediate. HackerOne counted 1,121 programs with AI in scope in its 2025 report, up 270% year-over-year (HackerOne). For the threat model that should inform your scoping, see The privilege escalation kill chain.


A security red-team workbench with logic analyzer and organized probe cables

Why doesn’t traditional pen testing work for LLMs?

A web app pen test has a clear playbook: enumerate endpoints, fuzz inputs, test authentication, check for injection, verify authorization. The attack surface is finite and well-characterized. Findings are deterministic and reproducible. Fixes are code changes.

LLM red teaming breaks every one of those assumptions.

The attack surface is infinite. The input to an LLM is any natural language string. You can’t enumerate all possible inputs. You can’t fuzz effectively because minor phrasing changes produce wildly different results. The space of possible attacks is the space of all possible sentences, which is unbounded.

Results are probabilistic. Run the same prompt against the same model ten times and you might get a jailbreak three times. Is that a vulnerability? At what success rate? Traditional severity ratings assume deterministic behavior. CVSS doesn’t have a field for “works 30% of the time.” That’s why a finding needs a success rate across repeated runs, not a single screenshot.

Remediation is architectural. A SQL injection fix is a parameterized query. A jailbreak fix might require retraining the model, which takes weeks, costs significant compute, and can introduce new failure modes elsewhere. Some findings have no code-level fix at all. The OWASP LLM Top 10 2025 acknowledges this: several entries (LLM01: Prompt Injection, LLM04: Data and Model Poisoning) describe vulnerabilities with no complete remediation path.

MITRE ATLAS catalogs 66 adversarial techniques with 33 documented case studies (as of late 2025), extending the ATT&CK framework specifically for ML systems. It’s the closest thing to a systematic attack taxonomy for LLM red teaming, and it’s still evolving. ATLAS added agent-focused adversarial techniques in October 2025.


How do you scope an LLM red team engagement?

Scope by threat model, not by tool capability. Most failed red team engagements fail because they tested everything the tool could do rather than everything that matters.

Step 1: Map the system. What model? What data does it access? What tools or APIs can it call? What actions can it take in the real world? An LLM chatbot with no tool access is a very different target than an agent with database access, code execution, and email sending.

Step 2: Identify adversaries. External users trying to extract training data? Competitors probing for system prompts? Malicious insiders planting poisoned documents? The adversary determines which attack categories are in scope.

Step 3: Select attack categories. Not all OWASP LLM Top 10 categories apply to every deployment. If you’re using a third-party model via API, training data poisoning (LLM04) is out of scope. If your system has no tool access, excessive agency (LLM06) doesn’t apply. Map your system to the relevant categories:

OWASP LLM 2025 When in scope
LLM01: Prompt Injection Always. Every LLM system.
LLM02: Sensitive Information Disclosure If the system accesses private data or has a system prompt worth protecting
LLM03: Supply Chain If you use third-party models, plugins, or RAG data from external sources
LLM04: Data and Model Poisoning If you fine-tune or curate training/RAG data
LLM05: Improper Output Handling If model output reaches other systems (databases, APIs, rendered HTML)
LLM06: Excessive Agency If the model has tool access or can take real-world actions
LLM07: System Prompt Leakage If the system prompt contains sensitive logic or API keys
LLM08: Vector and Embedding Weaknesses If you use RAG with vector databases
LLM09: Misinformation If the system generates content users rely on for decisions
LLM10: Unbounded Consumption If you need to protect against cost-based or denial-of-service attacks

Step 4: Set success criteria. “We broke the chatbot” isn’t a finding. Define what constitutes a successful attack in business terms: exfiltrated customer PII, executed unauthorized API calls, obtained system prompt, bypassed content policy to generate harmful content. Make it measurable.


What are the five attack categories that matter most?

Five attack categories account for most findings in published LLM red team reports. They’re ordered here by how often they produce actionable results, not by theoretical severity.

1. Prompt injection (direct and indirect). Still the highest-yield attack category. Direct injection: craft inputs that override the system prompt. Indirect injection: plant malicious instructions in data the AI retrieves. HackerOne reported a 540% surge in prompt injection reports in 2025. Test both: direct jailbreaking through the chat interface, and indirect injection through any data source the system accesses. For the full technical breakdown, see Indirect prompt injection.

2. Data extraction. System prompt extraction, training data extraction, and RAG content extraction. System prompts often contain API keys, business logic, and pricing information that competitors would love to have. Training data extraction (Carlini et al., 2021) can surface PII, copyrighted content, or proprietary information. RAG extraction reveals what documents the system has access to.

3. Privilege escalation. If the system has tools, test whether you can make it use tools it shouldn’t, access data it shouldn’t, or take actions beyond its intended scope. Lab tests published by Irregular in March 2026 found agents given only routine tasks forging an admin session cookie, disabling endpoint protection with credentials they found, and using steganography to get a password past DLP controls. Also in March 2026, the security startup CodeWall said its autonomous agent broke into McKinsey’s internal AI platform, Lilli, through unauthenticated API endpoints and SQL injection; McKinsey said it fixed the issues within hours and that a forensic review found no evidence client data was accessed (analysis). Test the APIs around the model, not only the model.

4. Output manipulation. Can you make the system generate harmful, misleading, or policy-violating content? This matters for customer-facing systems where the output represents your brand. Published attacks stay effective against frontier models: Scale AI’s jailbreaking-to-jailbreak (J2) work reported a 97.5% attack success rate against GPT-4o with Claude Sonnet 3.7 as the attacker (arXiv 2502.09638).

5. Denial of service and cost attacks. Can an attacker craft inputs that cause excessive token consumption, triggering large API bills? Can they create loops in agent systems? Can they exhaust rate limits for legitimate users? These are often overlooked but represent real business risk.


What tools should I use?

Four tools cover most red teaming needs. Each has a different strength.

graph TD
    A[Red Team Tooling] --> B[Garak<br/>NVIDIA]
    A --> C[PyRIT<br/>Microsoft]
    A --> D[DeepTeam<br/>Confident AI]
    A --> E[Promptfoo]

    B --> B1[Broad vulnerability<br/>scanning]
    B --> B2[Known attack<br/>pattern library]
    B --> B3[Multiple model<br/>providers]

    C --> C1[Multi-turn<br/>conversational attacks]
    C --> C2[Human-in-the-loop<br/>via CoPyRIT GUI]
    C --> C3[Orchestrated<br/>attack strategies]

    D --> D1[OWASP LLM Top 10<br/>aligned]
    D --> D2[50+ vulnerabilities<br/>20+ attack types]
    D --> D3[Evaluation<br/>metrics]

    E --> E1[CI/CD<br/>integration]
    E --> E2[Regression<br/>testing]
    E --> E3[50+ vulnerability<br/>scan types]

Garak (NVIDIA, open source) is the broadest scanner. It probes for known vulnerability patterns across prompt injection, data leakage, toxicity, and hallucination. Think of it as Nmap for LLMs: good for initial reconnaissance and broad coverage. Best for: first-pass scanning when you don’t know what you’re looking for.

PyRIT (Microsoft, open source) focuses on multi-turn attacks: conversational strategies where the attacker gradually steers the model toward a target behavior over multiple exchanges. It includes CoPyRIT, a GUI for human-in-the-loop testing where human testers guide automated attack strategies. Best for: depth testing and complex attack chains that require reasoning about the model’s responses.

DeepTeam (Confident AI) aligns its attack taxonomy directly to OWASP LLM Top 10 categories. Its README lists 50+ vulnerability types and 20+ attack methods. Best for: compliance-oriented testing where you need to demonstrate coverage against a specific framework.

Promptfoo (open source; OpenAI agreed to acquire it in March 2026, and Promptfoo says it will remain open source) runs evaluations as part of your CI/CD pipeline. Define test cases, set pass/fail criteria, run on every deployment. Best for: continuous regression testing to catch safety regressions before they ship.

My recommendation: start with Garak for broad scanning, add PyRIT for multi-turn depth, and integrate Promptfoo into CI/CD for continuous coverage. Use DeepTeam when you need OWASP-aligned reporting for compliance or audit.


When do you need humans versus automation?

Automated tools and human testers answer different questions. Use both, but use them for what they’re good at.

Automated tools handle breadth. They can run thousands of known attack patterns against your system in hours. They’re good at finding known vulnerability classes: standard jailbreaks, common injection patterns, system prompt extraction techniques. They generate statistical data: “this attack succeeds 34% of the time across 1,000 runs.” They scale to continuous testing.

Human testers handle depth. They discover novel attack chains that no tool has in its library. They exploit business logic specific to your application. They combine multiple weak findings into high-severity chains. They reason about the system’s behavior across turns and adapt their strategy in real time.

The published approaches from major AI labs confirm this split:

Microsoft’s AI Red Team (100+ generative AI products red-teamed) combines automation for coverage with human testers for depth, and published its threat model ontology and lessons learned in January 2025 (arXiv 2501.07238).

Anthropic’s Frontier Red Team focuses human testers on catastrophic risks: CBRN (chemical, biological, radiological, nuclear) capabilities, deception, and autonomous behavior. Automated tools handle the breadth of general safety testing. External partnerships bring domain experts for specialized testing.

Scale AI’s jailbreaking-to-jailbreak (J2) research combines the two: once a frontier model is jailbroken into acting as a red teamer, it can jailbreak other models, and even copies of itself, at rates comparable to expert human red teamers (arXiv 2502.09638). Human creativity seeds the attack; automation scales it.

The practical split: automated scanning for every deployment (daily/weekly), human red teaming for pre-launch assessments and quarterly reviews of high-risk applications.


How do you write findings that get fixed?

The most common failure mode in LLM red teaming isn’t the testing. It’s the reporting. Traditional vulnerability reports assume deterministic bugs with code-level fixes. LLM findings are often probabilistic, architectural, and ambiguous.

Include the success rate, not just one screenshot. “I jailbroke the model” means nothing without context. “This prompt bypasses the content policy in 47 out of 100 attempts at temperature 0.7 on gpt-4o-2024-08-06” is a finding. Run every attack at least 20 times and report the success rate with the model version, temperature, and date.

Map to OWASP categories. Every finding should reference the OWASP LLM Top 10 category it falls under. This gives engineering teams a shared vocabulary and lets them prioritize across findings. It also makes the report useful for compliance teams who need to demonstrate testing coverage.

Describe the business impact, not just the technical behavior. “Jailbreak achieved” is not actionable. “Attacker can bypass content policy to generate detailed phishing emails targeting our customers, using brand-specific language from the system prompt” describes a business risk. “System prompt extracted, revealing API keys for internal services and pricing logic for enterprise tier” quantifies the exposure.

Suggest remediation pathways with realistic expectations. Some findings have code fixes (add output filtering, remove API keys from system prompts). Some require architectural changes (add privilege separation for tool access). Some have no complete fix (fundamental prompt injection). Be honest about which is which. “Mitigate by adding input filtering (reduces success rate from 47% to approximately 12%)” is more useful than “fix prompt injection.”

Accept probabilistic severity. If an attacker can automate 10 million attempts a day against a customer-facing chatbot, a 5% success rate means roughly 500,000 successes a day. That’s a different severity than the same 5% rate against an internal tool with 50 users. Context determines severity, not just success rate. For the AI-specific severity dimensions to report alongside CVSS, see AI security assessments.

Regulators expect documented adversarial testing too, though not always where people assume. The EU AI Act’s explicit duty to conduct and document adversarial testing (Article 55) applies to providers of general-purpose AI models with systemic risk, and has applied since August 2025. For high-risk AI systems, Articles 9 and 15 require testing and resilience against adversarial examples, data poisoning and other AI-specific attacks without using the words “red teaming”; after the 2026 Digital Omnibus those obligations apply from 2 December 2027 for Annex III systems and 2 August 2028 for AI in regulated products (AI Act, Digital Omnibus). NIST AI RMF places security and resilience testing under the MEASURE function (MEASURE 2.7), and its Generative AI Profile (NIST AI 600-1) lists AI red teaming among its suggested actions; NIST’s guidance is voluntary. Your reporting format should produce the evidence these frameworks ask for, not just serve your engineering team.


Key takeaways

  • LLM red teaming is fundamentally different from traditional pen testing: infinite attack surface, probabilistic results, architectural remediation
  • Scope by threat model, not by tool capability. Map your system to OWASP LLM Top 10 categories and test only what applies
  • Five attack categories cover most findings: prompt injection, data extraction, privilege escalation, output manipulation, denial of service
  • Four tools cover most needs: Garak (breadth), PyRIT (depth), DeepTeam (OWASP-aligned), Promptfoo (CI/CD)
  • Use automated tools for breadth and continuous coverage. Use human testers for depth, novel attack discovery, and pre-launch assessments
  • Report findings with success rates (not single screenshots), OWASP category mappings, business impact, and realistic remediation pathways
  • The EU AI Act requires documented adversarial testing from providers of GPAI models with systemic risk, and testing plus resilience against adversarial attacks for high-risk systems (from December 2027). NIST AI RMF recommends it under MEASURE.

FAQ

How is red teaming an LLM different from traditional penetration testing?

Three fundamental differences. The attack surface is natural language, meaning the input space is infinite and non-enumerable. Outputs are probabilistic, so the same attack may succeed 30% of the time, making reproducibility a challenge. Most findings can’t be patched with code: they require retraining, architectural changes, or accepting residual risk. A traditional pen test finds a SQL injection and the developer adds parameterized queries. An LLM red team finds a jailbreak and the fix might require months of safety training.

What tools should I use for automated LLM red teaming?

Four tools cover most needs. Garak (NVIDIA, open source) is the most comprehensive vulnerability scanner with broad attack coverage. PyRIT (Microsoft) excels at multi-turn conversational attacks with a GUI for human-in-the-loop testing. DeepTeam (Confident AI) aligns directly to OWASP LLM Top 10 categories with 50+ vulnerability types. Promptfoo is best for CI/CD integration and regression testing. Start with Garak for broad scanning, add PyRIT for depth.

When do I need human red teamers versus automated tools?

Automated tools handle breadth: scanning known attack patterns across many inputs at scale. Human testers handle depth: discovering novel attack chains, exploiting business logic specific to your application, and finding multi-step vulnerabilities that require reasoning about behavior. Use automated scanning for every deployment. Use human testers for pre-launch assessments and quarterly reviews of high-risk applications.

How do I scope an LLM red team engagement?

Start with the threat model. Identify what data the system accesses, what actions it can take, who the adversaries are, and what a successful attack looks like. Map to OWASP LLM Top 10 categories and exclude attacks that don’t apply (e.g., training data poisoning if using a third-party API model). Set measurable success criteria in business terms, not just technical outcomes.

How do I document LLM red team findings?

Include the exact prompt sequence, model version and temperature, success rate across multiple attempts (not just one screenshot), the business impact, and a suggested remediation path. Map every finding to an OWASP LLM Top 10 category. Accept probabilistic severity: “succeeds 40% of the time” means 4 million successes if an attacker can automate 10 million attempts a day. Context determines severity.