Join our Newsletter — 33% off our NHI Course
Home› Glossary› AI Security› Promptfoo
AI Security

Promptfoo

← Back to Glossary
By NHI Mgmt Group Updated November 26, 2026 Domain: AI Security

Promptfoo is an open-source tool for testing and red-teaming applications built on large language models. Teams define prompts, test cases and assertions in configuration, then run them against models to compare outputs and probe for prompt injection, data leakage and jailbreaks. Running it in CI catches regressions when prompts, models or guardrails change.

What Promptfoo Is Used For

Promptfoo is a testing and red-teaming harness for large language model applications. It is useful when teams need repeatable evaluation of prompts, models and guardrails, especially where output quality, jailbreak resistance, and regression detection matter in CI rather than in one-off manual review.

Because the tool sits in the evaluation layer, it helps teams turn LLM behaviour into something measurable, comparable and automatable. That makes it most valuable when prompt changes, model swaps, or safety-policy updates need to be checked before they reach production.

How Promptfoo Fits Into LLM Assurance

Promptfoo is best understood as an assurance tool for LLM systems, not as a model itself and not as a protection control by itself. It provides a way to encode expected behaviour, run cases at scale, and compare outcomes across models or prompt variants.

That matters because LLM behaviour can shift in subtle ways even when the application code has not changed. A good test harness helps expose whether a new model or prompt introduces weaker refusals, lower answer quality, or unexpected leakage paths that would otherwise slip past ad hoc testing.

What It Tests For

The term is closely associated with prompt injection, data leakage and jailbreak testing. These are not abstract concerns, they are the failure modes that make LLM applications risky in real deployments, especially where the model can see sensitive context or follow instructions embedded in user input.

In practice, the value is in negative testing. Teams can ask whether the system resists malicious instruction-following, whether it exposes hidden context, and whether safeguards still work after a change. The same approach is useful for checking that policy or content filters do not degrade when prompts are refactored.

Promptfoo also supports regression-style thinking: the question is not only whether a model passes once, but whether it keeps passing as the application evolves. That makes it a useful fit for build pipelines, evaluation gates and release decisions where consistency is part of the security posture.

Why Teams Adopt It

Teams adopt Promptfoo when they need a practical way to compare outputs across models and prompt sets without building a custom evaluation framework from scratch. It is especially relevant where AI application teams need a shared testing vocabulary for quality, safety and jailbreak resilience.

The larger operational benefit is discipline. Once prompt and model behaviour are represented as assertions and test cases, changes become reviewable, repeatable and easier to govern. That creates a more reliable path from experimentation to controlled deployment.

Risk and Threat Considerations

LLM applications can fail in ways that look like ordinary output drift but actually expose sensitive data, weaken safety controls, or allow hostile instructions to override intended behaviour. A red-teaming harness helps reveal those failures before they become production incidents.

Failure mechanism: Attackers or untrusted inputs can manipulate the model into revealing context, ignoring policy, or following embedded instructions that were never meant to be authoritative. Regression risk also rises when a model, prompt or guardrail changes and prior safety behaviour no longer holds.

Impact: The result can be data leakage, unsafe responses, policy bypass, or loss of confidence in the application’s controls. In systems that handle internal knowledge or user-specific context, that can translate into confidentiality exposure and higher operational risk.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP ASVS, CIS Controls v8 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP ASVSV16 — Security Logging and Error HandlingPromptfoo relies on repeatable test evidence and failure reporting for LLM evaluations.
V8 — AuthorizationPromptfoo tests whether model responses or tools bypass intended access boundaries.
Recommendation — Log evaluation failures and assertion results so regressions in model behaviour are visible before release. Verify that LLM workflows do not return or act on data outside their authorised scope.
CIS Controls v8CIS-16 — Application Software SecurityPromptfoo supports secure testing of application behaviour before deployment.
Recommendation — Embed LLM red-team tests into pre-release security validation for application changes.
NIST CSF 2.0DE.CM-01 — Network and System MonitoringPromptfoo operationalises continuous checks that detect behavioural regressions in deployed LLM apps.
PR.DS-01 — Data-at-Rest Is ProtectedPromptfoo is used to probe whether model workflows expose protected context or stored data.
Recommendation — Continuously monitor LLM evaluation results for drift, leakage and jailbreak regressions. Test whether prompts or context handling expose sensitive data that should remain protected.

Practitioner Guidance

Why practitioners should care: Promptfoo is most useful when teams treat LLM testing as an engineering control, not a one-time experiment. That means using it early enough to shape releases, and often enough to catch regressions when prompts, models or guardrails change.

What to watch for: Focus on test cases that reflect real abuse paths, not just happy-path prompts. The strongest value comes from checks that exercise leakage, jailbreak resistance and policy enforcement under realistic conditions.

Practitioner takeaway: Use the tool to make LLM behaviour reviewable and repeatable, then treat failing cases as release blockers until the underlying prompt, model configuration or guardrail issue is understood.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 26, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org