security fixes — ChatGPT prompt: what it does, how to install
Fixes security scan alerts in your codebase, preserves existing project logic, and adds test cases for every change.
Open on GitHubWhat security fixes does
This prompt directs the model to resolve security issues detected by code scanners. It focuses on cases where unsafe user input enters requests, pinpointing the flaw and updating project files.
The instructions require the assistant to protect existing system behavior. Along with the code update, the model must provide an accompanying test case to verify the change.
Without the vulnerability report or the relevant source file, the model cannot isolate the issue. You need to provide the flagged code and the scanner output alongside the prompt.
What it helps with
- fix insecure user input handling flagged by scanners
- patch security vulnerabilities without breaking existing logic
- generate test cases for newly applied security fixes
Example prompts for the agent
- Here is a code scanning alert about unsafe input in
auth/login.py. Identify the issue, fix it, and write a test case. - Review this request handler flagged by our security scan, patch the vulnerability, and generate a regression test.
How to install security fixes
How to use
Paste the text at the start of a chat or into project instructions
Manually: put the files in place
.claude/commands/prompts.csv.mdQuestions about security fixes
How do I install security fixes in ChatGPT?
It requires no package installation. Paste the prompt text into your ChatGPT prompt box along with the flagged source code and scanner findings.
What does security fixes do?
It analyzes code scanning alerts, patches security issues in the project, and writes automated tests to confirm the fix.
Why does the prompt mandate writing a test case?
The instructions require a test case to confirm the vulnerability is closed while ensuring existing functionality remains intact.
Source text
prompts.csv · CC0-1.0
--- 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: ...
© [email protected] · CC0-1.0 · f/prompts.chat