Promptfoo
promptfoo/promptfoo β a CLI and library for evaluating and red-teaming LLM apps. Two jobs: (1) evals β declarative configs that run your prompts/agents/RAGs across models and assert on the outputs, with side-by-side comparison of GPT / Claude / Gemini / DeepSeek etc.; (2) red teaming / pentesting β automated vulnerability and jailbreak scanning for AI systems. Built for the command line and CI/CD, so quality and safety checks become part of the pipeline rather than manual vibe-testing. Used by OpenAI and Anthropic; MIT-licensed; as of 2026 the company is part of OpenAI (project stays open source).
In the LLM App Engineering Stack this is the eval + security lane, the pre-ship / CI counterpart to Langfuseβs runtime observability: Promptfoo catches regressions and vulnerabilities before deploy; Langfuse watches production after.
π Links
Description
- Repo: https://github.com/promptfoo/promptfoo
- Site: https://www.promptfoo.dev Β· Docs: https://www.promptfoo.dev/docs
- Red teaming: https://www.promptfoo.dev/docs/red-team/
- License: MIT (Node.js
^20.20.0or>=22.x; Node 20 support ends 2026-07-30 β move to Node 24 LTS)
Download or use
npm install -g promptfoo
# or: brew install promptfoo | pip install promptfoo | npx promptfoo@latest
promptfoo init --example getting-started
promptfoo eval # run the eval matrix
promptfoo view # web UI for resultspromptfoo redteam init && promptfoo redteam run # vulnerability scanποΈ Description
π§© Evals
- Declarative configs β YAML defines prompts, providers, test cases, and assertions (exact-match, LLM-as-judge, similarity, custom JS).
- Matrix comparison β one run scores N prompts Γ M models; results as a diffable table / web view.
- CI/CD-native β exit codes + machine-readable output gate merges on eval regressions.
π§© Red teaming
- Automated attacks β jailbreaks, prompt injection, PII leakage, harmful-content probes, and OWASP-LLM-style checks.
- Scoped to your app β generates adversarial inputs against your actual prompts/agents, not a generic benchmark.
βοΈ Reasoning for
- Regression safety β prompt changes silently break behaviour; a Promptfoo eval suite in CI turns βseems fineβ into a pass/fail gate (pairs with Claude Code-driven dev loops).
- Security posture β the red-team module is the cheapest way to probe an agent for injection/leakage before it faces real users.
- Model selection β objective side-by-side scoring beats anecdote when choosing between providers for a task.
Weak points: eval quality depends on the assertions you write (LLM-as-judge has its own noise); red-team coverage is broad but not a substitute for a real security review; config sprawl on large suites.
Alternatives considered
- Langfuse evals β runtime, trace-attached eval + datasets; Promptfoo is CLI/CI-first and pre-deploy.
- DeepEval / Ragas β Python-native eval frameworks (Ragas is RAG-specific); Promptfoo is language-agnostic + red-teaming.
- OpenAI Evals β provider-tied; Promptfoo is cross-provider.
- Garak β dedicated LLM vulnerability scanner; narrower than Promptfooβs eval+redteam combo.
π Resources
- Docs: https://www.promptfoo.dev/docs
- Getting started: https://www.promptfoo.dev/docs/getting-started/
- OpenAI acquisition note: https://www.promptfoo.dev/blog/promptfoo-joining-openai/
Template: tool