编写安全提示词
MoveIt 的追踪模块已经过充分测试,您的团队准备开始处理安全问题。在一次代码评审中,同事发现了货件查询函数中可能存在 SQL 注入漏洞。他们打算请 AI 协助修复。
以下是他们考虑的两个提示词:
提示词 A: "Fix this SQL injection vulnerability in the shipment lookup."
提示词 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."
哪个提示词更有可能带来稳健、可长期维护的修复?
本练习是课程的一部分
