How to Sell a Legacy Code Audit with ChatGPT
Quick answer: Get the client's written permission and remove passwords, keys and connection strings first. Paste one file or function at a time into the prompt below, which asks for a plain-language summary, security issues with severity, performance and maintainability problems, and an action plan with estimated hours. Then reproduce every finding on a copy (never the live site), delete what you cannot confirm, add what it missed, set the hours yourself, and sell a fixed-price audit of one area before quoting the fixes.
Before you paste any code
- Get the client's written OK to use an AI tool on their code.
- Remove passwords, API keys, tokens and connection strings. The masker below finds the obvious ones.
- Paste one file or function at a time, not the whole system.
- Follow the client's contract or NDA if they have one.
Free secret masker
Paste code to find likely passwords, keys and connection strings and get a copy with their values replaced by [REDACTED]. It catches common patterns only, so read the code yourself too. Runs in your browser; nothing is sent or stored.
The free ChatGPT prompt
You are a senior software auditor. Review this [LANGUAGE, e.g. PHP / ColdFusion / VB.NET] code: """ [PASTE CODE] """ Produce a client-ready audit report with: 1. Summary (3 lines, non-technical, for the business owner) 2. Security issues (SQL injection, XSS, auth, secrets) with severity: Critical / High / Medium / Low 3. Performance problems 4. Maintainability problems 5. A fixed-price action plan: each fix with estimated hours Use a table for issues. Do not invent issues; if unsure, mark as "needs verification".
The estimated hours it gives are a first guess. Set the real estimate from your own experience.
Example: a 4-line order page
Invented example.
$id = $_GET['id']; $sql = "SELECT * FROM orders WHERE id = $id"; $row = mysqli_fetch_assoc(mysqli_query($db, $sql)); echo "<h1>Order " . $_GET['id'] . "</h1>";
| Issue | Severity | Fix |
|---|---|---|
| SQL injection in the order query | Critical | Prepared statement |
| Order ID printed without escaping (XSS) | High | htmlspecialchars() |
| No check that the order belongs to the logged-in user | Needs verification | Check the login and order code |
SELECT * for one row | Low | Select only the columns used |
Check every finding yourself
- Reproduce each issue on a copy of the system, never on the live site.
- Delete anything you cannot confirm.
- Add what it missed. You can see the whole system; it only sees what you pasted.
- Set the hours yourself.
Sell it simply and honestly
- Offer a fixed-price audit of one area, such as login, checkout or payments.
- Quote the fixes separately after the audit.
- Do not promise that the code will be "100% secure".
- Never send an AI report you have not checked.
Frequently asked questions
Can ChatGPT audit code by itself?
No. It can draft a report and point at likely problems, but it can be wrong and it only sees what you paste. Reproduce every finding yourself before it goes into a report a client pays for.
Is it safe to paste client code into ChatGPT?
Only with the client's written permission and within their contract or NDA. Remove passwords, API keys and connection strings first; the masker on this page helps you find the obvious ones, but check by hand as well.
What should a legacy code audit include?
A short summary the business owner can read, security issues with a severity, performance and maintainability problems, and an action plan for the fixes. Mark anything you could not confirm as needing verification.
How do I price a code audit?
Price a fixed scope, such as one area (login, checkout or payments), from the time you expect it to take you. The hours in the AI draft are only a first guess. Quote the fixes separately after the audit.
Is what I paste into the masker saved or sent?
No. It runs in your browser and nothing is sent or stored.
Next steps
- Find clients: plan 30 days of LinkedIn posts and write Upwork proposals that get replies.
- Set your hourly rate with the Freelance Rate Calculator.
- More copy-ready prompts: 24 AI prompts to make money.