Debugging promptfoo runs with logs and verbose output

When a promptfoo run fails or returns odd results, the fastest path is to turn on debug output for that run, read it in order, and rule out setup problems before blaming the model. This page explains which switches to use, how to read the output safely, and what to confirm in your version.

On this page

Why promptfoo debugging starts with the right flag

A failed, stalled or odd promptfoo eval or red team run leaves the team asking where the fault sits: configuration, provider, target or grading. Debugging starts with a verbose or debug run of the failing case alone, so the output shows what promptfoo sent and received at each step. Narrow the run to the one test that misbehaves, then repeat it with --verbose or with LOG_LEVEL=debug set in the environment. Keep the config file and environment unchanged so the verbose run reproduces the same failure. Read the output before you change anything, because a single failing case usually shows which of those four areas is responsible.

The flag matters more than it looks. On promptfoo eval, -v is the short form of --vars, which sets variables for the run, so it does not turn on logging. A team that adds -v to get more detail may see no extra output and assume the tool is quiet. Use --verbose on the command line, or set LOG_LEVEL=debug when a script or CI job makes editing the command awkward. The promptfoo command line reference is the place to confirm how each flag behaves in the version your pipeline pins, before you script around any of them.

Promptfoo runs locally on the machine that calls the model, so debug output is written on that machine and, in CI, into the job log of the runner. Confirm what your pipeline keeps and who can read it before you attach a log to a ticket, because the log reflects the prompts and responses the run handled. Teams need this page in three situations: a failure that appears only in CI, where the runner's Node.js version (22.22.0 or newer), environment variables or network path may differ from a laptop; an error that does not show in the summary table; and a run where a provider or target misbehaves in a way the pass or fail result does not explain. In each case, the verbose output is the evidence to collect before you change the configuration.

Which debug switch to use for a failed promptfoo run

This decision path suggests where to start, and the run output decides the next step. Begin with the Node.js check, since promptfoo requires Node.js 22.22.0 or newer, and confirm it before anything else. Then sort the failure into one of four types. A configuration error points to -v, which only passes variables into eval. A provider or network error points to LOG_LEVEL=debug, which fits CI jobs where the environment controls logging, and the next check is the provider configuration. An assertion or grading result, or an unclear result, points to --verbose on one run, followed by a review of the assertion or a rerun of one failing case.

Decision path for choosing a debug switch, not a fixed procedure.

Debug switches and when each fits

This table compares the switches for debugging a promptfoo run, including one flag that looks like verbose output but sets variables. Read each row by scope (one run, a shell session or saved logs) and by what the output can contain. Check promptfoo's command line documentation for flag behavior, and confirm subcommand details for your version before relying on them.

OptionWhat it changesWhere output goesWhen it fits and main trade-off
--verbose on promptfoo evalEnables debug-level logging for that one run.Printed in the terminal for that run. Confirm any log file location in the CLI reference.Good for one failing run you can rerun. Output can include prompts, variables and responses.
LOG_LEVEL=debug as an environment variableTurns on debug logging without changing the command line.Same output path as --verbose. Confirm the destination in the CLI reference.Fits scripts and CI jobs where the command line is fixed. Log volume and sensitive content are the trade-off.
-v on promptfoo evalShort form of --vars, which sets variables for the eval. It does not turn on debug logs.No debug log output. Confirm the variable syntax in the CLI reference.Use when you mean variables. Mixing it up with verbose output sends you chasing the wrong problem.
promptfoo logs commandReads saved run logs, if your version includes it. Confirm the name and flags.Confirm the output location in the CLI reference for your version.Fits reviewing a finished run after the fact. Stored logs may hold prompts and responses, so restrict access.
Debug output from the CLI (any debug subcommand)Diagnostic detail for the commands you run. Confirm the exact subcommand and flags for your version.Confirm the output location in the CLI reference for your version.Fits a run that fails before any eval starts. Trade-off: output may include configuration, prompts or responses, so review before sharing.

How to reproduce a failed promptfoo run with logging on

