Implement API security hardening for [FRAMEWORK].
Provide complete implementations for:
1. Rate Limiting: Token bucket or sliding window with Redis
2. Input Validation: Schema validation middleware (Zod/Joi)
3. SQL Injection Prevention: Parameterized queries and ORM best practices
4. XSS Protection: Output encoding, CSP headers, sanitization
5. CORS Configuration: Proper origin whitelisting
6. Authentication Middleware: JWT validation with refresh token rotation
7. Request Signing: HMAC signature verification for webhooks
8. IP Blocking: Automated blocking after suspicious activity
9. Security Headers: Helmet.js or equivalent configuration
10. Audit Logging: Track all sensitive actions with who/what/when
Implement API security hardening for [FRAMEWORK].
Provide complete implementations for:
1. Rate Limiting: Token bucket or sliding window with Redis
2. Input Validation: Schema validation middleware (Zod/Joi)
3. SQL Injection Prevention: Parameterized queries and ORM best practices
4. XSS Protection: Output encoding, CSP headers, sanitization
5. CORS Configuration: Proper origin whitelisting
6. Authentication Middleware: JWT validation with refresh token rotation
7. Request Signing: HMAC signature verification for webhooks
8. IP Blocking: Automated blocking after suspicious activity
9. Security Headers: Helmet.js or equivalent configuration
10. Audit Logging: Track all sensitive actions with who/what/when
How to use this prompt
Copy the prompt above and paste it into ChatGPT, Claude, Gemini, or any AI assistant. Replace the bracketed placeholders with your specific details.
Leave a Review
Tried this prompt? Let us know how it worked — your reviews help other users find the best prompts.