Red Teaming LLM Systems That Actually Find Risk

F

Frenkie

· 13 min read

Your LLM feature passes the demo script. The chatbot answers normal questions, the RAG assistant cites internal documents, and the agent completes a routine workflow without hesitation. Then someone pastes an instruction hidden in a retrieved document, asks the assistant to ignore its operating rules, or repeats an attack across a conversation. The system reveals information, calls a tool it shouldn't, or refuses a legitimate request alongside the dangerous one.

That gap is why red teaming LLM systems has become an engineering workflow, not a collection of clever prompts. A useful program starts with the system's threat model, exercises realistic attack paths, measures both unsafe compliance and false refusals, and verifies that remediation holds under repeated and varied testing.

Why Red Teaming LLMs Is Now a Release Requirement

A product team can test an LLM feature with ordinary quality prompts and still miss its most consequential failures. Standard acceptance testing asks whether the assistant completes intended tasks. Red teaming asks what happens when a user, document, tool response, or conversation deliberately pushes the system outside those intentions.

NIST defines AI red teaming as a structured adversarial testing effort, which is a better operating model than “try a few jailbreaks.” The tester isn't merely searching for an embarrassing answer. The tester is examining whether the model and its surrounding application preserve security, privacy, safety, and authorization boundaries under hostile conditions.

A 2024 survey identified 103 individual research works on generative-AI red teaming and concluded that the field remains fragmented across methods, goals, and evaluation criteria. The same review documented several high-profile exercises around 2023 and 2024, including publicized evaluations by major model providers, evidence that formal red teaming had become part of large-model release and assurance workflows rather than a niche security activity. The survey paper on generative-AI red teaming is useful background for teams that need a shared vocabulary.

The release question has changed

The practical question used to be, “Does the model produce a good answer?” For an LLM application, the release question is broader:

  • Can an attacker override instructions?

  • Can retrieved content influence behavior beyond its authority?

  • Can the system disclose data across users or trust boundaries?

  • Can an agent misuse a tool or escalate privileges?

  • Does a safety fix create excessive refusal of legitimate work?

  • Can the team reproduce, explain, and remediate a finding?

A chatbot may fail at the model layer, but a RAG pipeline can fail because it trusts unvetted content. An agent may behave acceptably in conversation while taking an unsafe action through an API. Treating the entire application as the test target prevents teams from hiding behind model-level benchmark results.

Practical rule: A release is not ready because the model survived a prompt set. It is ready when the application has demonstrated controlled behavior across the attack paths its deployment actually creates.

Teams building a repeatable security workflow can also use this security test automation guide to connect adversarial testing with broader automation practices. For a concise definition and orientation, what is red teaming provides additional context, but the operational standard remains the same: scope the system, test deliberately, measure consistently, and close the loop.

Threat Modeling for LLM Applications Before You Test

Prompting before scoping produces noise. Start by writing a one-page model of the application, its trust boundaries, and the outcomes an attacker would value.

Map the actual architecture

Record the system's interaction pattern first. A basic chat application has different exposure than a RAG assistant, a tool-using agent, or a multilingual deployment.

For chat, examine conversational abuse, instruction override, system-prompt extraction, harmful content, and cross-turn manipulation. For RAG, identify who can add, edit, retrieve, and rank documents. Test whether untrusted text can become an instruction, whether one user's data can enter another user's context, and whether citations expose more information than the user is authorized to see.

For tool-using agents, inventory every action, permission, approval step, and downstream system. A read-only search tool has a different consequence from an action that changes records, sends messages, or touches a payment rail. The model's reasoning is only one part of the risk. The tool boundary determines what a bad decision can do.

Multilingual deployments need their own scope. Test whether safety behavior, authorization logic, input filtering, and output monitoring remain consistent across supported languages, transliteration, encoding, and mixed-language conversations. Cross-linguistic evaluation and architectural understanding remain important limitations in public red-teaming work, so don't assume an English test set represents the whole system. Recent guidance on agentic and multilingual AI red teaming discusses why deployment context matters.

Define attacker goals and access

Next, describe the actor rather than listing generic vulnerabilities. A public user may control only chat input. An authenticated employee may access sensitive retrieval sources. A contributor may be able to place content into an index. A compromised integration may influence tool responses.

Your one-page threat model should answer:

  • Entry point: Which inputs can the attacker control, directly or indirectly?

  • Authority: Which instructions, documents, tool outputs, and user roles should the system trust?

  • Asset: What could be exposed, changed, sent, purchased, or approved?

  • Path: Which model call, retrieval step, memory store, or tool invocation connects the attacker to that asset?

  • Control: Which guardrail, policy check, permission, or human approval should stop the action?

  • Evidence: What logs would prove what happened?

