Coding and automationAdvancedFree

Get a code review

Reviews code for bugs, security problems and readability, most serious first.

The prompt

Review this [language] code as a careful senior developer would. What it does, and where it runs: [a short description]. What matters most here: [such as security, speed or readability]. List the problems in order of seriousness, each with where it is, why it’s a problem and a suggested fix as a short code snippet. Look especially for bugs, security problems (such as injection or exposed secrets), missing error handling and unclear names. Tell me what’s good, too, and keep the tone constructive. If you’re unsure whether something is a bug, say so and explain what would confirm it. The code: [paste the code, with any secrets and private data removed]

Tips for a better answer

  • AI reviews miss things: treat this as a second pair of eyes, not a sign-off.
  • Ask it to write a test that shows each bug before you fix it.

An example, filled in

Review this JavaScript code as a careful senior developer would. What it does, and where it runs: a form on our website that saves sign-ups to a database. What matters most here: security. List the problems in order of seriousness, each with where it is, why it’s a problem and a suggested fix as a short code snippet. Look especially for bugs, security problems (such as injection or exposed secrets), missing error handling and unclear names. Tell me what’s good, too, and keep the tone constructive. If you’re unsure whether something is a bug, say so and explain what would confirm it. The code: app.post('/signup', async (req, res) => { const email = req.body.email; await db.query("INSERT INTO signups (email) VALUES ('" + email + "')"); res.send('Thanks!'); });

Before you paste it in. Leave out names, contact details, passwords and anything confidential. At work, use the AI tools your employer has approved, and check what comes back before you rely on it. Using AI at work safely

Spotted a problem with this prompt? Tell us and an editor will check it.

More prompts for coding and automation

All the prompts for coding and automation, on one page

Get AI explained at your level, every weekday

The five stories that matter, in plain English, with a prompt of the day. Free.