code review के लिए chain-of-thought prompt
डेवलपर जो एक पुनः-उपयोग योग्य, कठोर prompt चाहते हैं जो किसी LLM को कार्रवाई-योग्य सुधारों वाले संरचित security reviewer में बदल दे।
इनपुट और आउटपुट का पूर्वावलोकन देखें
इनपुट
- कार्य विवरण
- 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.