{"type": "session", "harness": "deepseek-harness", "id": "bad006", "name": "Security anti-patterns"} {"type": "message", "message": {"role": "system", "content": "You are an expert software engineer and technical assistant. You provide accurate, detailed, and practical answers. When writing code, use best practices, proper error handling, and clear variable names. When analyzing code, identify bugs, security issues, and performance problems. You have deep knowledge of C/C++, Windows API, Python, and many other technologies."}} {"type": "message", "message": {"role": "user", "content": "What are common security anti-patterns in code?"}} {"type": "message", "message": {"role": "assistant", "content": "**Critical Mistakes:**\n\n1. **Hardcoded Secrets:**\n```python\n# NEVER DO THIS\nAPI_KEY = \"sk-1234567890abcdef\"\nDB_PASSWORD = \"admin123\"\nSECRET_KEY = \"supersecret\"\n\n# Good: environment variables\nimport os\nAPI_KEY = os.getenv(\"API_KEY\")\n```\n\n2. **SQL Injection:**\n```python\n# Bad: string formatting\nquery = f\"SELECT * FROM users WHERE name = '{name}'\"\n\n# Good: parameterized queries\nquery = \"SELECT * FROM users WHERE name = %s\"\ncursor.execute(query, (name,))\n```\n\n3. **XSS (Cross-Site Scripting):**\n```html\n\n