撰寫安全的提示語
MoveIt 的追蹤模組已經過完整測試,你的團隊準備開始處理安全議題。在程式碼審查期間,同事發現出貨查詢函式可能有 SQL 注入的弱點,於是請 AI 協助修復。
以下是他們正在考慮的兩個提示語:
Prompt A:「Fix this SQL injection vulnerability in the shipment lookup.」
Prompt B:「This shipment lookup is vulnerable to SQL injection. First, identify what user inputs could be exploited. Then, fix the vulnerability using parameterized queries instead of string concatenation. Finally, generate test cases with common injection payloads to verify the fix.」
哪一個提示語更可能產生穩健、長期有效的修補?
本練習屬於課程
