promptfoo is an evaluation and red teaming tool for LLM applications, offered in two forms: a command-line interface (CLI) and a library. Its target users are teams developing, testing, and operating LLM applications, helping them move away from trial-and-error development toward measurable, automatable quality and security validation.
Main capabilities
- Automated evaluation: Automated evaluation of prompts and models, with support for testing prompts, agents, and RAG.
- Red teaming and vulnerability scanning: Red teaming, penetration testing, and vulnerability scanning for AI applications, with the ability to generate security vulnerability reports.
- Model comparison: Supports side-by-side comparison of the performance of multiple models, including OpenAI, Anthropic, Azure, Bedrock, Ollama, and others.
- CI/CD integration: Checks can be run automatically in CI/CD pipelines, and it supports reviewing LLM-related security and compliance issues through code scanning.
- Result sharing: Supports sharing evaluation results with the team.
How to use
- Installation: Can be installed via brew install promptfoo, pip install promptfoo, or use npx promptfoo@latest to run any command directly without installation.
- Configuration: Uses simple declarative configuration.
- API keys: Most LLM providers require an API key, which must be set as an environment variable.
- Running: Evaluations can be run and results viewed; the command-line interface is also available.
Applicable scenarios
- Development teams that need to systematically test prompt quality, catch regressions, and improve prompt quality.
- Security and compliance scenarios that need security assessment, red teaming, and vulnerability scanning for LLM applications.
- Scenarios that need performance comparison and selection among multiple models.
- Engineering teams that need to automate LLM-related checks into CI/CD and code review processes.
Features and limitations
- Developer-first: Has features such as live reload and caching, and runs quickly.
- Privacy: LLM evaluation runs 100% locally, and prompts never leave the local machine.
- Flexibility: Can be used with any LLM API or programming language.
- Battle-tested: Supports production LLM applications serving over 10 million users.
- Data-driven: Makes decisions based on metrics rather than intuition.
- Open source: MIT licensed, with an active community.
- Limitations: Most LLM providers require an API key; specificDetails such as the list of supported models and code scanning guidelines should be found in the official documentation.