Промпт «цепочка рассуждений» для код-ревью
Разработчики, желающие переиспользуемый, строгий промпт, превращающий 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.