This sequence narrows a failed promptfoo run to one test case, then captures verbose and debug output so you can see where the run stopped. The result is a pair of saved logs and a comparison against the same case run without debug flags, which shows whether logging changed the outcome.

  1. Confirm the promptfoo version and Node.js

    Run promptfoo --version and node --version in the same shell you will use for the rerun. The Node.js version must be 22.22.0 or newer, the minimum required by the current promptfoo npm release, so an older runtime can cause failures unrelated to your test. Write both values in your notes so the run can be repeated later. The step is done when both outputs are recorded and Node reports 22.22.0 or higher.

  2. Isolate one failing test case

    Open the config that produced the failed run and copy one failing test case into a small config, along with the prompt and provider it uses. Keep the variables and provider settings identical to the original so the failure can reproduce. Run the small config and confirm it still fails, and note the test description or row number so you can find that case in the logs. The step is done when a run with only that case reproduces the failure.

  3. Rerun the case with --verbose

    Run the isolated case with --verbose added to the promptfoo eval command, keeping the provider, model and variables unchanged. Verbose output prints more detail to the console while the eval runs, so you can see each stage the case passes through, from the provider call to grading. In a healthy run, each provider call completes and each assertion reports a result. In a failing run, a line shows an error, a timeout or a configuration message in place of a response or result. The step is done when you can name the stage where the run stopped.

  4. Rerun with LOG_LEVEL=debug in the same shell

    Without closing the terminal, set LOG_LEVEL=debug and run the same command again, so the environment matches the verbose run. Debug logging is a second way to enable detailed logs, so the output should cover the same stages, and you should confirm the extra detail your version prints. Compare the two runs side by side, checking that the same test case fails at the same stage in each. The step is done when both runs have finished and the verbose and debug outputs are visible together.

  5. Save the output to a file

    Redirect each run to a file, for example promptfoo eval ... > run-verbose.log 2>&1 for the verbose run and a second file for the debug run, so standard output and errors are both captured. Use names that identify each run so you can compare them later. Store the files where your team controls access, because logs can include prompts, model responses and variable values. The step is done when each file opens and contains the run from the first line to the final summary.

  6. Check the logs for provider errors and timeouts

    Search each saved file for error and timeout, then open the matching lines and note which provider call each one belongs to. In a healthy run, a provider call is followed by a response, while a failing call ends in an error from the endpoint or a timeout with no response. Repeated timeouts across many cases can point to the endpoint, the network or concurrency settings, while a single timeout may point to one slow request. Check those settings before changing the test. The step is done when every error line is linked to a call.

  7. Check parse errors and grading results

    Look for configuration parse errors that name a file, key or line, since these indicate a problem in the YAML or JSON itself and mean the model never ran. Then find the grading lines for the case: a failed assertion that has a model response is a quality result, while an error during grading means the check did not run and should not be counted as a model failure. Record each assertion name and its outcome. The step is done when you can say whether the failure came from configuration, the provider, the grader or the model.

  8. Compare with a run without debug flags

    Run the same isolated case once more with no --verbose flag and no LOG_LEVEL setting, then compare its result with the two logged runs. Check that the pass or fail outcome, the stage where the run stopped and the grading results all match. If the outcome changes when logging is on, record that difference and have the team confirm the logging setup before changing the config, since the difference is a finding to explain. The step is done when the plain run's outcome is recorded next to the logged runs.

Where debug output goes in local, CI and self-hosted setups

On a developer workstation, debug output goes to the terminal where you run the command. promptfoo runs evals on your machine and talks directly with the model provider, so the log stays in your shell session unless you save it. Turn on debug logging with --verbose or LOG_LEVEL=debug. The -v flag on promptfoo eval is the short form of --vars, so it does not enable debug output.

  • Terminal scrollback: Output remains in the terminal buffer until you clear the window or close the session. Redirecting it to a file keeps a copy, so decide where that file belongs before you start the run.
  • Who can read it: The operating system user who owns the session, plus anyone with access to the machine, a shared screen or a synced folder that holds a saved log.
  • How long it persists: Until the terminal is cleared or the saved file is deleted. Confirm whether your endpoint management or backup tooling copies those files.
  • Node.js version: Confirm that the workstation runs Node.js 22.22.0 or newer, since an older runtime can fail before any useful debug output appears.

