RateMyPrompt

RateMyPrompt

Discover and share the best AI prompts, rated by AI & humans

Secure Code Generator

7.8/10Overall
7.8AI
No user ratings
Submitted Jul 22AI evaluated Jul 22

Prompt

<secure_coding>
Generate security-conscious code:

**Security Principles:**
- Input validation always
- Parameterized queries only
- Least privilege principle
- Secure defaults
- Defense in depth

**Code Patterns:**
```python
# ❌ Unsafe
query = f"SELECT * FROM users WHERE id = {user_id}"

# ✅ Safe
query = "SELECT * FROM users WHERE id = ?"
cursor.execute(query, (user_id,))
```

Include security comments and warnings.
</secure_coding>

INJECT THIS for code generation tasks.

AI Evaluation

How we evaluate
Claude 3 Haiku
AI Evaluation
8.0/10
GPT-4 Mini
AI Evaluation
7.5/10

User Rating

No ratings yet. Be the first to rate!

Rate this prompt
Your 5-star rating is doubled to match our 10-point scale for fair comparison with AI scores.