// docs / ai fix prompts
AI 修复提示词
Code and configuration findings have a Copy coding-agent prompt button beneath the remediation. DNS, provider-console, secret-rotation, and manual-review findings show operator steps instead, because an IDE agent cannot change those settings for you. No Claude API call is made by FixVibe.
工作方式
点击时会组合两类数据:
- The finding — 问题摘要、受影响的表面、修复指南以及帮助您的编码代理修复问题所需的安全证据。
- Your app context - FixVibe 在可用时使用扫描上下文来选择框架感知的修复形状,并在无法推断足够的上下文时回退到通用配方。
Coding-agent prompts and operator steps are rendered server-side from FixVibe remediation guidance. They are designed for copy-paste use in Cursor, Claude Desktop, Copilot, or the relevant provider console without exposing the internal prompt registry in the browser.
提示词长什么样
Fix the "Reflected XSS in /search?q=" vulnerability at /search.
Issue: Query parameter q is rendered into the response body without
escaping; an attacker can inject <script> via crafted URLs.
Codebase context: Next.js.
Recommended fix:
In Next.js, render user-supplied values through JSX ({value}) so React's
automatic escaping kicks in. For server components rendering rich HTML,
sanitize with DOMPurify (server-side via JSDOM) before output.
Constraints:
- Don't break existing tests; run the test suite after the change.
- Match the codebase's existing style and lint config.
- Add a brief comment explaining the security reasoning only where the
fix would otherwise look arbitrary.
- If the fix needs a new dependency, install it via the project's
package manager (npm / pnpm / pip / bundle / composer).
Reference: CWE-79 — see https://cwe.mitre.org/data/definitions/79.html支持的框架
我们会为这些框架提供特定片段:
- Next.js、React、Vue、Nuxt、Svelte(前端)
- Express、Fastify(Node.js 后端)
- Django、Flask(Python)
- 红宝石 on Rails
- Laravel(PHP)
- ASP.NET 核心后备指导
框架上下文是尽力而为的。如果 FixVibe 无法从扫描中进行足够安全的推断,则提示会要求您的编码代理在应用修复之前检查存储库。
从你的 AI 智能体使用
如果你已经接入 MCP server,同一个提示词也会作为 slash command 暴露。从 Claude Desktop:
/fixvibe-fix finding_id=550e8400-e29b-41d4-a716-446655440000
服务器查找结果,应用可用的扫描上下文,呈现修复提示,并将其作为用户消息注入到您的对话中。 FixVibe 不会为此模板化提示进行第三方LLM API 调用。
为什么我们不会每次点击都调用 Claude
上线时,我们考虑过每次点击都调用 Anthropic API,用代码库上下文优化提示词。我们没有这么做,因为:
- 用户粘贴进去的智能体已经有代码库上下文:他们是在打开仓库的 Cursor / Claude Desktop 中使用。
- 服务器端模板涵盖了常见的修复路径,无需任何每次点击模型调用。
- 如果用户需要,以后可以提供“用我的代码库上下文通过 AI 优化”的可选开关来触发 API。今天没有。