Prioritize scenarios by attacker access, business consequence, and ease of exploitation. Don't spend most of the exercise testing a theoretical model behavior while ignoring an agent that can act on customer records. The threat model should dictate challenge families, test identities, data fixtures, tool permissions, and severity criteria.

Designing Test Cases That Cover Real Attack Paths

A test case should represent an attack path, not just an unusual sentence. Start with the intended abuse case, then vary the way an attacker might reach it.

Build challenge families

Group tests by threat type and system boundary. Useful families include direct prompt injection, indirect injection through retrieved content, context-window poisoning, sensitive-data leakage, system-prompt extraction, unsafe tool use, privilege escalation, refusal quality, and language-specific manipulation.

Each family needs a clear success condition. For example, an indirect-injection test isn't successful merely because the model mentions suspicious text. It succeeds when untrusted content changes the assistant's behavior in a way the threat model forbids, such as disclosing protected context or attempting an unauthorized action.

A useful test record includes the challenge family, attacker role, initial state, input sequence, expected safe behavior, observed output, tool calls, evaluator result, and reproducibility notes. Keep the original attack, transformed variants, and any successful continuation together. That lets engineers diagnose whether a failure came from a specific phrase, a missing authorization check, or a broader weakness.

Vary difficulty and interaction

Easy cases confirm that obvious controls work. Harder cases combine benign setup with a malicious objective, place instructions in documents or tool responses, switch languages, alter formatting, or distribute the attack across turns. Include both single-turn and multi-turn paths where the product supports conversation.

Don't rely on one attempt. NIST-linked research on LLM-backed agents reported an 81% task-hijacking success rate for novel attacks versus 11% for the strongest known baseline attacks. In the same work, repeating attacks 25 times per task increased average success rates from 57% to 80%, showing why a single-pass result can understate operational risk. The task-hijacking research provides the relevant methodology and figures.

Automation helps generate breadth, mutate inputs, and repeat trials. Manual testers remain valuable for business-context failures, chained tool actions, subtle authorization confusion, and attacks that require understanding how the product works. Published experiments reported 69.5% success for automated attempts versus 47.6% for manual attempts, a 21.8 percentage point difference, but the overall query-level success rate across challenges was only 1.97%. Success also ranged from 28.14% on the easiest task to 0.03% on the hardest, so an average can conceal the attack families that matter most. The published LLM red-team experiment supports using automation for coverage while reporting results by challenge family and difficulty.

A low aggregate failure rate doesn't prove safety. It may only show that the test set contains many easy or irrelevant challenges.

Use red-team LLM prompts before launch as a starting point for a structured corpus, then adapt every test to your application's roles, retrieval sources, tools, and failure consequences.

Watch the video

Tooling and Execution for Efficient Red Teaming

Execution quality determines whether a red team produces evidence engineers can use or a folder of interesting transcripts. The lean setup has four parts: an attack corpus, a target harness, controlled fixtures, and durable logs.

Compare automation with manual testing

Automated execution wins when you need repeatability, mutation, broad challenge coverage, and regression checks. It can run the same corpus against model versions, system prompts, retrieval configurations, and guardrail changes. It also makes repeated attempts practical, which matters for agent workflows where one lucky attack can trigger a consequential action.

Manual testing wins when context matters more than volume. A skilled tester can notice that a harmless-looking workflow gradually grants authority, that a support policy conflicts with a security policy, or that a tool sequence violates business rules even though each individual call appears acceptable. Manual work also helps discover patterns that later become automated challenge families.

Use both, but don't confuse automation with coverage. An automated harness can execute many prompts while missing a permission boundary, an unsafe fixture, or a tool-chain consequence. A human can find a novel path but fail to reproduce it unless the harness captures state, inputs, model versions, retrieved context, and tool events.

Run the harness safely

Keep adversarial tests away from production side effects. Use synthetic records, isolated accounts, mocked external services, and deny-by-default tool permissions. If the product must exercise a real integration, place an approval gate before irreversible actions and record the attempted action separately from the executed action.

Log the complete chain:

  • Request state: identity, role, session history, language, and input.

  • Context state: retrieved passages, ranking information, memory, and system instructions.

  • Model state: model identifier, configuration, response, and latency where relevant.

  • Action state: proposed tool call, policy decision, approval, execution result, and downstream response.

  • Evaluation state: judge outputs, human labels, disagreement, and final disposition.

Repeated agent tests should use controlled starting states. Otherwise, a previous run may poison memory or alter retrieval, making a later success impossible to interpret. Preserve failed and successful examples. A remediation suite needs the original exploit, not only a summary of what went wrong.

For tool selection, compare capabilities against your architecture instead of collecting frameworks by name. A focused discussion of Garak, PyRIT, and related red-team tools can help teams decide whether they need attack generation, orchestration, evaluation, or a combination. The right toolchain is the one that produces repeatable evidence and fits the system's trust boundaries.