Before you share a local log, check it for credentials, endpoint URLs and test data.

Keeping debug output from exposing prompts, keys and results

Debug output can record what a promptfoo run sent and received, so it can hold the same data as the eval itself. The five risks below each name a place where that output can reach people who should not see it. Each card pairs the risk with a control you can put in place before the next run.

Prompts and variables carry regulated data

Prompts and test variables are often built from production records, support tickets or case files. When verbose output echoes them, a customer name, account number or health detail can end up in a log that was never meant to hold it. Before you turn on debug output, confirm which datasets feed the vars block, and use synthetic or minimized records for any suite whose logs will be saved or shared.

Responses repeat sensitive content

Model responses can repeat whatever the prompt contained, and a grader's reasoning can repeat it again. A debug run therefore creates a second copy of that text beside the results file. Treat every debug log as containing model output, and redact it before the log goes into a ticket, chat thread or email. Test your redaction step against the identifiers in your own data, since a generic pattern may miss the formats your records use.

API keys in configuration echoes

If a team logs the environment or prints the full configuration while debugging, provider API keys can appear in the output. Keys are often set through environment variables that a wrapper script, shell trace or CI step dumps without anyone noticing. Store keys in the CI secret store, inject them only into the job that calls the provider, and never add env or printenv steps to a pipeline that runs promptfoo. Rotate any key that has appeared in a saved log.

CI artifacts exposed to more readers

Debug logs uploaded as CI artifacts often inherit wider access than the eval results. Some pipelines let every developer, and sometimes every member of a project group, download job artifacts, while results reports often go only to the reviewers who need them. Check who can read artifacts for each project, set short retention on logs, and keep verbose output out of artifact paths that a wider group can download. Confirm the retention and access settings in your CI system's documentation before the first run.

Output posted to shared channels

Teams often pipe run output into a chat channel, a status page or a shared dashboard so everyone can see the pass rate. Debug output sent there spreads prompts and responses to every member of the channel and to anyone who later searches its history. Post only summary results to shared channels, keep --verbose and LOG_LEVEL=debug out of any pipeline that posts outside your team, and review the notification step whenever someone adds debugging to a job.

Command line docs

Questions buyers ask about promptfoo debugging support

Can our own team debug most promptfoo run failures without outside help?

Yes, for most single-run failures, your team can work through the problem with the documented flags. Rerun the failing command with --verbose or set LOG_LEVEL=debug, then read the output for the provider call, the assertion and the config value that caused the failure. Common single-run causes include provider credentials, a mistyped config key and an assertion that does not match the output format, and these usually appear clearly in debug output. Ask for specialist help when failures are intermittent across long runs, when several providers or a self-hosted server are involved, or when the cause sits outside promptfoo, such as network policy, a gateway or a proxy in front of the model. The promptfoo command line docs list the flags to confirm against the version you have installed.

How much effort does a promptfoo debugging engagement usually involve?

Effort depends on how many failure modes the team is seeing and how much of the setup is under investigation, so no fixed figure applies to every environment. A limited engagement covering one failing run and one config file is short. A review across several providers, CI pipelines and a self-hosted server takes longer, because each path has its own logs, credentials and network route. Each separate failure mode needs reproduction, diagnosis, a fix and a retest, so the count of distinct causes matters more than the volume of log output. Ask the provider to list the environments and log sources in scope, and to tie the effort estimate to that list in the written quote.

What makes promptfoo debugging work cost more or less?

The main cost drivers are the number of model providers, the complexity of the CI pipeline, whether a self-hosted server is involved, and how many distinct failure modes exist.

  • Providers: each one adds its own credentials, rate limits and error formats to check.
  • CI complexity: runners, caching and secrets handling add steps between a failure and its log.
  • Self-hosted server: the Express app, its Docker, Docker Compose or Helm deployment and its database add layers to inspect.
  • Failure modes: every separate cause needs its own reproduction, fix and retest.

