Retrying failed promptfoo eval results without inflating your pass rate
A large eval or red team run that stops partway through on timeouts or provider errors forces a choice: rerun everything, or rerun only the results that never finished. Retrying only the errored results is the usual path, and the core work is keeping those errors separate from failed assertions. An errored result means promptfoo never received a usable answer from the provider, so the test never reached a verdict. A failed assertion means the model answered and the answer did not meet the check. If the two are mixed, a timeout can count against your pass rate, or a rerun can quietly convert it into a pass. promptfoo is MIT licensed and runs completely locally, so the retry runs on the machine or runner that holds the results file, using the provider credentials configured there.
Before you script the retry, confirm the command and its flags in the documentation for the promptfoo release you have installed, because the exact options are the part most likely to change between versions. The current npm release is 0.124.1, which requires Node.js 22.22.0 or newer, so check the runtime on every CI image and shared machine before the first retry, not after it fails. This matters most for teams running evals in CI or on shared machines, where one job may write the results file, another job may read it, and the retry may run under a different Node.js version or user account than the original run. Record the promptfoo version alongside each results file so that any later rerun can be traced to the release that produced it.
Decide the rule before the rerun starts. Count errored results separately from passes and failures in the pass-rate gate, and let a retry replace an errored result only with its new outcome, never with an assumed pass. Keep the original results file so reviewers can see how many results were recovered and how many still errored. If errors remain after the retry, mark the run as incomplete and do not count it as passing. Ask your team to confirm how your gate treats errored results, whether they are excluded from the denominator or block the gate entirely, because that choice changes the reported pass rate even when model behavior has not changed.
How a result moves from provider error to retry or gate
The diagram starts with one eval request sent to the target. A response goes straight to the graded assertion, and a provider or timeout error goes to a retry step. After the retry, the check asks whether it succeeded. A successful retry produces a graded result that flows to the pass-rate gate. An error that is still unresolved goes to a separate error report, which stays out of the gate. When you review a run, confirm that the error report is empty or explained, and that the gate counts only graded assertions.
Decision path for one test result, from request to retry or pass-rate gate.
Telling provider errors apart from failed assertions
A provider error or timeout and a failed assertion can look alike in a results summary, but they answer different questions. A provider error or timeout means the target never returned a valid response, so there was nothing to grade. A failed assertion means the model answered, the answer was graded, and it did not meet the check. Keep these two outcomes in separate buckets before you read any pass rate. Only a failed assertion says something about the model's behavior. An error says something about the endpoint, the network, the credentials or the load your run placed on the target, and those are the first things to examine when errors climb.
Counting both as failures distorts the pass rate in a way that misleads the team reading it. If a run times out on a large share of its cases, the pass rate drops even though the model was never asked to answer those cases. A regression alarm then fires on the model, and someone spends days tuning prompts when the actual fix is a timeout setting, a concurrency limit or a stable endpoint. The distortion also runs the other way, because a flaky target can hide a true model regression behind noise. Separate counts let you see whether the target or the model is the problem, which is the question a gate should answer first.
Before you write any gate, confirm how your version records errored rows. Run a small, deliberately broken test, such as a target pointed at a wrong endpoint or a timeout set very low, and inspect the output file that run writes. Check whether an errored row carries its own status, where the error message is stored, and whether the summary totals count it as a failed assertion, an error or neither. Field names and summary behavior can change between releases, so confirm them against the version you pin and its release notes. Only then write a gate that computes the assertion pass rate over completed rows and fails separately when the error rate rises.
Retry options for failed promptfoo eval results and when each fits
This table compares five ways to recover from errored results in a promptfoo run, along with the time, provider spend and risk of each. Read each row by first identifying the kind of failure you are seeing, then check the cost column against your provider quota and CI time. The main takeaway is that retrying errors and gating on error rate are targeted, lower-cost options, while full reruns should be reserved for changes that invalidate earlier results.
| Option | When it fits | Time and provider calls | Main risk |
|---|---|---|---|
| Retry errored results only | Run hit timeouts, rate limits or network errors while assertions on completed results were sound. | Time and calls scale with the number of errored rows, so this is the cheapest rerun in provider spend. | Repeats a systemic fault if no one checks why errors happened. Confirm command options in the docs for your installed version. |
| Rerun the whole suite | Prompt, config, model or provider changed, so earlier results no longer describe the current setup. | Full time and full provider spend on every run, including rows that already passed. | Costliest option, and new errors can mix with old ones, making the cause harder to trace. |
| Raise provider timeouts | Healthy but slow responses are cut off, for example long outputs or reasoning-heavy models. | Longer waits per call and held concurrency slots, with few extra calls but a slower run. | Hung requests also wait longer to fail. Confirm the timeout setting and its default for your version. |
| Lower concurrency | Provider returns rate-limit errors under parallel load, and the same calls succeed when spaced out. | Run takes longer overall, but fewer calls are wasted on retries that get throttled again. | Too low a limit slows CI for no gain. Confirm the concurrency setting and its default for your version. |
| Gate on error rate separately | Pass-rate gate should ignore infrastructure noise, but a run with many errors must still fail. | One extra check in the pipeline, with no added provider calls. | A loose error threshold can hide a broken provider. Set it apart from the pass-rate threshold and review both. |
Set up retries for a long promptfoo run
This sequence sets up retries for a long promptfoo run so that provider errors and timeouts are recovered without rerunning passing results or changing what counts as a failed assertion. The result is a run you can trust: a pinned environment, a saved record of error counts, a retry that touched only errored rows, and a pass-rate gate checked against both a bad assertion and a provider error.
Pin promptfoo and the Node.js runtime
Pin the promptfoo version and the Node.js runtime for your workstation and your CI runner before any run starts. The npm release 0.124.1 requires Node.js 22.22.0 or newer, so set that as the minimum in your runner image and lock the promptfoo version in your project manifest. Retry behavior and error reporting can differ between releases, so the same versions must be used for every step in this sequence. Done when
promptfoo --versionandnode --versionreturn the pinned values on both the workstation and the runner.Run a small sample to see how errors appear
Run a small sample of test cases against the target, writing the output to a JSON file so you can inspect each row. Include at least one case that will hit an error, such as a throwaway config that points the provider at an unreachable address, so you can see how promptfoo records a provider error. Confirm the output separates provider errors from failed assertions. Check: the error count in the output summary matches the number of rows marked as errors, and no failed assertion is labeled as an error. Do not move on until you can tell the two apart in the file.
Set timeouts and retry behavior in config
Set a request timeout and a retry count on the provider in your eval config, using the key names from the promptfoo documentation for your model platform. Base the timeout on the response times you observed in the sample run, and keep the retry count modest so an unresponsive endpoint cannot stall the whole run. Key names vary by provider, so confirm them against that provider's page before relying on them. Check: run the sample once more with a deliberately low timeout and confirm the affected rows are recorded as errors in the output while the run still completes.
Run the full suite and save the output
Run the full suite with the same config and versions, saving the output file to a durable location that the retry step can read. Record the total, pass, failure and error counts from the summary in your run notes before changing anything else. The error count is the figure the retry step works from, so keep it alongside the saved file. Check: the pass, failure and error counts add up to the total test count, and the saved file has one row for each test result. If the counts do not add up, stop and inspect the output before retrying.
Retry only the errored results
Run the promptfoo retry command against the saved output from the full run so that only rows recorded as errors are executed again. Check the available options with
promptfoo retry --helpon your pinned version, because flags can change between releases. Keep the original output file untouched and write the retry results to a new file. Check: compare the two files. The number of rows that changed should equal the error count recorded in the previous step, and every passing row and every failed-assertion row should keep its original result. If any passing or failed-assertion row changed, stop and investigate before continuing.Confirm the gate reads graded results only
Point the pass-rate gate at the retried output and confirm it computes the rate from graded results only, with errors handled as a separate condition. Errors that remain after the retry should block the gate, and they should stay in the total rather than being dropped from it. Test the gate twice: once with a deliberately bad assertion, which should fail the gate, and once with an unreachable provider that produces only errors, which should also fail the gate. Check: both test runs return a failing gate status in your CI system, and the clean run passes only when the remaining error count is zero.
How retry handling differs between laptops, CI and shared servers
On a laptop, promptfoo runs on your machine and calls the model provider directly, so a retry uses your own API key and quota. Nothing is shared by default, which makes the laptop the quickest place to rerun a few errored results. The trade-off is that the process stops if the machine sleeps or the network drops, and the results exist only where you saved them.
- Provider spend:
promptfoo retryis designed to rerun only the errored results, so the calls you pay for should track the error count. Confirm this with a small run before retrying a large suite. - Output location: Results land at the path you gave the output option. Use a new file name so the failed run stays available for comparison.
- Run duration: No CI timeout applies, but sleep, a VPN drop or a closed terminal ends the process. Keep long retries in a terminal multiplexer or on a machine that stays awake.
- Who sees results: Only you, plus anyone you send the file to. Nothing leaves the machine unless you run a share command.
Before retrying from a laptop, confirm the API key in use has quota for the rerun and that the failed run's output file is saved where the retry will not overwrite it.
In CI, promptfoo runs on a runner that the pipeline provisions, using API keys from the pipeline's secret store. A retry is usually a new pipeline run, so it repeats setup and inherits only what the CI system keeps between jobs. The job also runs under a time limit enforced by the CI system, not by promptfoo.
- Provider spend: Calls bill to the team account behind the stored key. A new run repeats setup, and the response cache helps only if it is persisted between jobs.
- Output location: Files are written to the job workspace. A fresh runner discards them when the job ends, so publish the output as a pipeline artifact.
- Job time limit: The runner stops the job at its configured timeout, which can leave the output file incomplete. Keep the retry set small enough to finish within that limit.
- Who sees results: Anyone with access to pipeline logs and artifacts. Check that outputs and logs contain no secrets or sensitive prompt data before widening access.
Before relying on CI retries, confirm the job timeout, how long your CI system keeps artifacts and whether the cache survives between runs.
A shared self-hosted promptfoo server gives a team one web UI and API, deployed with Docker, Docker Compose or Helm. The evals still run from the machine that starts them, and the server stores the results. Its storage model determines what a retry record is worth, so do not treat its history as the archive.
- Provider spend: Retries launched from the CLI bill to the key that CLI uses. Confirm in your deployment whether the server itself makes any provider calls.
- Output location: Output files land on the machine that ran the CLI. The server keeps its records in its own storage, so keep the output file as the record you rely on.
- Retry history durability: Data lives in a local SQLite database that cannot be shared across replicas and is not recommended for production. Back up the database or export results if you need them later.
- Who sees results: The self-hosted app has no RBAC and no built-in authentication or SSO, so anyone who can reach it can read the results. Enterprise adds teams-based access control and SSO.
Before trusting a shared server, confirm who can reach it, where the database file sits and when it was last backed up, and read the self-hosting documentation.
What retried runs send, store and expose
Each card names one exposure that a retry can repeat or widen, with the control to confirm before you enable retries in a pipeline. A retry repeats the original run's data flow, so each attempt carries the same exposure again.
Same prompts sent again
Each retry sends the same prompts, variables and test data to the provider that the original run did. Every repeated call adds exposure and spend, and the data leaves your environment again under the same terms. Before enabling retries in a shared pipeline, confirm which provider endpoints receive the data, that your data processing agreement covers repeated submissions, and how many retry attempts the job allows. Illustrative: a suite that times out on a long run can resend the whole dataset on every attempt.
Output files keep prompts
Failed and retried runs each write output files, and those files usually hold the full prompt, the rendered input and the model response. A retry adds another set of files next to the first, so the same sensitive text can appear in more than one file. Confirm where the output directory lands in your CI workspace, who can download job artifacts, how long your artifact store keeps them, and whether a cleanup step removes files from failed attempts before the job ends.
API keys in CI logs
Verbose and debug output during a retry can print configuration, environment values or request headers, depending on the logging level. A key that reaches a CI log stays in the job history until someone deletes it, so anyone with read access to past jobs can see it. Confirm that provider keys are stored as masked secret variables, that retry jobs do not set verbose or debug logging by default, and that log masking has been tested with the key format your provider issues.
Error messages echo content
Provider errors and validation messages sometimes repeat part of the request, such as a prompt fragment, a document excerpt or a field name with its value. When a retry fails, engineers often paste that message into a ticket, chat or public issue tracker. Check how your provider formats error bodies, redact messages before sharing them, and confirm that your team's incident template asks for error IDs and timestamps instead of full payloads.
Shared results upload data
Sharing results sends eval output to a cloud workspace or a self-hosted server, and a retry job that includes the share step uploads its results again. The self-hosted app stores data in a local SQLite database that cannot be shared across replicas and is not recommended for production use, so check where that database sits before pointing a pipeline at it. Confirm whether the share step runs in retry jobs, which endpoint it targets, and who can read the uploaded results.
Self-hosting docsRetry loops trigger abuse controls
Automatic retries can send bursts of requests in a short window, which may hit provider rate limits or trigger abuse detection on an account. Repeated failing calls can look like misuse to a provider, and a suspended key stops every workload that shares it. Confirm the rate limits and usage policy on your account, that retries wait between attempts, that the job caps the number of attempts, and that someone is alerted when error rates climb during a retry.
What do teams ask before they retry failed promptfoo eval results?
How much effort does it take to set up retries for promptfoo evals?
For one suite, setup is usually a small configuration and CI change, and most of the effort goes into deciding what counts as a retryable error. The work has three parts: confirming which failures come from the provider or network (timeouts, rate-limit responses, server errors) and which come from a failed assertion; wiring promptfoo retry or a rerun of only the errored rows into your pipeline; and agreeing how many attempts are allowed before a run is marked as an infrastructure failure. Classification and wiring are one-time work, but the classification rules need review whenever a provider, an assertion or the promptfoo version changes. Ask for a quote that prices these parts separately, so you can see which part recurs.
What drives the time spent on promptfoo retry work?
Four factors set most of the time: suite size, provider speed, error rate and CI limits. Each one changes how long a retry cycle takes and how much review the results need.
- Suite size: more cases mean more errored rows to classify and more reruns to verify.
- Provider speed and quotas: slow models lengthen every attempt, and rate limits decide how fast retries can run without failing again.
- Error rate: a suite with frequent transient errors needs more retry rounds and more log review before its gate can be trusted.
- CI limits: job timeouts, runner minutes and artifact retention set how many attempts fit in one pipeline run.
Ask the written scope to state the suite count, the environments, the provider list and the CI platform, since these inputs shape the schedule more than the retry code does.
What does the team need to provide for promptfoo retry work?
The team needs to provide access, keys and sample data, plus one owner who can approve changes to grading. Specifically:
- CI access: pipeline configuration, secrets management and permission to rerun jobs in the environment where the evals run.
- Provider keys: API keys with enough quota for reruns, preferably from a test or staging project so retries do not consume production capacity.
- A representative sample: sanitized failed results from recent runs, including timeouts, rate-limit errors and genuine assertion failures, so the classification can be tested on each type.
- A decision owner: someone who signs off on which errors are retryable and on any change to gate thresholds.
Agree how sample data is handled before it is shared, because eval outputs can contain sensitive prompts or model responses. Ask the scope to list each account and permission needed, and who provides it.
Can our own team set up promptfoo retries without a partner?
Yes, a single team can usually set up retries for one suite that calls one provider from one CI system, using the promptfoo documentation as the starting point. The job gets harder across many suites, several environments, providers with different error formats and more than one CI system, because each combination needs its own error classification and its reporting has to stay consistent. Ownership also matters over time: someone has to maintain the classification after each promptfoo upgrade and after provider API changes. If your team has the CI and evaluation skills but little spare capacity, a fixed-scope engagement can cover the build and handover, and a retainer can cover ongoing maintenance.
How should error rates be gated without hiding genuine regressions?
Report errors as their own number, and never count them as passes. Keep two measures: the assertion pass rate, calculated only over results that completed, and an error rate with its own limit. Fail the pipeline when the error rate passes the agreed limit, because a run that mostly errored shows nothing about quality. After retries, a failure that repeats across every attempt is a genuine regression, so it should still fail the gate. Report counts of rows that errored and then passed, so flaky providers stay visible instead of disappearing into the pass rate. Set limits from your own baseline runs, and require a named sign-off before anyone raises the error limit or changes what counts as retryable. Ask the scope to define each threshold in writing.
What changes in retry behavior after a promptfoo upgrade?
Retry behavior can change after an upgrade, so re-baseline before you trust the gate. The changes to check are:
- Error reporting: which results are marked as errors, and where the error details appear in exported output.
- Config keys and defaults: retry, concurrency and timeout settings that your pipeline depends on.
- Runtime requirements: the npm package for promptfoo lists Node.js 22.22.0 or newer, and CI images may need updating.
Before merging an upgrade, rerun a fixed set of previously failed results on the old and new versions and compare error counts and gate outcomes. Pin the version in CI and Docker so each upgrade is a deliberate change. Ask for upgrade re-baselining to be listed in the written scope, with the baseline set named.
Limits to confirm for your promptfoo version and environment
A retry plan only works when the installed release, the model provider and the CI runner behave the way the plan assumes. The six items below are where retry plans most often break, and each card names where to confirm it for your own version and environment.
Retry command and flags
Confirm the exact retry command and each of its flags in the release you have installed, because flags can change between releases. Print the help output for the retry command on your pinned version, then check the release notes for what the command re-runs, such as only errored rows or every row in the run. Before trusting it on a long run, test it on a small suite that includes one deliberately failing case.
Promptfoo release notesError rows in outputs
Check whether errored rows are written distinctly from failed assertions in each output format you use. An error from a timeout or a provider failure may look like a failed assertion in some exports, and that difference decides whether a pass-rate gate counts the row. Force a provider error in a small run, then inspect the fields or markup for each format you produce, such as JSON, JSONL, CSV, HTML or JUnit XML, before you write any gate logic against them.
Node.js 22.22.0 requirement
The 0.124.1 release on npm requires Node.js 22.22.0 or newer. Check the runtime on every machine and CI image that will run retries, including build agents and containers, because an older Node.js can fail before any retry starts. Confirm the engine requirement on the npm package page for the version you pin, and print the Node.js version inside the job before the eval step.
promptfoo on npmProvider quotas and timeouts
Provider quotas and request timeouts set the real ceiling on retries a run can absorb. A retry sent into an exhausted rate limit will fail again, and a timeout shorter than the model's typical response time will keep producing errors. Read your current request, token and concurrency limits in the provider's dashboard, and the timeout values in your promptfoo provider configuration, then set the retry count and concurrency from those numbers.
CI runner time limits
Each CI system enforces a maximum job duration, and a retry pass can push a long eval past it. Check the job timeout set on your project or runner, the default that applies when none is configured, and whether artifacts survive a job that times out. If a retry pass is needed, plan it as a separate job or stage that reads the earlier output, so one cutoff does not discard both passes. Confirm these values in your CI provider's documentation and your admin settings.
Single-instance self-hosting limits
A self-hosted promptfoo server runs as one instance with a local SQLite database that cannot be shared across replicas. It has no horizontal scaling, no RBAC and no built-in authentication, and the project does not recommend it for production use. If retried results go to a shared server, confirm who can reach it, how access is enforced at your network or reverse proxy layer, and how the database file is backed up.
Self-hosting docsHow DeployOpen scopes and supports promptfoo retry and error handling
DeployOpen designs retry behavior as part of the evaluation itself. We start from the written scope for Retrying failed promptfoo eval results, configure promptfoo in infrastructure you control, and test that timeouts and provider errors get recovered while failed assertions stay visible. The outcome is a run your team can explain to reviewers and rerun with confidence.
How we scope
- The written scope names which providers, eval suites and CI jobs the retry behavior covers.
- We agree which error types count as retryable, such as timeouts and provider errors, before work starts.
- Engagements are fixed-scope, so deliverables and timelines are agreed in writing before any work starts.
How we build
- Configure retries for errored test cases, leaving failed assertions reported as failures with their original output.
- Keep error counts separate from assertion failures in reports, and keep them out of pass-rate gates.
- Set backoff and concurrency limits alongside rate-limit and cache settings, so retries add as little provider load as possible.
How we hand over
- A runbook covering the retry settings, error categories, and how to retry errored cases.
- Versioned configuration files and CI job definitions, stored in your repository, with the promptfoo version pinned.
- A walkthrough with your engineers, including a test run that shows errors and assertion failures reported separately.
How we support
- Ongoing support is available as a retainer, covering upgrades and changes to retry behavior.
- Re-check retry and error separation after each promptfoo upgrade, since provider and report behavior can change between releases.
- Continuous testing can rerun error-handling checks on a schedule you agree, such as after provider changes.

