promptfoo/promptfoo

Test your prompts, agents, and RAGs. Red teaming/pentesting/vulnerability scanning for AI. Compare performance of GPT, Claude, Gemini, DeepSeek, and more. Simple declarative configs with command line and CI/CD integration. Used by OpenAI and Anthropic.

Promptfoo: LLM evals & red‑team­ing

What it is – Promptfoo is an open‑source command‑line tool (and Node.js library) that lets you evaluate the behaviour of large language‑model (LLM)‑driven applications and red‑team them for security‑relevant failures. It runs locally, talks to any LLM provider (OpenAI, Anthropic, Azure, Bedrock, Ollama, etc.), and produces structured results you can view in a web UI or feed into CI pipelines.

Key capabilities

  • Automated prompt testing – define test cases (inputs, expected outputs, scoring functions) and run them against one or more models.
  • Red‑team / vulnerability scanning – supply adversarial prompts that probe for jailbreaks, privacy leaks, or policy violations; Promptfoo reports the findings.
  • Model comparison – side‑by‑side matrices let you see how different providers respond to the same tests.
  • CI/CD integration – export results as JSON, use the built‑in GitHub Actions workflow, or call the library from scripts.
  • Code‑scanning for pull requests – plug into GitHub’s code‑scanning API to flag risky LLM usage before merge.
  • Local‑only execution – all prompts stay on your machine; only the API calls to the LLM provider are made.

How you use it

  1. Install globally (npm i -g promptfoo), via Homebrew, or with pip/npx.
  2. Set your provider key, e.g. export OPENAI_API_KEY=….
  3. Initialise a starter config (promptfoo init --example getting-started).
  4. Run promptfoo eval to execute the tests, then promptfoo view to open a browser‑based results dashboard.

Who it’s for – developers building chatbots, agents, or any app that relies on LLM output and needs systematic testing, security hardening, or compliance reporting.

License & community – MIT‑licensed, now part of OpenAI but still open source. Active Discord community and contribution guide.


All details are taken directly from the repository’s README.

Related

  • Project
  • Project
  • Project
  • Project
  • Project