Diagnosis and documentation are typically one-time work, while retests and any ongoing retainer support recur. Ask the quote to show those parts separately so you can see which costs repeat.

What does our team need to provide for a promptfoo debugging engagement?

The work needs four things from your side: access to a failing run, the configuration behind it, logs from the failure and a test environment with approved keys.

  • Access to a failing run: the exact command, its output and the ability to rerun it.
  • Configuration: the promptfoo config, prompts and provider settings, with secrets removed.
  • Logs: verbose or debug output from the failing run, checked for sensitive content before it is shared.
  • A test environment: a non-production setup where reruns can happen, using API keys your security team has approved.

Ask the provider to confirm which of these they need before work starts, and to name who in your organization approves key use.

Does debugging promptfoo runs require a paid edition?

No. The promptfoo Community edition is free and includes all LLM evaluation features, all model providers and integrations, and red teaming with 10k probes per month, with community support. The --verbose flag and LOG_LEVEL=debug are part of the command line tooling, so debugging does not depend on a paid license. promptfoo Enterprise adds team sharing, teams-based access control and SSO, custom roles and permissions, continuous monitoring and priority support with SLAs, and it is custom priced. Choose Enterprise only if your team needs those features for other reasons. Confirm current edition terms on the promptfoo pricing page before you decide, since editions and limits can change.

What does DeployOpen do in a scoped promptfoo debugging engagement?

In a scoped engagement, DeployOpen diagnoses the failure, fixes the configuration that caused it, documents the procedure your team will use next time and retests the run. Most engagements are fixed-scope, so the scope, deliverables and timeline are agreed in writing before work starts, and a quote follows from that written scope. Diagnosis covers the failing run's logs, provider setup, config and environment. Fixes stay within what the agreed scope names, such as the config file, a CI step or a deployment setting. The documentation is written so your engineers can repeat the steps for the next failure. Retesting confirms the run completes with the fix in place. Ongoing support and continuous testing are available as retainers if your team wants that help beyond one engagement.

Why does the -v flag not show debug output in promptfoo eval?

On promptfoo eval, -v is the short form of --vars, which passes variables into the run, so it does not turn on verbose logging. Debug logs come from --verbose or from setting the environment variable LOG_LEVEL=debug before the command runs. A run that seems to ignore a flag often has a mistyped option, so rerun the command with the long form and compare the output. Keep the two apart in runbooks and CI scripts, because a script that uses -v while expecting verbose output will quietly pass variables instead. Check the flag reference for your installed version, since flag behavior can change between releases.

What to confirm about debug output in your environment

Debug output is only useful if you know what it contains, where it goes and who can read it. The checks below connect the promptfoo version you run, your self-hosted server, your runtime images, your CI runners and your logging policy. Confirm each one before you share logs outside the team that ran the eval.

Flags and subcommands in your version

The flags that produce debug output are --verbose and LOG_LEVEL=debug. On promptfoo eval, the short -v flag sets vars, so it does not enable verbose output. Confirm that promptfoo logs and promptfoo debug exist in the exact release your team installs, because command behavior can change between versions. Run the help output on the pinned version and check it against the command line reference before you write these flags into a runbook.

Command line docs

Full prompts and responses

Verbose output may print the full prompts and responses sent to and returned by the model, along with the variables injected into each test. Those values can include customer records, internal documents or secrets pasted into test cases. Run one eval with synthetic data on the pinned version, then inspect the console, any log file and any output written to disk. Record exactly what appears, and decide whether the team can keep those logs before the first real test suite runs.

Log endpoints on the self-hosted server

The self-hosted promptfoo app is an Express server that serves the web UI and API, and its documentation lists no built-in authentication or SSO for that setup. Check whether any route returns logs or run details, and who can reach it from your network. Send an unauthenticated request from outside your access perimeter and confirm it is refused. Place the server behind your own identity and network controls before you enable any log route.

Self-hosting docs

Node.js version in the runtime image