Measuring What Matters and Trusting Your Results

A red-team score can create false confidence if it measures only unsafe compliance. A system that blocks every difficult request may show strong jailbreak resistance while failing its users through excessive refusal. Measurement must capture both sides.

The benchmark described in the research defines Attack Success Rate, or ASR, for unsafe prompts and Rejection Rate for benign prompts that are wrongly refused. ASR is successful attacks divided by total attack attempts. Rejection Rate is the proportion of legitimate prompts incorrectly blocked. The benchmark's evaluation framework explains why the two metrics belong together.

Metric

What It Measures

Risk If Ignored

Attack Success Rate

The share of unsafe attack attempts that achieve the prohibited outcome

The team may ship a system that appears useful but remains exploitable

Rejection Rate

The share of legitimate prompts incorrectly refused

The team may harden the model by blocking valid users and workflows

Separate the scorer from the evidence

An external safety judge can classify whether an output is unsafe, but the judge isn't ground truth by default. Its decision may depend on the prompt, response, policy definition, and evaluation harness. A judge can also misunderstand a tool action if it sees only the final text.

Use state-grounded evidence whenever possible. For a data-leakage finding, inspect the actual protected fixture and retrieval trace. For a tool-misuse finding, verify the proposed arguments, authorization decision, and execution result. For a refusal finding, have a reviewer confirm that the request was legitimate in the application's context.

Run more than one evaluation path for important findings. The benchmark's use of an external safety judge highlights a common problem, results can shift with the judge model and harness. Multi-judge review, deterministic policy checks, and human adjudication for disagreements make the result more defensible than a single scorer.

Track reliability as a security property

Refusal behavior can vary across target models and evaluator judgments, creating a measurable refusal gap. Broader red-teaming work also points to dependence on human labels and the lack of scalable, statistically sound coordination and judge-reliability methods. The EMNLP research on refusal consistency and evaluation reliability is particularly relevant when a program grows to hundreds of product tests.

For every finding, retain the attack, expected policy outcome, evaluator rationale, human decision, and reproduction result. Report results by challenge family, identity, language, system configuration, and action consequence. A single blended score is easy to communicate, but it hides where the system breaks.

Measurement is part of the control. If the team can't explain why a test passed, a score alone shouldn't close the finding.

Turning Findings Into Fixes That Stick

A finding matters only when it changes the system and survives verification. The remediation loop should preserve the original exploit while testing whether the fix addresses the root cause rather than the exact wording.

Triage the real failure

Classify each result by the asset affected, attacker access, exploit path, business consequence, and reproducibility. A model that produces an unsafe sentence and an agent that sends protected data through a tool shouldn't enter the same queue. The second finding may require immediate permission changes even if the prompt looked less dramatic.

Assign an owner who can change the relevant layer. Model behavior may require fine-tuning or provider changes. Retrieval failures may require ingestion controls, document provenance, filtering, or tenant isolation. Tool misuse usually needs permission boundaries, argument validation, sandboxing, approval gates, or a policy engine. A new refusal rule may need product review because it can increase legitimate-request rejection.

Verify the root cause, not the sample

After applying a fix, rerun the original test under the same harness. Then run transformed variants from the same challenge family, including different phrasing, turns, languages, retrieved documents, and user roles. For agents, verify both attempted and executed actions. A response that says “I can't do that” isn't enough if the tool call happened before the text response.

Check for regressions in benign behavior using the Rejection Rate measure. Verify high-impact findings with state-grounded evidence and more than one judge or human adjudicator. Record the fix version, test configuration, result, and residual risk so auditors and engineers can distinguish “not reproduced” from “resolved.”

Post-deployment testing should follow changes to RAG indexes, tools, system prompts, model versions, permissions, and memory behavior. Agentic systems can change risk without a new model release because connected data and capabilities change around the model.

The durable workflow is simple to describe and demanding to run:

  1. Triage the finding by impact and exploitability.

  2. Assign a team owner and remediation deadline.

  3. Apply the appropriate model, system, retrieval, permission, or guardrail fix.

  4. Verify the original exploit, neighboring variants, benign behavior, and regressions.

  5. Retain the evidence in a reusable regression suite.

Teams that follow this loop stop treating red teaming as a launch ceremony. Each exercise leaves behind better fixtures, stronger challenge families, clearer policies, and a faster path to the next verification run.


AI Compliance Index catalogs AI compliance, security, governance, red-teaming, and evaluation tools with human-readable entries and machine-readable JSON, Markdown, and JSON-LD formats. Use the AI Compliance Index to shortlist tools and practical resources that fit your LLM threat model, then turn the chosen findings into repeatable remediation checks before your next release.