← Back to Setups

Promptfoo

Did that prompt change actually help? Compare AI behavior against repeatable test cases before shipping a new prompt, model, or workflow.

https://github.com/promptfoo/promptfoo

evaluationtestingpromptsreliabilityopen-source
Added to Lab: 2026-10-29

When this is useful

You improve a prompt and the next answer looks better. But did the change also break a request that worked yesterday?

That is where Promptfoo fits: turning examples into repeatable checks, so a promising demonstration can become a comparison you can inspect.

What this is

Promptfoo is an open-source CLI and library for evaluating and red-teaming AI applications. It can compare prompts and model providers, run test cases, and check outputs with deterministic assertions, custom code, or model-based grading. Results can be reviewed side by side, and evaluations can run in CI.

Why it belongs in the Lab

The existing GitHub Spec Kit entry focuses on specifying what should be built. Promptfoo adds a practical question afterward: does the resulting AI behavior meet the expectations we defined?

Its strongest fit is a small, versioned collection of meaningful examples that a team reruns when behavior changes.

A small first setup

Choose one task, such as extracting a structured brief from an incomplete request.

  • Collect a handful of representative inputs, including missing information and conflicting instructions.
  • Define the expected behavior before comparing versions: required fields, valid structure, and when clarification is needed.
  • Run the current prompt and one candidate against the same cases.
  • Inspect individual failures alongside the aggregate score.

Use code to check structure and a clear rubric for judgments that need interpretation.

Does the new prompt still know when to wait?

Try a second comparison with a project assistant. Run the same model and inputs twice, adding only “Be more proactive” to the candidate prompt. Write down the expected behavior before looking at the responses.

InputWhat to look for
“The release is blocked until you choose Friday or Monday. Both dates work.”Surfaces the scheduling decision and identifies who needs to make it.
“I think the supplier might be late. The delivery date hasn't been checked.”Preserves the uncertainty and suggests checking the date before escalating.
“We chose Monday. The owner confirmed it and scheduled the release.”Recognizes the decision is settled and leaves it closed.

Inspect the answer pairs in the Promptfoo results viewer. Which wording helped the owner act? Which phrasing created another decision for them? Keep the cases where the two versions behaved differently as regression tests.

Exercise added December 4, 2026.

What to account for

A passing score only covers the cases and assertions you chose. Model-based graders also need review. Include failures from actual use as the suite evolves.

Running the CLI locally does not make every model call local: data handling and API costs depend on the configured providers. Evaluation also needs an observable target; a final answer alone cannot prove that an agent avoided an unauthorized action.

Explore further

Documentation reviewed October 29, 2026.