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
- CI/CD Integration for LLM Evaluation and Security, promptfoo documentation, read 2026-11-24: "Fail on any test failures"
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