● THREAT ADVISORY
CyberInsightsGlobal cybersecurity news, practical analysis & security knowledge
Submit a Tip

Red-Teaming LLM Applications Before Release: A Repeatable Test Plan

By Harpreet Singh, CISSP, CCSP

Conceptual AI release test chamber and verification checklist

Security testing for a language-model application should examine the complete workflow: the user interface, model, retrieved documents, identity, tools, logs and the systems that consume the model's output. A collection of adversarial prompts can reveal failures, but it does not prove that an application is safe. A defensible assessment begins with the intended task and authority of the system, then tests whether a failure can cross a meaningful data or action boundary.

This guide gives product security teams and application owners a repeatable pre-release method. It is designed for authorized systems and synthetic data. It does not provide exploit payloads or instructions for attacking third-party services.

Define the system and its allowed behavior

Write down the exact application version, model/provider configuration, system instructions, retrieval sources, tools, user roles and deployment environment in scope. Include the boundaries that can change behavior: permissions on retrieved documents, service credentials, plugins or MCP servers, output rendering, background jobs, and downstream automation.

Describe the expected behavior in terms a reviewer can observe. For example: “A support assistant can retrieve documents the signed-in user is allowed to read and draft a response; it cannot send the response or change the customer's account.” This is more testable than “the assistant must be safe.”

List the actions that need independent approval, data classes the workflow must not disclose, and destinations the system is allowed to contact. Name the owner who can authorize testing and the operator who can stop it. Use a staging environment or isolated test tenant where possible. Obtain explicit authorization for any external model endpoint, connected account or third-party tool.

Turn risks into testable questions

Organize the assessment around scenarios, not a bag of prompts. A concise starting matrix might look like this:

Risk area Test question Evidence to retain
Instruction conflict Does untrusted user or retrieved content change the assistant's permitted task? Input source, application/model version, response and policy outcome
Sensitive information Can a test user obtain synthetic records outside their authorized scope? Test identities, record permissions and access decision
Tool authorization Does the tool service independently reject an unauthorized object or action? Requested action, principal, authorization decision and side-effect check
Output handling Is model output escaped or validated before another component uses it? Rendered result, parser/validator behavior and downstream state
Reliability and cost Can repeated or unusually large test requests exceed the defined budget or service limits? Request bounds, rate-limit response, cost/latency records and stop condition

The OWASP GenAI project describes prompt injection as a risk of instructions embedded in user input or content the model processes. Its 2026 material also emphasizes how surrounding permissions and system design influence the consequences. Use the current risk taxonomy to check coverage, then map each risk to your actual implementation rather than treating a checklist as a pass/fail certificate. OWASP prompt injection

Build a small, repeatable test set

Create a version-controlled test plan with an identifier, owner, risk, setup, input class, expected safe behavior, observed behavior, severity rationale and remediation owner. Store harmless synthetic records with unique markers so reviewers can tell whether a test crossed a boundary without exposing real customer information.

Include both ordinary and adversarial cases. A normal case checks that legitimate work still functions; an adversarial case checks a relevant boundary. Include a negative authorization test for each sensitive tool: an identity that should be denied requests an action against a synthetic object it does not own. The expected result is a denial enforced by the service, with no state change. A model refusal by itself is not evidence that the underlying service would deny the request.

For retrieved content, test whether the application treats source material as data rather than authority. Vary where content originates, such as a synthetic document or support ticket. Verify that the same role, data-access and tool-authorization rules continue to apply even if the model response is manipulated. Do not use real secret material or send tests to a third-party system without authorization.

Use tools to organize work, not replace judgment

Promptfoo documents a red-team workflow that uses adversarial testers to probe model-application failure modes. Microsoft's PyRIT offers a modular toolkit for composing test workflows, targets, converters and scorers. Their capabilities and integrations change; check the current official documentation, release and license before adopting either. A tool run is evidence about the configured target and test set, not a universal certification of the model or product. Promptfoo red-team guide · Microsoft PyRIT

For a useful run record, retain the tool version, configuration, test identifiers, target build and date, model/provider settings, scorer configuration, raw results in an access-controlled location, and any manual adjudication. Avoid recording secrets or unnecessary personal data. Before sharing results, check what the tool stores or sends to a hosted service and which credentials it uses.

Automated scorers can miss context, overcount harmless refusals or treat a semantically different response as equivalent. Have a qualified reviewer inspect material findings, especially those that claim unauthorized data access, action execution or security-boundary failure. State whether the result was tool-generated, manually reviewed or reproduced. Do not call an unverified finding a confirmed vulnerability.

Evaluate outcomes and residual risk

Report findings by affected workflow and consequence, not by a raw count of prompts. A practical record includes:

  1. The authorized test case and relevant application build.
  2. The expected boundary and observed result.
  3. Whether a real service or synthetic target was involved.
  4. The evidence supporting the impact and the evidence still missing.
  5. A fix owner, acceptance condition and retest date.

A successful denial test should verify there was no downstream side effect, not merely that the interface displayed a refusal. A fix should be retested against the original case and nearby legitimate cases. Keep model output filtering, application authorization and downstream business approval as separate controls; they answer different questions.

NIST's Generative AI Profile provides a risk-management lens for identifying, measuring and managing risks across a system lifecycle. Use it to structure ownership and review, alongside application-specific security testing. It does not define a single test suite that proves an application secure. NIST AI RMF Generative AI Profile

Make the lab safe and repeatable

Use an isolated project or tenant, synthetic records, scoped test identities and credentials that can be revoked. Set explicit request, token, runtime and spend limits before a run; monitor actual provider usage because test suites may retry or expand. Keep external network destinations controlled, and stop when the test exceeds its approved scope or cost. Record the reset procedure and confirm that test accounts, files, integrations and temporary credentials are removed afterward.

Before release, connect each high-priority test to an acceptance condition and an owner. If a scenario cannot be tested safely or its result remains uncertain, record that gap and decide whether the workflow needs a narrower permission, a human approval, an operational constraint or more evidence. A red-team report is a point-in-time view of defined tests; it cannot guarantee that every future input or model change will behave the same way.

Further reading