How promptfoo scenarios run one test set across many datasets
According to the promptfoo documentation, scenarios run the same set of tests across several data sets or configurations, so you do not have to copy the same test blocks for each one. Teams usually reach for scenarios when a suite grows and the same checks must apply to a dataset per language, a set of personas or several model configurations. Without them, each copy drifts as someone edits one and forgets the others. The maintenance benefit is that one shared test definition holds the expected behavior. When an assertion is tightened or a rubric is corrected, the change happens once and applies to every variant, so reviewers compare results for identical checks across variants.
Before you build a scenario, decide which parts vary and which stay fixed. Datasets, languages, personas and model configurations are the usual variables, while the assertions and expected behavior should be the shared part. Keep each variant traceable to its source file or label, so a failure can be traced back to the dataset or setting that caused it. Check that a variant with a different language or persona still has assertions that make sense for it. Plan for one risk in particular: a single pass rate across all variants can look healthy while one dataset fails badly. Ask how your promptfoo version groups results per variant, and decide who reviews a failing variant before the first full run.
Confirm every key, file layout and behavior described here against the promptfoo documentation for the version you run, because scenario configuration can change between releases and this section does not set out the syntax. Before you move a full suite across, pilot one shared test set on a small dataset and one alternate configuration. Check that the number of executed cases matches what you expected, that a deliberately wrong expected value fails in every variant, and that the output identifies which variant produced each result. Record the promptfoo version and the scenario file in your repository so the next maintainer can reproduce the setup.
Scenario design options and when each fits
This table compares the main scenario design choices, the situations where each fits and the trade-off it brings. Match each option to who owns the data and how often prompts change, since many suites mix options. Confirm the exact setting names for scenarios and config splits in the promptfoo documentation before copying any structure.
| Option | When it fits | Trade-off |
|---|---|---|
| One scenario per dataset | Each data source has its own cases, owners and review cycle, such as one spreadsheet per product area. | Ownership stays clear and files stay simple, but shared prompts and checks get copied across scenarios. |
| One scenario with several data files | The same checks must run over related datasets, such as a regression set and an edge-case set. | Fewer blocks to maintain, but a failure is harder to trace back to its source file. |
| Varying the prompt or provider | You compare models or prompt versions on identical test data. | Shows which configuration changed the result, but adds run count and cost for each variant. |
| Varying only the data | You measure one prompt and provider across many user groups, languages or document types. | Isolates data effects, but every prompt change must be retested against every dataset. |
| Expected values next to the data | Each row has its own correct answer, which suits factual lookups with one right output. | Domain experts can edit answers directly, but the same check repeated per row can drift over time. |
| Expected values in shared assertions | Checks are generic, such as output format, tone or refusal behavior, and apply to every row. | One place to change a rule, but rows that need unique answers require extra columns or logic. |
| One config for the whole team | A small team shares one prompt set, one provider setup and one review path. | A single source of truth and fewer files, but unrelated teams must coordinate edits and merge conflicts rise. |
| Separate config files per suite | Teams own their suites, with their own providers, defaults and release schedules. | Clear ownership and independent changes, but shared defaults must be duplicated or imported carefully. |
Scenarios fan one test set out into separate eval runs
The diagram starts with one shared test definition and its assertions. The scenario expansion step pairs them with each dataset or configuration variant, so every pairing becomes its own eval run. On your machine, the CLI calls the model provider directly, so prompts and responses travel only on that link. Each run writes its results to one results store. If you use a self-hosted server, the results go there so teammates can review every run side by side in the web UI. Check that each variant appears in the stored results and that the provider link meets your data policy.
One test definition fans out into separate runs that share one results store.
Setting up promptfoo scenarios in a config
This sequence takes one copied test block and turns it into a shared scenario that runs across each data variant. Each step ends with a check a reviewer can repeat, so the team can show that the suite counts and failures match what they expected. Confirm the scenario syntax in the official promptfoo documentation before you copy any example into your config.
Confirm the Node.js runtime
Run
node --versionon the machine or CI runner that will execute the evals. promptfoo's npm release requires Node.js 22.22.0 or newer, so the output must show v22.22.0 or a later version. If the version is older, upgrade Node.js before going further, because later steps fail in ways that look like config errors. Check passes when the reported version meets the minimum on every machine that will run the suite.Install promptfoo at a pinned version
Add promptfoo to the project and pin an exact version so every reviewer runs the same code. Use a version you have tested, and record it in the project's lockfile. Check that
npx promptfoo@<version> --versionprints the version you pinned, on your machine and on the CI runner. Read the scenario section of the documentation for that exact version before you write any config.Move one test block into a shared definition
Take a single test block that already works, copy it once into a scenario definition, and remove the duplicated copies from the config. Keep the prompt, provider and assertions unchanged so the only difference is where the test lives. Confirm the scenario syntax in the official documentation before you copy any example. Check that the eval still loads, and that the number of results matches the number of tests the original config produced.
Add data variants as separate sources
Point the scenario at each data source you want to run, such as separate CSV files or one dataset per team, keeping each source in its own file. Give every source a clear name so the results can be traced back to it. Check that each file opens, that its header row matches the variable names the prompt uses, and that the row count is what the data owner expects.
Run the suite and count results
Work out the expected result count before you run anything: the rows in each source multiplied by the tests that use it. Then run
promptfoo evalagainst the config and compare the reported total for each variant. Each variant should produce its expected number of results, with none silently missing. If a count is short, check the source file for empty rows or a mismatched variable name before you change any assertion.Confirm a bad answer fails
Add or use a deliberately wrong expected answer in one test, or feed a known bad output through the assertion, and run the eval again. The failing case should appear as a failure in the output and in the web viewer, and the summary should count it as a failure. Check that the failure appears for every variant that uses the scenario, then remove the deliberate fault. A suite that passes a bad answer is not testing anything.
Keeping expected values consistent across scenarios
A change to a shared test changes every scenario that uses it. That is the purpose of sharing it, but it also means an edit made for one data set or configuration can quietly alter the pass criteria for all the others. The risk is sharpest when one scenario legitimately needs a different expected answer. Before you edit anything, decide where that expected value belongs. If the answer is the same for every scenario and every row, it stays in the shared definition. If it varies by test case, such as the correct refusal wording for one particular prompt, it belongs in the data file next to that case. If it varies only by scenario, such as a different date format for one region or a different product tier, it belongs in a per-scenario override. Write the reason for each override where the next editor will see it.
Use one question to settle most placements: is the difference a property of the case or a property of the scenario? A property of the case belongs with the row that has it, and a property of the scenario applies to every row run under that scenario. Overrides are where drift builds up, so keep their number small and revisit them whenever the shared definition changes. An override written against an older assertion may no longer test anything useful. For example (illustrative only), if a shared check requires one date format and a single region's scenario overrides it, a later change to the shared format can leave that override passing for the wrong reason. Before merging, rerun every scenario and list the ones whose results changed. A scenario that flips from pass to fail, or the reverse, is the signal that a shared edit reached further than intended.
Treat a change to a shared assertion as a change to the pass criteria of every scenario, and review it that way. The reviewer should check the expected answer against what the domain owner approved, because the syntax of an assertion can be correct while its meaning is wrong. Ask the author to attach the before and after results for each scenario, and confirm that every scenario whose status changed has a stated reason. If a scenario changed only because an override no longer matches the intent, fix that override in the same change, before merging. Confirm with your team how the version you run reports results by scenario, since reviewers depend on that layout to see what moved.
Who owns scenario changes, by role
Product and domain experts own the test content: the rows in each data set, the variable values that fill the prompts, and the expected answers that define a correct response. Their edits change what the suite measures, so they are best placed to say whether a case still reflects how users ask questions and what a good answer contains. They usually work in the source file, such as a CSV or spreadsheet, and need the scenario layer mainly to see which data sets a scenario pulls in.
- Edit rows and expected values: Add, correct or retire cases in the data source, and keep column names for variables exactly as the config expects them.
- Check expected answers against current sources: Confirm each answer matches current policy, product terms or regulatory guidance, and note the date and source beside contested rows.
- Flag shared data: A data set can feed several scenarios, so state in the change note which scenarios the edit is meant to affect.
- Leave wiring and grading logic alone: Do not change prompt references, provider settings or assertion logic without an engineer reviewing the change.
- Escalate disagreements: Where two experts disagree on an expected answer, record both positions and have a second reviewer decide before the row is merged.
Before merging, confirm that the row count and the scenarios that use the file match what the change was meant to affect.
Engineers own the config and the scenario wiring: which prompts, providers and data sources each scenario combines, how shared defaults are inherited, and how the files are split. Their changes decide what runs, so they need to check the effect of every wiring change, not only whether the config loads. Engineers also carry the highest blast radius, because one edit to a shared default can change many scenarios at once.
- Maintain the scenario map: Keep a current record of which prompts, providers and data files each scenario uses, and update it in the same change as the wiring.
- Compare expanded case counts: After a wiring change, compare the number of cases each scenario runs with the previous run, so an unexpected drop or jump is caught before results are read.
- Treat shared defaults as cross-suite changes: A default inherited by many scenarios should be reviewed as if it changed every one of them.
- Require a second reviewer for grading and model changes: Changes to assertion thresholds, judge models or provider versions alter what a pass means, so they need a second engineer and a domain expert to agree.
- Record what each run depends on: Note the config revision, data file revision and provider settings alongside each run, so a result can be traced to its inputs later.
Before merging, confirm that each scenario still points at the data sources and providers that its name and owner expect.
Security and compliance reviewers need to see which data sets and configurations a result covers, and who approved the content behind it. They seldom edit suite content themselves. Their job is to confirm that a reported result can be traced to named inputs, that sensitive data is handled appropriately, and that changes to expected answers or grading had a reviewer other than the author. Reviewers do not issue attestations; independent assessors decide whether the evidence is sufficient for a given framework.
- Confirm coverage for each result: For every reported result, be able to name the scenarios, data files, config revision and model or application under test.
- Check sensitivity of test data: Review whether data sets contain personal, customer or regulated information, and whether file location and sharing settings match that classification.
- Review approval records: Confirm that changes to expected answers and grading criteria have a named second reviewer on record.
- Watch access to results: The self-hosted promptfoo server has no built-in RBAC or SSO, so decide who can see result data through network controls and the surrounding access model.
- Block changes made to improve scores: Changes that make a result look better need a second reviewer and a recorded reason, and that reviewer should not be the person who made the change.
Ask for a written list of scenarios, data revisions and approvers for each reporting period, and check it against what was actually run.
What goes wrong when scenarios multiply eval runs
Each scenario you add changes run cost, result comparability and run time at the same time. The four risks below grow quietly with the suite and often show up only after a run has finished, so each card names the cause, an early warning sign and the control to set before the next full run.
Run volume and model cost
Every scenario multiplies the test cases, and each case runs once for every prompt, provider and model combination in the configuration. Cost comes from three drivers: the number of variants, the models called, and the assertions that send each output to a judge model, which makes extra paid requests on every run. Before the first full run, multiply the counts on paper and confirm who owns the budget for the API account. An early warning sign is a run that takes noticeably longer or costs more than the previous one even though no test changed.
Results that are hard to compare
The cause is usually an edit that changes the prompt, the model and the scenario data in one pull request, so a shift in the pass rate cannot be traced to any one change. The early warning sign is a review meeting where nobody can say which change moved the score. The control is to change one variable per run, keep a baseline run against the same test data, and record the configuration diff alongside the results in the pull request.
Expected values that diverge
Teams often copy the same expected answer into several scenario files, then edit one copy to fix a single failure. The early warning sign is a scenario that fails only for one dataset or locale, or two files that give different expected values for the same test ID. Keep shared expected values in one file that every scenario references, and run a short review checklist whenever an expected value changes, so each edit is confirmed across all scenarios.
Rate limits on long runs
More scenarios mean more concurrent requests and longer runs, and model providers throttle accounts by requests or tokens over time. The early warning sign is a rising number of rate-limit errors in the output, retries that stretch the run well past its normal length, or failures that cluster in the later batches of a run. Start with a small first run that covers one scenario per group, set the concurrency in the configuration deliberately, and confirm the limits for your provider account before the full run.
How much effort do promptfoo scenarios add to an existing suite?
How do we get a quote for converting promptfoo tests to scenarios?
DeployOpen does not publish a price list. A quote follows from a written scope that names the test sources, configurations, variants and deliverables, and most engagements are fixed-scope, with scope, deliverables and timeline agreed in writing before work starts. To compare quotes, ask each vendor which inventory it priced, what it assumed about data cleanup and judge model use, how many review rounds it included, and what happens if the inventory grows during the work. Ask whether the handover includes documentation so your team can maintain the scenarios afterward.
What drives the cost of moving copied promptfoo test blocks into scenarios?
The effort depends mostly on how many copied test blocks exist, how many data sources and configurations they span, and how clean the current assertions are. A small suite run against one data file is a small refactor. A suite where the same test blocks are pasted across several providers, multiple CSV files and two prompt versions has more to untangle, because each copy must be mapped to a scenario and checked for drift. Costs rise with:
- The number of variants, such as prompts, providers and data sets each scenario must cover.
- Data cleanup, such as normalizing columns, fixing expected values or removing duplicate rows.
- Judge model use, since LLM-graded assertions need prompt design, calibration and review.
- Review cycles, meaning how many rounds your reviewer needs before sign-off.
The conversion is one-time work. Ask for an inventory of copied blocks, data sources and configurations before agreeing scope, since that inventory is what the quote is built from.
What does our team need to provide for a promptfoo scenarios project?
The work needs four things from your organization:
- Data owners who confirm which CSV, spreadsheet or dataset sources are authoritative and what each expected value means.
- A test environment where suites run against the models or application under test without touching production traffic.
- Provider access, meaning accounts or API keys for each model in the configurations, with budget approved for test runs.
- A named reviewer who approves converted scenarios and resolves questions about expected behavior.
Missing any of these usually stalls the work at the point where a decision is needed. Name the people and confirm access before the scope is signed, so the schedule in the written scope reflects who is actually available.
Can our own engineers convert promptfoo tests into scenarios internally?
Yes, a team can do this internally if it already maintains promptfoo configurations and understands its assertions. The work is refactoring: moving repeated blocks into scenarios, checking that each one still produces the same results, and documenting the new structure. Internal teams usually take longer when they lack time to review each assertion, or when the suite spans many data owners. Outside help makes most sense when the inventory is large, the assertions need redesign, or the team wants an independent check of results before the old tests are removed. Compare an internal estimate with a written scope before deciding.
How long does a promptfoo scenarios conversion take once scope is agreed?
The timeline is set in the written scope after it is agreed, and this page does not give a duration. It depends on the same drivers as cost: the number of copied blocks, data sources and configurations, the cleanup needed, and how quickly reviewers respond. Ask for a schedule that lists milestones, what your team must provide before each one, and how results will be compared before the old test blocks are removed. Delays often come from waiting on data owners or reviewers, so name those people before the work starts.
Do promptfoo scenarios need the self-hosted server to run?
No. Scenarios are part of the promptfoo configuration, and local runs work without the self-hosted server. The promptfoo self-hosting documentation describes the server as an Express app with a web UI and API, which is useful when a team wants shared results. Its SQLite storage cannot be shared across replicas, and the project does not recommend it for production use. Decide on the server separately from the scenario refactor, and confirm the setup in your own environment before relying on it.
How do we confirm converted scenarios still catch the same failures?
Run the old and new versions against the same data and compare pass and fail results case by case. Explain every difference before accepting the change. Check that each scenario still includes assertions that reject bad answers, since an assertion that only passes good answers hides regressions. Keep the old blocks until the reviewer accepts the comparison, then remove them in one change under version control. Store the commit and run outputs together so the evidence can be reproduced later.
Do LLM judge assertions add recurring cost after scenarios are built?
Yes, when scenarios use an LLM as the judge, each run makes additional model calls, and your model provider bills those calls. These costs recur on every run, so the number of scenarios multiplied by variants and data rows drives the total. Deterministic assertions, such as exact checks on structured fields, avoid those calls. Choose the judge model deliberately and record which model grades each assertion, because changing the judge can change results. The design and review work for the judge is one-time, while the model calls continue as long as the suite runs.
Security and data handling when scenarios read sensitive test data
Scenarios make it easy to point the same tests at many datasets, including datasets with customer records, employee data or regulated content. The cards below cover where that data goes, where promptfoo keeps it, and the controls to set before a team runs a scenario against sensitive data.
Local runs keep credentials under your control
promptfoo runs on the machine that executes it and talks directly with the model under test. Provider credentials and the prompts sent to the model therefore stay under the team's control. The model provider is still a third party, so confirm its data retention and training terms for any dataset a scenario reads. Local result files also hold copies of test inputs, so apply the same disk and backup controls to them that you apply to the dataset itself.
promptfoo introductionSelf-hosted app limits
The self-hosted promptfoo app stores its data in a local SQLite database. That database cannot be shared across replicas, and the app has no RBAC, no horizontal scaling, no built-in authentication and no SSO. The documentation states it is not recommended for production use, so keep scenario runs that read sensitive data on an isolated host until you have a supported architecture. Confirm the current limits with promptfoo before you plan a team rollout.
Self-hosting docsSharing and SSO need Enterprise
Team sharing, teams-based access control and SSO are Enterprise features according to the pricing page. The free Community edition includes all LLM evaluation features, but team sharing and access control are not part of it. If several people must read scenario results that contain sensitive data, request a quote for Enterprise or On-Premise and confirm which roles and SSO providers it supports. Pricing is custom, so the quote follows the written scope.
promptfoo pricingKeep keys out of committed configs
Scenario configs often reference provider keys and tokens for private dataset sources. Keep these out of the config files committed to version control by reading them from environment variables or your CI secret store, and reference them by name in the config. Add local config and .env files to .gitignore, and scan repository history before publishing. A key that reached a shared commit should be rotated, because deleting it from the latest commit leaves it in history.
Restrict access to regulated datasets
A dataset with personal or regulated data needs a named list of readers, and that list should match the people who run the scenario. Restrict who can read these datasets in every place a copy can land, including local checkouts, CI artifacts and shared results views. Ask your team which of these locations it uses and who can read each one. Masked or synthetic copies for everyday runs keep the sensitive source limited to a small group of readers.
Record the dataset and config behind results
A result is useful for audit or regression review only if you can tell which dataset version and config produced it. Record which dataset and config produced each result in the run notes, including the dataset source, its version or commit, the scenario config and the promptfoo version. When the dataset changes, pass rates from before and after the change are not directly comparable. Store this record with the results under the same access controls, because it also describes sensitive data.
Limits to confirm in your environment before relying on scenarios
Scenarios depend on more than the config file. Each limit below comes from the software, its runtime, the provider account, the reporting layer or the data behind the suite, and each has an owner who can confirm it. Check them in your own environment before a team builds a shared suite on top of scenarios.
Scenario syntax and version
The scenario layout you plan depends on the promptfoo release your team installs, so the syntax in your examples must match that version. Read the configuration docs for the exact release you pin, then run a small config with the planned layout before copying it into other suites. Ask the vendor whether the scenario keys you use stay stable across minor releases and how breaking changes are announced before upgrades.
promptfoo docsNode.js runtime and pinning
The npm release 0.124.1 requires Node.js 22.22.0 or newer, so laptops, runner images and any container base image must meet that floor. Pin the promptfoo version in package.json with a lockfile, and pin the Node.js version in CI images and developer setup notes. Confirm the engine requirement on the npm page for the release you choose, and ask your platform team whether your approved Node.js line already meets it.
Caching and provider rate limits
Scenarios expand one test definition into many cases, and each case can send a request to the target provider. Confirm how the installed release caches provider responses, and whether the cache key includes the prompt and variable values so a changed scenario does not return an old answer. Ask your provider for the request and token limits on the model account you test with, then set concurrency and retries so a full run stays inside them.
Variant comparison in reports
Scenarios exist to run the same tests across several data sets or configurations, and a comparison only helps if the reporting views keep each variant labeled. Check whether the web viewer, the CLI output and any export you use show the variant and scenario identifiers beside every result. Run a small comparison, export it, and confirm each row still carries its variant before a team uses the numbers in a release decision.
Self-hosted server limits
If results are shared through the self-hosted server, plan around its documented limits. The app stores data in a local SQLite database that cannot be shared across replicas, and the documentation lists no RBAC, no horizontal scaling and no built-in authentication or SSO. It also does not recommend the server for production, so decide whether a single instance behind your own access controls meets your needs, or keep results in files your team controls. Confirm these limits for the release you deploy.
Self-hosting docsDataset license terms
Scenarios often pull a public or gated dataset into the suite, and that dataset keeps its own license. promptfoo's MIT license applies to the software, so the test data needs a separate check. Before loading a dataset, read its license on the hosting page, confirm that internal evaluation, red teaming and sharing results outside the company are allowed, and record the license beside the config. Ask legal to approve any gated dataset that may require an access agreement or token.
How DeployOpen scopes and delivers promptfoo scenario work
DeployOpen treats scenario work as a configuration project first: we map which test sets, prompts and providers need the same checks, then decide what stays in the shared scenario and what stays with each data source. Engagements are fixed-scope, so the scope, deliverables and timeline are agreed in writing before work starts. Ongoing support is available as a retainer once your suites keep growing.
How we scope
- The written scope lists which test sets, prompts and providers the scenarios must cover before work starts.
- We agree which checks stay in each shared scenario and which belong to a single data source or team.
- Engagements are fixed-scope, and ongoing support is available as a retainer after handover.
How we build
- We set up the scenario structure in your repository so changes go through normal code review.
- Each scenario is run against your current data sources and configurations to confirm it produces the expected test count.
- We test a deliberately broken answer against each shared check to confirm the scenario fails when it should.
How we hand over
- Handover includes the scenario files, a README describing how to add a data set, and the run commands.
- Your team walks through the layout, naming conventions and how to add a new data set or configuration.
- Documentation records the scope, decisions and open questions so reviewers can trace why each scenario exists.
How we support
- Retainers cover updates to the scenarios when your data sets, providers or promptfoo version change.
- Support can include checking that the Node.js runtime on your CI runners meets the promptfoo release requirement.
- Scenario suites can be reviewed on a schedule, with data source changes tested before merge.

