promptfoo
CLI for YAML-defined prompt and model evals, plus red-team scans for injection.
Bookmark
Bookmarks are kept in your free account, so you can find this page again on any device.
Sign in to bookmarkWhat it is
promptfoo is a CLI and library for testing prompts and models against test cases defined in YAML, with assertions ranging from string checks to model-graded rubrics. It also runs red-team scans for prompt injection, jailbreaks and data leaks. OpenAI agreed to acquire Promptfoo in March 2026; the README now says it is part of OpenAI and remains open source under the MIT licence.
Best for
Adding prompt and red-team tests to CI with a config file.
Skills it helps with
Learn promptfoo by doing
- Run LLM evals in CI with promptfoo
Write a promptfoo config with deterministic and model-graded assertions, run it in GitHub Actions, fail the build on regressions and keep the bill small.
- Evaluate AI agents: outcomes, trajectories and tool use
Build an agent eval harness that checks the final state, the tool-call trajectory and a judged transcript, run each task several times and read the traces.
- Write your first LLM eval
Turn real outputs into a small test set, add code-based checks in promptfoo and run them in CI to catch regressions on every change.
- LLM-as-a-judge: grading outputs you can trust
Write narrow grading criteria, check the judge's verdicts against your own labels and decide when its agreement is good enough.
- Prompt injection basics for builders
How direct and indirect prompt injection work, why agents with tools raise the stakes, and the design choices that limit the damage when no complete fix exists.
- Move an app to a new model without regressions
LLM model migration without surprises: freeze a golden set, run old and new models side by side, fix the prompts, compare cost, then roll out behind a flag.
- Evaluate RAG answers with a golden dataset
Set up RAG evaluation with a golden dataset and promptfoo: score retrieval, correctness and grounding for every question, and fail CI when answer quality drops.
- Red-team your chatbot for prompt injection
Generate attacks for its purpose, confirm each failure by hand, apply mitigations and re-run.
- RAG troubleshooting cheat sheet
Why a RAG system gives wrong answers, and what to check first: wrong document, right document but wrong answer, missing recent data, slow queries, with fixes.
Related tools
DeepEval
Open-source, pytest-style framework for evaluating LLM apps, RAG and agents.
Inspect
The UK AI Security Institute's open-source framework for LLM and agent evals.
Braintrust
Platform for tracing production LLM traffic, running evals and catching regressions.
Arize Phoenix
Source-available tracing and evaluation for LLM applications, built on OpenTelemetry.
garak
Scanner that probes LLMs for vulnerabilities such as prompt injection.
Langfuse
Tracing, prompt management and evals for LLM applications.