promptfoo requires a Node.js release at or above the minimum shown here for the current npm release. An older runtime can fail at startup before any debug output is written, which can look like a promptfoo bug when it is an image problem. Check the Node.js version in every base image, developer machine and CI runner that executes evals, including images pinned months ago. Run node --version inside the exact container your pipeline uses.

Minimum Node.js version
22.22.0
npm package page

CI runners and captured output

CI systems keep job logs under their own retention settings, and some save console output as downloadable artifacts. Check whether your runners keep verbose output, who can download it and whether secret masking hides API keys echoed in debug lines. Confirm that debug flags are set only on manual reruns, so routine pipelines do not write prompts and responses into logs on every commit. Ask the platform administrator for the retention period configured for these logs.

Logging policy for model inputs and outputs

Your logging policy decides whether prompts, responses and eval results may enter log stores, tickets, chat threads or shared reports. Ask the security or privacy owner to classify eval data before the first debug run, and agree on redaction rules for secrets and personal data. Match those rules against every place promptfoo writes output, including reports and JSON exports. A written decision is easier to defend in an audit than a habit the team never documented.

Separating a setup fault from a model fault

Most failed promptfoo runs fall into one of three groups, and the group tells you who should act next. The first is setup faults: a Node.js runtime older than the 22.22.0 version the current npm release requires, an environment variable that a provider reads but the shell never exported, or a provider entry in the configuration file that fails to load before any prompt is sent. These failures usually stop the run early or produce the same error on every test case. Confirm them with node --version and a check of the configuration file before anyone looks at model output. The platform or developer team that owns the environment is usually the one to fix them. The promptfoo command line documentation lists the options for narrowing a run to a few test cases, which helps isolate a setup fault quickly.

The second group is transport faults: requests that time out, provider rate limits, and upstream errors that reach the run as failed calls. In these cases the model may be working normally, and the question is whether the request received an answer at all. Run the eval again with --verbose or set LOG_LEVEL=debug, then look for the error text recorded for each failing case. Check whether the errors cluster in time or appear only when concurrency is high, because that pattern points to quotas, load or endpoint availability rather than to the prompt. Ask the team that owns the provider account or the target endpoint to confirm quota and availability for the time of the run. Keep these errors out of pass-rate conclusions until they are resolved or retried.

The third group is results the team disagrees with: an output marked as failed by an assertion or a model-graded check that the team believes should have passed. These are model or grading questions, and the owner is the person who wrote the test case and its assertion. Before blaming the grader, confirm the variables that reached the prompt, because -v on eval is the short form of --vars and does not turn on verbose logging. Then compare the stored output for that case with what the assertion checks, and decide whether the prompt, the test case or the assertion should change. Debug output narrows the group, but it does not settle whether a grader is correct. That decision stays with the team that owns the evaluation criteria.

How DeployOpen scopes and supports promptfoo debugging

DeployOpen scopes debugging work for promptfoo runs around the evidence your team already has: the command used, the verbose or debug output, and the provider and target settings involved. We agree on what gets reviewed and delivered before work starts, then document the findings so your engineers can repeat the diagnosis themselves.

How we scope

  • The written scope names the failing runs, the promptfoo version and Node.js runtime, and the log outputs to review.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before debugging starts.
  • Scope confirms where evals run, which providers are called and who can read the logs.

How we build

  • Reproduce the failure with --verbose or LOG_LEVEL=debug on a small config before touching the full suite.
  • Confirm -v on eval maps to --vars, so verbose output needs --verbose or LOG_LEVEL=debug.
  • Separate provider errors from failed assertions by reviewing log lines for each test case and its error type.

How we hand over

  • A written findings note with the command, log excerpts, root cause and the exact fix applied.
  • Handling guidance for log files, which may hold prompts, variables and model responses that need protection.
  • A short runbook so your engineers can repeat the same diagnosis on the next failed run.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after handover.
  • Upgrade-related failures are reviewed against release notes when a promptfoo version changes.
  • Retests confirm that the fix holds on the same suite before the engagement closes.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.