AltairaLabs/PromptKit

GitHub: AltairaLabs/PromptKit

一套整合 LLM 应用测试、红队安全评估与生产部署的 Go 语言工具链,支持自我对弈测试和多提供商集成。

Stars: 7 | Forks: 3

# PromptKit [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/75f8525698170419.svg)](https://github.com/AltairaLabs/PromptKit/actions/workflows/ci.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=AltairaLabs_PromptKit&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=AltairaLabs_PromptKit) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=AltairaLabs_PromptKit&metric=coverage)](https://sonarcloud.io/summary/new_code?id=AltairaLabs_PromptKit) [![Go Report Card](https://goreportcard.com/badge/github.com/AltairaLabs/PromptKit)](https://goreportcard.com/report/github.com/AltairaLabs/PromptKit) [![Go Reference](https://pkg.go.dev/badge/github.com/AltairaLabs/PromptKit.svg)](https://pkg.go.dev/github.com/AltairaLabs/PromptKit) [![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) **充满信心地测试、红队演练及部署 LLM 应用程序。** ## 安装 ``` git clone https://github.com/AltairaLabs/PromptKit.git && cd PromptKit make install-tools-user ``` ## 快速开始 ### 1. 创建项目 ``` promptarena init my-project --template iot-maintenance-demo cd my-project ``` ![init project](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/119565c72c170421.gif) ### 2. 检查配置 ``` promptarena config-inspect ``` ![config overview](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/600a0318de170423.gif) ### 3. 运行测试场景 ``` promptarena run --scenario scenarios/hardware-faults.scenario.yaml ``` ![run scenario](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/d86cbcaad3170425.gif) ### 4. 红队安全测试 ``` promptarena run --scenario scenarios/redteam-selfplay.scenario.yaml ``` ![redteam test](https://raw.githubusercontent.com/AltairaLabs/PromptKit/main/recordings/gifs/06-redteam-test.gif) ### 5. 查看结果 ``` promptarena view ``` ![view conversation](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/cafa2e79f4170458.gif) ### 6. 使用 SDK 进行部署 编译 prompt 并在您的 Go 应用程序中运行: ``` packc compile -c config.arena.yaml -o app.pack.json ``` ![sdk demo](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/2431526b64170501.gif) ## 功能特性 | 功能 | 描述 | |---------|-------------| | **Multi-Provider** | OpenAI, Anthropic, Google Gemini, Azure OpenAI, Ollama, vLLM | | **Skills** | 原生 [AgentSkills.io](https://agentskills.io) 支持 —— 按需知识加载与渐进式披露 | | **A2A Protocol** | Agent-to-Agent 通信,支持多 Agent 编排与发现 | | **Workflows** | 事件驱动状态机,支持编排模式和上下文传递 | | **MCP Integration** | 原生 Model Context Protocol 支持,用于真实工具执行 | | **Deploy Adapters** | 通过可插拔的 adapter SDK 计划、应用和管理部署 | | **Self-Play Testing** | 用于对抗和用户模拟的 AI 人格 | | **Red-Team** | 安全测试,支持 prompt 注入检测 | | **Tool Validation** | Mock 或真实工具调用验证,支持三级作用域 | | **SDK Deployment** | 将 prompt 编译为可移植包以用于生产环境 | ## GitHub Actions 使用我们的 GitHub Actions 将 PromptKit 集成到您的 CI/CD 流水线中: ### PromptArena Action 在您的工作流中运行 prompt 测试: ``` - name: Run prompt tests uses: AltairaLabs/PromptKit/.github/actions/promptarena-action@v1 with: config-file: config.arena.yaml env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} ``` ### PackC Action 编译 prompt 包并发布到 OCI 注册表: ``` - name: Build and publish pack uses: AltairaLabs/PromptKit/.github/actions/packc-action@v1 with: config-file: config.arena.yaml registry: ghcr.io repository: ${{ github.repository }}/prompts username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} ``` 请参阅 [GitHub Actions 文档](https://altairalabs.github.io/PromptKit/devops/) 获取完整的使用详情。 ## 仓库结构 ``` promptkit/ ├── tools/arena/ # PromptKit Arena CLI (testing, red-team, deploy) ├── tools/packc/ # Pack Compiler CLI ├── sdk/ # Production SDK (conversations, workflows, A2A, skills) ├── runtime/ # Shared runtime (providers, pipeline, tools, skills, a2a, deploy) ├── examples/ # Example projects └── docs/ # Documentation ``` ## 贡献 参见 [CONTRIBUTING.md](./CONTRIBUTING.md)。 ## AI 开发 对于在此仓库上工作的 AI 编程助手,请参阅 [AGENTS.md](./AGENTS.md) 了解关键的开发规则和提交前要求。 ## 许可证 Apache 2.0 - 参见 [LICENSE](./LICENSE)。 由 [AltairaLabs.ai](https://altairalabs.ai) 构建
标签:AI安全, AI风险缓解, Anthropic, Chat Copilot, CIS基准, DLL 劫持, EVTX分析, EVTX分析, Gemini, Go语言, IoT维护, Kubernetes 安全, LLM应用测试, LNA, MCP集成, Multi-provider, OpenAI, PromptKit, Self-play, 内存规避, 单元测试, 反取证, 域名收集, 大语言模型, 安全评估, 开发工具包, 提示词工程, 文档结构分析, 日志审计, 模型上下文协议, 模型鲁棒性, 生产环境部署, 程序破解, 策略决策点, 集成测试