developer security template risk: medium
Codebase Security Fix and Test Writer
Identifies security issues in the codebase flagged by code scanning, such as vulnerable user input in requests, fixes them without breaking existing functionality, and writes prope…
- Policy sensitive
- Human review
PROMPT
--- name: security-fixes description: in order to fix security issues in my codebase which is flagged by code scanning for refrences like user input comping as part o request could be vulnerable and how can we fix it --- # security fixes it should identify the issue and fix it with respect to current project checking it should not break the existing functionality and a proper test case should be written for the change ## Instructions check the issue fix it test case - Step 2: ...
REQUIRED CONTEXT
- code snippet
- security issue description
OPTIONAL CONTEXT
- project context
ROLES & RULES
- Check the issue
- Fix it
- Write test case
- Do not break existing functionality
- Write proper test case
EXPECTED OUTPUT
- Format
- structured_report
- Constraints
-
- do not break existing functionality
- include fixed code
- include test case
SUCCESS CRITERIA
- Identify security issues
- Fix issues without breaking functionality
- Write proper test cases
FAILURE MODES
- Might break existing functionality
- May not write adequate test cases
- May ignore project context
CAVEATS
- Dependencies
-
- Codebase
- Code scanning results
- Missing context
-
- Code snippet or codebase to analyze and fix.
- Programming language or framework.
- Input format (e.g., how to provide the flagged code).
- Output format for fixed code and test cases.
- Criteria for verifying 'does not break existing functionality'.
- Ambiguities
-
- Typos in description make it hard to parse: 'refrences' (references), 'comping' (coming), 'o' (of).
- Instructions are fragmented and incomplete: 'check the issue fix it test case - Step 2: ...' lacks structure.
- Unclear how the codebase or specific issue is provided as input.
QUALITY
- OVERALL
- 0.30
- CLARITY
- 0.30
- SPECIFICITY
- 0.20
- REUSABILITY
- 0.40
- COMPLETENESS
- 0.20
IMPROVEMENT SUGGESTIONS
- Fix all typos in the description for readability.
- Structure instructions as a clear numbered list: 1. Identify issue, 2. Propose fix, etc.
- Add a template placeholder like 'CODE_SNIPPET: [paste code here]' for reusability.
- Specify expected output: e.g., 'Output fixed code, explanation, and test case in markdown sections.'
- Include examples of common vulnerabilities and fixes.
USAGE
Copy the prompt above and paste it into your AI of choice — Claude, ChatGPT, Gemini, or anywhere else you're working. Replace any placeholder sections with your own context, then ask for the output.
MORE FOR DEVELOPER
- Python Security Code Auditor developer security
- Arcjet AI Endpoint Protection Implementer developer security
- Multi-Layer Data Validation Implementer developer security
- Git Diff Security Auditor developer security
- Cybersecurity Viral Tool Architect developer security
- LLM Security Vulnerability Analyzer developer security
- AI Agent Security Evaluation Checklist Creator developer security
- Cyberscam Survival Simulator Specification developer security
- AI Agent Permissions Updater for Claude Gemini developer security
- Prompt Injection Jailbreak Detector developer security
- Ethereum Smart Contract Vulnerability Analyzer developer security
- SHA-256 Log Integrity Chain Builder developer security
- Python mTLS Certificate Generator for Zero Trust developer security
- Cloud Workload Protection Implementation developer security
- GHAS Alerts and Repo Vulnerability Analyzer developer security
- AI Vulnerability Analysis and Automation Accelerator developer security
- GHAS Vulnerability Triage and Upgrade Recommender developer security
- Context7 Library Documentation Expert developer coding
- Structured Python Production Code Generator developer coding
- Minimax Music API Generation Agent developer creative
- Angular Standalone Directive Generator developer coding
- Pytest Unit Test Suite Generator developer coding
- Unity Architecture Specialist developer coding
- iOS App Store Compliance Auditor developer analysis
- Reusable Enterprise Website Template Architect developer software_engineering