Safeguard
Security Guides•

When should you reject an AI fix and write the change by hand?

Seven signals that an AI suggested fix should be rejected and written by a person: security critical code, unclear root cause, large rewrites and more.

Safeguard Security Team
3 min read

Reject an AI fix and write the change by hand when the code is security critical, the root cause is unclear, the diff is a large rewrite, tests cannot demonstrate the fix, or the suggestion keeps failing review. Use the tool for drafts, not for decisions on high risk code.

The seven signals

  1. Security critical code. Authentication, authorization, input validation and cryptographic operations. OWASP's guidance on secure coding with AI recommends writing security critical tests manually for these areas, and the same caution applies to the code they protect.
  2. The root cause is not understood. If neither you nor the assistant can explain why the flaw exists, a plausible patch may be a guess.
  3. The diff is a rewrite. A fix that restructures many files costs more to review than it saves, and large changes hide small problems.
  4. No honest test is possible. If you cannot write a test that fails before and passes after, you cannot show the fix works. Do the harder thinking yourself.
  5. The suggestion touches things it should not. Pipeline files, build scripts, tests or tool configuration. Ask for a split, and if it persists, write it by hand.
  6. Facts do not check out. A version that does not exist, a package you cannot find, or an advisory that says something different. One wrong fact is a reason to distrust the rest.
  7. Two rounds of rework did not converge. Each round of corrections costs reviewer time. Set a limit.

A quick decision table

SituationSuggested path
Dependency patch bump, tests solidAccept after normal checks
Small, well scoped code fix with a clear testAccept after review
Fix to authentication or crypto codeDraft with a tool if you like, but a person writes and owns the final change
Fix needing design decisionsHuman design first, tool for boilerplate after
Repeated failed roundsClose the suggestion and write it by hand

Treat this as a starting point to adjust with your own incident history.

Writing it by hand is not a defeat

Rejecting a suggestion is part of the process working. The aim is correct fixes, not a high acceptance rate. Do keep the useful parts: the explanation of the weakness, the reproduction, the list of places to check.

Time box the experiment

A simple rule: if a reviewer has spent twenty minutes without confidence, stop and hand it to the code owner. The number is only a prompt for you to set your own limit, not a researched figure.

Record the outcome

Add the rejection to your decision log with a reason. Over time, you will learn which categories of fix the tool handles well in your codebase and which it does not. See keeping a decision log for AI fix suggestions.

If you use Safeguard's fix pull requests, remember they are off by default, with every category on Manual, so you decide which categories ever get proposals. Closing a pull request you do not trust is a normal outcome.

Quick check

Does rejecting AI fixes defeat the point of using them?

No. The value is faster drafts for the changes where they are reliable. Rejections on the rest keep quality high.

Who decides to switch to a hand written fix?

The code owner, with security input for sensitive areas.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.