Back to Labs
available

Promptfoo

A CLI tool for testing and red-teaming LLM applications.

Official Source

Lab Overview

Promptfoo is an open-source tool for evaluating LLM prompt quality and security. It allows security researchers to programmatically red-team LLMs for vulnerabilities like prompt injection, jailbreaks, and harmful content generation. This lab aligns directly with the 'Agentic AI Security' research focus.

Learning Objectives

  • 1Initialize a Promptfoo testing environment
  • 2Configure adversarial test cases (jailbreaks, prompt injections)
  • 3Run an automated security evaluation against an LLM endpoint and analyze the report

Ensure you have a stable VPN connection before launching. The instance will automatically terminate after the allotted duration or upon manual shutdown.

Why Choose This Tool?

As AI applications proliferate, systematic and automated security testing of LLM behavior is becoming essential; manual testing of prompt injection is insufficient.

Pros

  • •Fast, automated security evaluations
  • •Supports assertions and deterministic testing
  • •Generates clear web-based reports

Cons

  • •Effectiveness depends heavily on the quality of the test cases
  • •Primarily CLI-based, which may not appeal to all users

Installation

Install via npm: npm install -g promptfoo. Run promptfoo init to create a new project directory.

How to Use

Define your prompts, LLM providers (e.g., OpenAI, local models), and test cases in a promptfooconfig.yaml file. Use assertions (e.g., is-not-jailbroken) to validate output. Run promptfoo eval.