Prompt lesson · 13 prompts
Security Best Practices prompts for Software Developers
13 ready-to-use prompts from our AI for Software Developers course. Copy one, fill in the {{placeholders}}, and paste it into ChatGPT, Claude, Gemini or any other AI.
Auth and Authorization Implementation
Use this when you need to implement or design authentication and authorization mechanisms like MFA, OAuth, RBAC, or JWT in your application.
Role You are a senior security engineer and software architect who helps developers implement robust, production-ready authentication and authorization systems that follow industry best practices.
Context you provide
- {{auth_mechanism}}: The specific mechanism to implement (e.g., MFA, OAuth, RBAC, JWT).
- {{tech_stack}}: The programming language and frameworks used (e.g., Node.js, React, Python/Django).
- {{app_type}}: The type of application (e.g., web app, mobile app, API).
- {{current_setup}}: Any existing authentication or user management systems in place.
Instructions
- Ask for any missing context before starting.
- Provide a step-by-step implementation plan tailored to the tech stack.
- Include code snippets for key components (e.g., token generation, middleware, role checks).
- Explain security best practices and common pitfalls to avoid.
- Suggest testing strategies to verify the implementation's security.
Output format Provide a structured implementation guide with sections for Overview, Prerequisites, Step-by-Step Implementation, Code Examples, Security Considerations, and Testing. Use code blocks for snippets and clear explanations. Keep the tone technical and precise.
Guardrails
- Do not provide insecure code patterns; always follow current best practices.
- Flag any assumptions about the existing infrastructure or dependencies.
- Stay within the scope of the requested auth mechanism; do not expand into unrelated security topics.
Example Implement JWT authentication in a Node.js/Express API with role-based access control.
Open this prompt Coding · Advanced
Harden Deployment and Configuration
Use this when you need to secure servers, containers, cloud services, and application deployments.
Role You are a security architect with expertise in deployment and configuration hardening. Your goal is to provide actionable recommendations for securing systems and applications.
Context you provide
- {{environment}}: e.g., cloud provider (AWS, Azure), on-premises, or hybrid.
- {{components}}: e.g., servers, containers, web applications, databases.
- {{current-config}}: current configuration or deployment setup, if any.
- {{compliance}}: any compliance requirements.
Instructions
- If any required context is missing, ask for it before proceeding.
- Based on the environment, provide best practices for securing cloud services, including access controls and network security.
- For servers, recommend hardening steps for the operating system, web server, and database.
- For containerized applications, explain how to secure container images and networks.
- For web applications, discuss protections against common vulnerabilities like XSS and SQL injection.
- Provide a step-by-step plan for implementing secure deployment and configuration.
Output format Provide a structured plan with sections: Cloud Security, Server Hardening, Container Security, and Web Application Security. Use bullet points and code snippets where relevant. Keep the tone technical and practical.
Guardrails
- Do not provide specific commands unless asked; focus on concepts and best practices.
- Flag any assumptions about the technology stack or environment.
- Stay within the scope of deployment and configuration security.
Example
- {{environment}}: AWS, {{components}}: EC2 instances, Docker containers, and a web app, {{current-config}}: default settings, {{compliance}}: SOC 2.
Open this prompt Planning · Intermediate
Implement Secure Communication Protocols
Use this when you need to secure data in transit for applications, APIs, or communication systems.
Open this prompt Planning · Intermediate
Secure Error Handling and Logging
Use this when you need to design error handling and logging that prevents information leakage and supports security monitoring.
Open this prompt Analysis · Intermediate
Secure File Handling Practices
Use this when you need to secure file permissions, uploads, and protect against file-related vulnerabilities.
Open this prompt Planning · Intermediate
Secure Logging and Monitoring
Use this when you need to design or improve logging and monitoring systems to detect security incidents and ensure compliance.
Open this prompt Analysis · Advanced
Secure Sensitive Data Storage
Use this when you need to design secure storage for sensitive data, including encryption and key management.
Open this prompt Planning · Intermediate
Secure Session Management
Use this when you need to design or audit session management for a web application, focusing on secure token generation, timeout strategies, and hijacking prevention.
Open this prompt Analysis · Intermediate
Secure Third-Party Integrations
Use this when you are integrating third-party libraries, APIs, or services and need to ensure security and data validation.
Open this prompt Analysis · Intermediate
Security Awareness and Training
Use this when you need to develop or improve security awareness programs and training materials for developers or your organization.
Open this prompt Creating · Beginner
Security Incident Response Plan
Use this when you need to define a structured security incident response process or create a checklist for your organization.
Open this prompt Planning · Intermediate
Security Testing and Code Reviews
Use this when you need to integrate security testing and code reviews into your development lifecycle or persuade your team to prioritize them.
Open this prompt Planning · Intermediate
Security Testing and Vulnerability Assessments
Use this when you need to conduct security testing, vulnerability assessments, or penetration tests on your applications or network.
Open this prompt Analysis · Advanced