Your company uses an AI tool to classify software bugs by severity. It reads defect reports and recommends whether each problem is critical, high, medium, or low severity.
The tool generally works well, but it keeps classifying minor problems as critical. A developer changes the prompt to make the AI more selective.
The change works. Minor defects are no longer classified as critical.
Unfortunately, the revised prompt also starts classifying some serious security defects as medium severity.
The application code hasn't changed. The AI still runs normally, and its answers sound reasonable. But the system is now making mistakes it wasn't making before.
This is the problem that prompt regression testing is intended to catch.
What Is Prompt Regression Testing?
Prompt regression testing checks whether changes to an AI prompt cause previously correct behavior to fail or become less reliable.
It's similar to traditional software regression testing. When developers fix a defect, testers confirm the correction and check whether the change affected something else.
The ISTQB Foundation Level syllabus, section 2.2.3, distinguishes these two activities:
- Confirmation testing checks whether the original defect has been fixed.
- Regression testing checks whether the change has caused problems elsewhere.
The same principles apply when a team changes instructions used by a large language model (LLM).
For example, changing a prompt might affect how an AI customer service assistant handles refunds, how an AI testing tool generates test cases, or how a defect-classification system assigns severity.
Because LLM outputs can vary, the tests may also need to accommodate more than one acceptable response.
An Example: The Test Score Stays the Same, but the Risk Increases
Let's return to the AI defect-classification tool.
Suppose the company has a rule that confirmed unauthorized access to an administrator account must be classified as critical, even if only one account is affected.
The developer adds this instruction to the AI's prompt:
"Reserve critical severity for problems that affect a large number of users."
This corrects the tendency to exaggerate minor problems. But the instruction conflicts with the company's security classification rules.
The tester runs four test cases before and after the change.
| Bug report | Original prompt | Revised prompt |
|---|---|---|
| Button slightly misaligned | Critical | Low |
| Unauthorized admin access | Critical | Medium |
| Checkout unavailable to all customers | Critical | Critical |
| Report missing necessary details | Needs review | Needs review |
These are hypothetical results to illustrate how a regression can occur.
Under the company's requirements, the first report should be low severity and the second should be critical. The remaining two results are correct in both versions.
Before the prompt change, three of the four tests passed.
After the change, three of the four tests still pass.
The overall score is exactly the same. But now a serious security problem might receive less attention than it should.
A tester examining only the overall pass rate could miss the problem. Someone looking at the individual results and the company's severity rules would see it immediately.
The example also shows why test cases need to cover more than common situations. If the test set contained only minor defects, the revised prompt would appear to be an improvement.
What Does the Research Say?
Researchers at the University of Washington, Microsoft Research, and Recursion examined a related problem in an October 13, 2026, paper titled HERO: Harnessing Evidence for Test-time Refinement and Prompt Optimization in Program Generation.
The study examined improvements to prompts and supporting instructions used for generating code.
The researchers evaluated whether changes corrected previously failed tasks and whether those same changes disrupted tasks that had already worked.
They developed a method that uses the results of executing generated programs to evaluate proposed changes. Across four code-generation benchmarks involving SQL, Cypher, and Python, their approach improved first-attempt success by 7.6 percentage points over the initial prompt.
The researchers' results are promising, but the paper is a preprint and the authors evaluated their own framework. The findings concern code-generation tasks, not every type of LLM application.
Earlier research from Microsoft, PromptPex: Automatic Test Generation for Language Model Prompts, investigated how to generate tests for prompts and detect failures when prompts or models change.
These studies support the value of testing prompt changes systematically. They do not establish that any particular method will catch every regression.
How to Perform Prompt Regression Testing
You can begin with a spreadsheet and a repeatable set of test cases. More sophisticated automation may be useful later.
The following process applies established regression testing practices to LLM applications.
1. Choose test cases that represent real requirements
Start by identifying what the AI application is supposed to do.
For the defect-classification tool, that means understanding the organization's severity definitions and what information the tool needs to make a classification.
Then select tests covering normal situations, unusual inputs, boundary conditions, and problems with serious consequences.
Include cases that have failed before, along with cases the system already handles correctly.
For example, the test set might contain minor cosmetic defects, security vulnerabilities, major system failures, duplicate reports, and reports with insufficient information.
Record the expected result for each case. When an exact answer isn't required, document what would make the response acceptable.
Avoid letting the AI tool determine all the expected results for its own tests. Those expectations need to come from the application's requirements and people who understand them.
As problems are discovered, add useful new cases to the regression set.
2. Save the current prompt and its results
Before changing anything, run the test cases against the existing system.
Keep a record of the prompt, the AI model being used, relevant model settings, and the results.
If the application supplies additional information to the model, such as retrieved documents or database records, record the relevant versions of those components as well.
This gives testers a baseline for comparison.
Version control is especially useful. It allows the team to identify which instructions were changed and restore an earlier version if necessary.
Try to keep everything other than the prompt unchanged during the comparison.
If the model, retrieval system, or application logic changes at the same time, it becomes harder to determine what caused a new failure.
The ISTQB Foundation Level syllabus covers the importance of identifying and tracking versions of test items and environments in its section on configuration management.
3. Run the tests again and compare the results
Use the same test cases with the revised prompt.
Compare each result against the expected behavior and the previous version's result.
Pay attention to cases that changed from failing to passing and those that changed from passing to failing.
These are the cases that show what the update fixed and what it may have broken.
For structured outputs, this can be straightforward. The defect-classification example uses defined severity categories, so the results can be checked against expected classifications.
Free-form responses need a different approach.
If an AI assistant is asked to explain a company's return policy, its wording might change while the answer remains correct.
In that situation, check whether the response follows the policy and includes the required information. Don't treat every wording difference as a failure.
When a result changes unexpectedly, investigate the cause before deciding whether it is a regression.
4. Repeat important tests when results can vary
An LLM may produce different answers to the same input, even when the prompt hasn't changed.
Running a test once may therefore give a misleading picture of its reliability.
For important cases, repeat the test and record how frequently the result meets the expected requirements.
A severity-classification tool that correctly identifies a critical vulnerability in most runs but sometimes labels it medium severity needs further investigation.
The number of repetitions should depend on the consequences of an incorrect result and how much confidence the team needs. There is no fixed number that works for every application.
For answers that cannot be checked automatically, use clearly defined evaluation criteria and appropriate human review.
AI-based evaluators can help score responses, but their judgments should also be checked. An automated evaluator may incorrectly accept a response or reject one that meets the requirements.
NIST's February 2026 report, Expanding the AI Evaluation Toolbox with Statistical Models, examines how evaluation methods affect estimates of AI performance and uncertainty.
The report also distinguishes between performance on a particular test set and estimated performance across the wider range of similar tasks.
5. Decide whether the change is acceptable
Before releasing the revised prompt, review the results against the application's requirements and the team's release criteria.
Consider the types of failures, not just the total number of tests that passed.
In the defect-classification example, the updated prompt corrected a minor problem but introduced a serious security-classification error.
That would be a reason to reject the change under the company's stated severity requirements, even though the overall pass rate remained unchanged.
The developer could revise the instruction to make the exception for serious security defects clear, then run the regression tests again.
For less serious differences, the team may decide that the change is acceptable after reviewing the impact.
These decisions should be based on agreed requirements and risk, rather than an assumption that a higher average score means the application is better.
When a change is approved, retain the prompt version, test results, known limitations, and any remaining issues.
Can Prompt Regression Testing Be Automated?
Yes. Many of these checks can be automated, especially when the AI produces structured results.
A testing script can send the same inputs to two prompt versions, collect their outputs, and compare them with expected results.
For example, if an AI tool must return one of four severity categories, an automated check can determine whether the returned category matches the expected one.
Other applications are harder to evaluate.
An AI assistant that summarizes a document may produce several acceptable summaries. Checking these outputs requires criteria such as factual accuracy, completeness, and whether the summary introduces information not present in the source.
Automated scoring can help, but teams should review ambiguous and high-risk results rather than accepting every automated judgment.
For more on testing these applications, see How to Test LLM Applications and LLM Testing for QA Engineers.
What if the Prompt Hasn't Changed?
Regression testing is also important when other parts of an AI application change.
A model update can affect how existing instructions are interpreted. Changes to retrieved documents, connected tools, or application logic can also change the results.
That means a prompt regression test set can be useful even when the prompt itself hasn't been edited.
However, testing the prompt doesn't cover every part of an LLM application. Teams also need to test the software, data, permissions, and integrations surrounding the model.
What This Means for Software Testers
Changing an AI prompt may be easy, but checking the results requires testing knowledge.
Someone must identify the requirements, choose meaningful test cases, evaluate the results, and decide whether a change introduces unacceptable risk.
Those are familiar software testing responsibilities.
The tools may be different, but established skills in test design, confirmation testing, regression testing, and risk assessment still apply.
For software testers who want to develop their knowledge of AI-related testing, the ASTQB AI Assurance Pro™ designation combines ISTQB Foundation Level, ISTQB AI Testing, and ISTQB Testing with Generative AI certifications.
The next time someone updates an AI prompt to solve a problem, test the correction. Then run the cases that were already working.
You may find that the new prompt fixed exactly what it was supposed to fix.
Or you may find another problem before your customers do.