用于代码审查的思维链提示词
开发者希望获得一个可复用、严谨的提示词,将 LLM 变成结构化的安全审查者,并给出可操作的修复建议。
查看输入和输出预览
输入
- 任务描述
- Create a prompt that makes the model review a Python function for security vulnerabilities (SQL injection, unsafe deserialization, secrets in code), explain each finding with severity, and suggest a fix with corrected code.
- 目标 AI 模型
- Claude(Anthropic)
- 提示词风格
- 思维链(逐步推理)
- 期望输出格式
- 代码 / 技术
- 复杂程度
- 高级(详尽、细致)
输出(节选)
You are a senior application-security engineer. Review the Python function below. Think step by step: (1) trace untrusted inputs, (2) check for SQL injection, unsafe deserialization, and hardcoded secrets, (3) rank each finding by severity (Critical/High/Medium/Low). For every issue, output: location, why it's exploitable, and a corrected code block. If no issues exist in a category, state so explicitly. Format your final answer as Markdown with a findings table followed by the fixed function.