Build a QA harness for your AI prompts

Stop guessing if your prompts work. This testing harness framework forces you to define test cases and scoring criteria for consistent, reliable results.

We have all been there: you write a prompt that works perfectly once, but fails miserably the next three times. It creates a massive headache when you cannot trust your AI workflows to perform consistently at scale. That is why I was so interested to see a post by u/CalendarVarious3992 on r/PromptEngineering sharing a systematic way to test prompt reliability. This Redditor developed a “testing harness” that acts as a quality assurance layer for your engineering efforts.

The Prompt

Here is the exact framework the author provided. You need to fill in the bracketed variables at the top before running it.

VARIABLE DEFINITIONS
[PROMPT_UNDER_TEST]=The full text of the prompt that needs reliability testing.
[TEST_CASES]=A numbered list (3–10 items) of representative user inputs that will be fed into the PROMPT_UNDER_TEST.
[SCORING_CRITERIA]=A brief rubric defining how to judge Consistency, Accuracy, and Formatting (e.g., 0–5 for each dimension).

~

You are a senior Prompt QA Analyst.
Objective: Set up the test harness parameters.
Instructions:

  1. Restate PROMPT_UNDER_TEST, TEST_CASES, and SCORING_CRITERIA back to the user for confirmation.
  2. Ask “CONFIRM” to proceed or request edits.

Expected Output: A clearly formatted recap followed by the confirmation question.

Why This Works

This approach applies software engineering principles to natural language processing. By using Variable Definitions at the very top, the creator clearly separates the instructions from the data. This prevents the AI from getting confused about which text it should execute and which text it should evaluate.

The use of the “Senior Prompt QA Analyst” persona frames the interaction. It tells the LLM that its job is not to be creative, but to be critical and structured. Finally, the confirmation step is crucial. It forces a “human-in-the-loop” moment, ensuring the model has correctly parsed your test cases and criteria before it wastes tokens generating an evaluation.

Variations to Try

  • Automated Execution: The current prompt stops at setup. You can add a step 3: “Once confirmed, run the inputs through the prompt and generate a markdown table showing the input, output, and score based on the criteria.”
  • Comparative Testing: Modify the variables to include `[OLD_PROMPT]` and `[NEW_PROMPT]`. Ask the QA Analyst to run the same test cases on both and highlight which version performed better based on your rubric.

Check out the full discussion on Reddit for more context on how to implement this workflow.

Set up a reliable prompt testing harness. Prompt included.
by u/CalendarVarious3992 in PromptEngineering

Scroll to Top