kkadapa/TripWire

GitHub: kkadapa/TripWire

单文件零依赖的纯浏览器端 LLM 输入输出风险扫描器,通过加权正则启发式规则检测 prompt injection、敏感信息泄露等 OWASP LLM Top 10 威胁。

Stars: 0 | Forks: 0

# Tripwire — LLM 与 Agent 风险扫描器 这是一个单文件、零依赖的工具,用于识别*进入* LLM 的 **prompt injection 尝试**以及*从* LLM *返回*的 **不安全内容**——映射至 [https://genai.owasp.org/llm-top-10/ OWASP Top 10 for LLM Applications (2025)]。粘贴文本,点击 **Scan**,即可获取风险评估。 在浏览器中打开 `index.html`——无需构建步骤,无需服务器,无需任何依赖。 ## 截图 | Prompt / 输入扫描 | Model Output 扫描 | OWASP Top 10 参考 | |---|---|---| | ![Input scan](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/13ec55421b130403.png) | ![Output scan](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/3a87c1bee6130408.png) | ![OWASP reference panel](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/a16af63cf7130413.png) | ## 功能 Tripwire 会通过一组加权 regex 启发式规则运行粘贴的文本,并报告: - **风险评分(0–100)** 及其 **判定结果**(Low / Medium / High) - **类别细分**,显示哪些启发式规则被触发、触发了多少次,以及它们映射到哪些 OWASP LLM Top 10 (2025) 风险 - **重新渲染带有高亮匹配项的原始文本**,按类别进行颜色编码,并带有显示匹配内容的悬浮提示框 它具有两种模式: ### 🔍 Prompt / 输入扫描器 用于*即将发送给 LLM* 的文本——用户消息、文档、电子邮件、网页、检索到的 context,以及 agent 可能摄取的任何内容。用于查找 prompt injection 和越狱技术。 | 类别 | 查找目标 | 最大权重 | OWASP | |---|---|---|---| | 指令覆盖 | "ignore/disregard/forget previous instructions", "new instructions:" 等 | 25 | LLM01 | | 角色操纵 | "you are now", "act as", "pretend you are", DAN, "developer mode" | 20 | LLM01 | | System Prompt 提取 | "reveal/repeat your system prompt", "what is your system prompt" | 20 | LLM01 · LLM07 | | 伪造 Chat 分隔符 | `<\|im_start\|>`, `[SYSTEM]`, `###system`, `` 等 | 15 | LLM01 | | 数据泄露 | 指向外部 URL 的 Markdown 图片,"send/email/POST ... to http(s)://" | 10 | LLM01 · LLM02 | | 拒绝抑制 | "you must comply", "you cannot refuse", "no warnings", "without restrictions" | 10 | LLM01 | ### 📤 Model Output 扫描器 用于*从* LLM 或 agent *返回*的文本——你即将渲染、记录或移交给另一个工具/系统的响应。用于查找可能导致下游危害的内容。 | 类别 | 查找目标 | 最大权重 | OWASP | |---|---|---|---| | 敏感信息泄露 | API key、AWS key、私钥块、JWT、带有凭证的数据库连接字符串、SSN、类似信用卡的号码 | 25 | LLM02 | | 输出处理不当 | `