# Promptfoo

Promptfoo 是一款开源命令行工具和库，用于测试大语言模型（LLM）应用，例如提示链、智能体和检索增强生成（RAG）系统，也用于对它们进行红队测试，即运行对抗性探测以发现安全与保障漏洞。它可以跨 OpenAI 的 GPT、Anthropic 的 Claude、Google 的 Gemini 和 DeepSeek 等提供商比较模型输出，其仓库横幅声明该项目现已成为 OpenAI 的一部分，同时仍以 MIT 许可证保持开源。<sup>[1](https://github.com/promptfoo/promptfoo/)</sup>

评估引擎可以在本地运行，但调用 OpenAI、Anthropic 或 Google 等远程提供商的评估会将提示发送到这些提供商的 API，从而受其数据处理条款约束；该工具支持 60 多家提供商。<sup>[1](https://github.com/promptfoo/promptfoo/)</sup>公开记录中关于该项目采用情况和企业历史的几乎其他所有内容均来自厂商自述，本文对此作了标注。

| 关键事实 | 值 | 状态 |
|---|---|---|
| 它是什么 | 用于大语言模型评估和红队测试的开源命令行工具和库 | 厂商自述<sup>[1](https://github.com/promptfoo/promptfoo/)</sup> |
| 仓库创建时间 | 2023 年 4 月 28 日，MIT 许可证 | 可在 GitHub 上独立核查<sup>[1](https://github.com/promptfoo/promptfoo/)</sup> |
| GitHub 星标/复刻（2026 年 9 月检索） | 24,451 星标，2,221 复刻 | 可独立核查<sup>[1](https://github.com/promptfoo/promptfoo/)</sup> |
| 企业状态 | “现已成为 OpenAI 的一部分”，仍开源且采用 MIT 许可证 | 厂商自述，未注明日期<sup>[1](https://github.com/promptfoo/promptfoo/)</sup> |
| 红队覆盖范围 | 50 多种漏洞类型，每次运行数百个对抗性输入 | 厂商自述<sup>[3](https://github.com/promptfoo/promptfoo/blob/6f66bc7e/site/docs/red-team/quickstart.md)</sup> |
| 定价 | 免费开源命令行工具；付费企业版和企业本地部署版 | 厂商及第三方教程<sup>[4](https://www.promptfoo.dev/docs/enterprise/)</sup><sup> • </sup><sup>[6](https://qaskills.sh/blog/promptfoo-llm-testing-guide)</sup> |
| 财富 500 强采用声明 | 156 家公司（营销网站） | 未经证实的厂商声明<sup>[5](https://promptfoo.xyz/)</sup> |

## Promptfoo 的功能

Promptfoo 有两个相关的用途。第一是评估：测试提示、智能体和检索增强生成应用，并比较它们在从 GPT 到 Claude、Gemini 和 DeepSeek 等不同模型上的表现。<sup>[1](https://github.com/promptfoo/promptfoo/)</sup>不调用远程提供商的评估在本地运行，因此提示数据留在用户机器上，这对处理敏感文本的团队很重要。<sup>[1](https://github.com/promptfoo/promptfoo/)</sup>第二个用途是红队测试，下文将更详细地描述。<sup>[1](https://github.com/promptfoo/promptfoo/)</sup>

提供商支持广泛：根据项目自己的文档，支持 60 多家提供商，包括 OpenAI、Anthropic、Google 和许多其他提供商。<sup>[1](https://github.com/promptfoo/promptfoo/)</sup>

## 起源和发布历史

GitHub 仓库创建于 2023 年 4 月 28 日，采用 MIT 许可证；截至 2026 年 9 月的检索，它有 24,451 个星标和 2,221 个复刻。<sup>[1](https://github.com/promptfoo/promptfoo/)</sup>检索到的记录没有提及创始人姓名，也没有描述公司的融资历史，因此这些问题仍然悬而未决。

2026 年 1 月，根据发布说明，该项目发布了自适应速率限制、用于本地推理的 Transformers.js 支持、电信专用红队插件、视频生成提供商，以及增强的静态模型安全扫描器，用于检查可能表明模型被植入木马的恶意 pickle 文件和统计异常。<sup>[2](https://www.promptfoo.dev/docs/releases/)</sup>同月的企业功能包括用于单点登录的身份提供商（IDP）映射。<sup>[2](https://www.promptfoo.dev/docs/releases/)</sup>

仓库横幅声明 Promptfoo 现已成为 OpenAI 的一部分，同时仍保持开源并采用 MIT 许可证。<sup>[1](https://github.com/promptfoo/promptfoo/)</sup>该横幅未注明日期，检索记录中也没有独立来源确认此次收购或确定其日期；其条款、时间以及是否进行了任何监管审查均未知。

## 红队测试如何运作

根据项目文档，红队扫描自动覆盖 50 多种漏洞类型。<sup>[3](https://github.com/promptfoo/promptfoo/blob/6f66bc7e/site/docs/red-team/quickstart.md)</sup>该工具使用专门的无审查模型生成针对目标应用量身定制的动态攻击探测，并实现了来自微软、Meta 和其他机构的对抗性机器学习研究。<sup>[3](https://github.com/promptfoo/promptfoo/blob/6f66bc7e/site/docs/red-team/quickstart.md)</sup>在实践中，一次运行会在许多潜在危害类别中生成数百个对抗性输入，并将它们保存在 `redteam.yaml` 配置文件中。<sup>[3](https://github.com/promptfoo/promptfoo/blob/6f66bc7e/site/docs/red-team/quickstart.md)</sup>

## 定价和企业产品

开源命令行工具是免费的；用户只需支付其评估所调用的任何大语言模型提供商的 API 费用。一份 2026 年的第三方教程证实了这一点：“promptfoo 是开源的，可通过命令行工具在本地免费运行”，并为希望共享仪表板和协作的团队提供可选的托管服务。<sup>[6](https://qaskills.sh/blog/promptfoo-llm-testing-guide)</sup>

厂商提供两个付费层级：企业版和企业本地部署版，后者是自托管部署，配有专用运行器，适用于客户防火墙后的安装。<sup>[4](https://www.promptfoo.dev/docs/enterprise/)</sup>据称两个付费产品都与开源版本完全兼容，因此现有的开源结果可以延续使用。<sup>[4](https://www.promptfoo.dev/docs/enterprise/)</sup>公开定价数据未出现在检索记录中。

## 用数字说话：哪些可核查，哪些不可

只有仓库统计数据可以独立核查：24,451 个星标，2,221 个复刻，创建于 2023 年 4 月 28 日，MIT 许可证。<sup>[1](https://github.com/promptfoo/promptfoo/)</sup>其他一切都是厂商声明。该项目声称其工具“为生产环境中服务 1000 万+用户的大语言模型应用提供支持”<sup>[1](https://github.com/promptfoo/promptfoo/)</sup>，一个营销网站声称“财富 500 强中有 156 家在人工智能开发生命周期中使用 Promptfoo”，以及一个“30 万+用户社区”提供实时威胁情报。<sup>[5](https://promptfoo.xyz/)</sup>

这些采用数字未经证实。读者应将财富 500 强、社区规模和最终用户数字视为未经确认的营销声明，而将 GitHub 指标视为唯一确凿的数字。

## References

The project's own repository and documentation are the primary sources for this article; vendor-reported claims are labeled as such throughout.

1. [promptfoo/promptfoo (GitHub repository)](https://github.com/promptfoo/promptfoo/)
2. [Release Notes | Promptfoo](https://www.promptfoo.dev/docs/releases/)
3. [Red team quickstart | Promptfoo documentation](https://github.com/promptfoo/promptfoo/blob/6f66bc7e/site/docs/red-team/quickstart.md)
4. [Promptfoo Enterprise - Secure LLM Application Testing](https://www.promptfoo.dev/docs/enterprise/)
5. [Build Secure AI Applications | Promptfoo (marketing site)](https://promptfoo.xyz/)
6. [PromptFoo Tutorial: LLM Prompt Testing and Evals (2026)](https://qaskills.sh/blog/promptfoo-llm-testing-guide)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026; Oct 11, 2026; Oct 21, 2026 · Last review: Sep 30, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 现代人工智能：基础模型、生成式人工智能与人工智能产业 › AI companies, people, and products › AI products and assistants › AI agents and developer tools

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/promptfoo

English original: https://www.edgepedia.org/promptfoo
