การพัฒนาซอฟต์แวร์ด้วย GitHub Copilot
Thalia Barrera
AI Engineering Curriculum Manager, DataCamp

def get_user(username):
query = f"SELECT * FROM users \
WHERE username = '{username}'"
return db.execute(query)
ผู้โจมตีสามารถแทรก SQL ได้:
users[screencast]
[screencast]
ตรวจสอบแบบเจาะจง
Review
#selectionfor SQL injection and XSS vulnerabilities
สแกนทั้ง Codebase
@workspacescan for hardcoded credentials or API keys
[screencast]

การสร้างโค้ดเชิงป้องกัน
Add input validation to this endpoint. Reject unexpected types and enforce length limits.
ไม่ใช่แค่ค้นหาช่องโหว่ — แต่ป้องกันด้วย
.github/copilot-instructions.md
## Security standards
- Use parameterized queries
- Never hardcode credentials or API keys
- Validate and sanitize all user input
- Use bcrypt or argon2 for password hashing
.github/instructions/security.instructions.md
applyTo: "**/*.py"
- Use secrets module instead of random for tokens
- Escape all user input in Jinja2 templates
✅ ความปลอดภัยกลายเป็นส่วนหนึ่งของวิธีเขียนโค้ด
การพัฒนาซอฟต์แวร์ด้วย GitHub Copilot