Promptfoo
CLI and CI/CD security red-teaming and prompt evaluation tool
CLI and CI/CD security red-teaming and prompt evaluation tool
In-Depth Review
Promptfoo is a command-line and CI/CD tool designed for evaluating, comparing, and securing AI prompts. It lets developers run automated tests against large language models to check accuracy, safety, and consistency before deploying prompt-based applications.
Whether you are building a chatbot, a RAG pipeline, or any LLM-powered feature, Promptfoo helps you catch regressions, vulnerabilities, and quality gaps early in the development cycle.
Promptfoo is an open-source CLI tool that runs structured evaluations against LLM outputs. You define test cases, assertions, and grading criteria in a YAML configuration file, then Promptfoo executes them against one or more model providers and produces a detailed report.
It supports side-by-side comparisons across models, prompt versions, and parameter settings, making it straightforward to identify which configuration produces the best results for a given task.
Promptfoo includes built-in assertion types for checking output format, toxicity, hallucination, and custom regex or JavaScript-based rules. You can also plug in external graders or LLM-as-a-judge workflows for more nuanced scoring.
The tool integrates with popular CI/CD platforms so evaluations run automatically on every code change. Results can be exported as HTML reports, JSON, or pushed to dashboards for ongoing monitoring.
Red-teaming capabilities let you stress-test prompts against adversarial inputs, helping teams surface security weaknesses before attackers do.
Promptfoo is built for AI engineers, ML practitioners, and security teams who ship LLM-powered features and need repeatable quality checks. It is especially useful for teams working with multiple models or prompt variants who want objective, data-driven comparisons.
Developers integrating LLMs into production pipelines benefit from the CI/CD hooks that flag regressions before they reach users.
Teams use Promptfoo to benchmark prompt versions before deploying updates, ensuring that a new system prompt does not degrade answer quality or introduce safety issues.
Security teams run red-team suites to probe for jailbreaks, prompt injections, and data leakage. Product teams compare model providers on cost, latency, and accuracy for a specific use case.
Install Promptfoo via npm, create a YAML configuration file that defines your prompts, test cases, and assertions, then run the CLI command to generate a report. The official documentation at promptfoo.dev provides templates and examples to accelerate setup.
Start with a small set of high-value test cases and expand gradually. Use the HTML report to review failures visually, and wire evaluations into your CI pipeline so every pull request is checked automatically.
Promptfoo is open-source and available under an MIT license. You can install it locally via npm at no cost. A hosted platform with additional features is also offered.
Promptfoo supports a wide range of model providers including OpenAI, Anthropic, Google, and local models through Ollama or LM Studio. You configure the provider in your YAML file and the tool handles the API calls.
Promptfoo automates repeatable checks like format validation, toxicity screening, and regression detection. It complements manual review by catching issues at scale but does not replace human judgment for subjective quality assessment.
AI model battle & evaluation platform