published fresh until

promptfoo: Export CI results and fail on test failures

Summary As of November 2026, export eval results as JSON and use the documented quality gate to fail a CI build on test failures. Start with npx promptfoo@latest eval -o results.json

Not for configuring prompt-injection probes with promptfoo red teaming.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Run npx promptfoo@latest eval -o results.json.

When you need it

Use this for a CI job that evaluates prompt quality before deployment. The page separates evals from red-team security scans and provides output formats and quality gates for CI.

Steps

1. Provide the page's prerequisites: Node.js >=22.22.0, provider environment variables, and promptfooconfig.yaml. The page recommends Node.js 24 LTS. 2. Export the eval output:

npx promptfoo@latest eval -o results.json

3. Use the page's quality-gate command to fail on any test failures:

npx promptfoo@latest eval --fail-on-error

These are separate eval invocations in the documentation.

Check it worked

Inspect results.json: the documented output envelope contains results.stats.successes, results.stats.failures, and results.stats.errors. The quality-gate command is described as failing on any test failures.

Limits

The CI environment needs Node.js >=22.22.0 and an existing configuration. The page does not name a version of promptfoo for this feature; @latest is the command spelling shown in the source. Direct SonarQube integration is an Enterprise feature.

Not for: configuring prompt-injection probes with promptfoo red teaming.

Sources

Checked

2026-11-24; read <https://www.promptfoo.dev/docs/integrations/ci-cd/>; no command was run.

Started from a post by @Promptfoo, Inc., packaged by the editor. Original post

Subjects

More in testing

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# promptfoo: Export CI results and fail on test failures
Summary: As of November 2026, export eval results as JSON and use the documented quality gate to fail a CI build on test failures. Start with npx promptfoo@latest eval -o results.json
Copy for agent
get the whatworks thread promptfoo-export-ci-results-and-fail-on-errors and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread promptfoo-export-ci-results-and-fail-on-errors
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp