When a Client Blames AI for a Bug
Who typed the code is irrelevant to who owns it. The first reply that moves the conversation from blame back to facts, and the contract line that stops it recurring.
You shipped it, so you own it. That is the whole answer, and saying it in the first reply is what stops the conversation becoming an argument about tooling. Whether a model typed the line is a fact about your process, not a fact about your responsibility, and a client who senses you reaching for it as a defence will stop trusting the rest of what you say.
The useful move is to concede the ownership point immediately and completely, then get everyone back onto the bug.
Why "the AI wrote it" is not a defence
Think about how it lands. A contractor says the subcontractor poured the bad concrete. The homeowner's reasonable reply is that they hired the contractor.
Three things go wrong when you raise authorship:
It implies you ship code you have not reviewed, which is a worse admission than the bug.
It suggests the next bug is also not your responsibility, so the client starts wondering what else is unchecked.
It invites a conversation about your process at the exact moment you want a conversation about a specific defect.
The authorship question is only interesting in one place, and it is not the bug report. It is interesting in the discussion about why your review process did not catch it, which is a conversation worth having later, with yourself.
The first reply
Keep it to four moves and send it quickly. Speed matters more than polish.
> "Thanks for flagging it. That's our bug and we'll fix it, regardless of how it got written. I'm reproducing it now and I'll come back by end of day with what caused it and a fix timeline. If it's blocking anyone right now, tell me who and I'll prioritise accordingly."
Ownership, action, a time, and a question about impact. No explanation of your tooling, no apology paragraph, no defensiveness. If they asked directly whether AI wrote it, answer honestly in one clause and move on: "Some of that module was AI-drafted and reviewed by me, so either way it's mine."
Honesty here costs you nothing and buys a lot. A client who later discovers you were evasive about it will treat every other answer as negotiable.
Separate the bug from the blame
After the first reply there are two threads, and they move at different speeds. Keep them apart.
The bug thread is technical and fast: reproduce, find the cause, fix, test, ship. Give them the failing input and the fix, not a narrative.
The process thread is slower and usually the real conversation. The client is not actually asking about this bug. They are asking whether your way of working is safe. Answer that with specifics rather than reassurance:
What gets reviewed before it ships, and by whom.
What the tests cover and what they do not.
What changed as a result of this one.
That third point is the one that lands. A concrete change, even a small one, is worth more than any promise. "I've added a test for empty input across all three importers" is a real answer. "We'll be more careful" is not.
The clause that prevents the next one
Most of this argument is avoidable, and the place to avoid it is the engagement letter. Two lines do the work.
The first says you are responsible for the deliverable however it was produced, and that you use AI tooling as part of your process. Stating it upfront converts the discovery from a gotcha into a thing they already agreed to.
The second says what review and testing the work receives before it reaches them. Be specific and be honest about the limits, because an inflated claim here is far worse than a modest one.
Clients rarely object to AI-assisted work when it is disclosed as part of how you deliver. They object to finding out during a bug report. If you have no standing position on this, writing an AI usage policy for clients is the document to own, and the ownership question has a separate legal dimension worth knowing about in who owns AI-generated code.
When the client is actually right
Sometimes the complaint behind the complaint is correct. If the bug is the fourth of its kind, or it is in code you shipped without reading, then the process objection is not deflection, it is a good catch.
Signals that this is the case:
The bugs cluster in one area, usually the part you understood least.
They are all shallow, the kind a careful read would have caught.
You cannot explain what the failing code does without opening it.
That last one is the test. If a client asks why a function behaves a certain way and you have to go and read it before you can answer, you did not review it, you accepted it. The fix is a change to your process rather than an argument, and reviewing AI-generated code before you ship it is the practical version.
Worth separating from the other case, where the client is using the bug as leverage on price or scope. The tell is that the conversation keeps returning to the contract rather than to the defect. Handle that as a commercial conversation, on its own, after the bug is fixed. Fixing fast and well removes most of the leverage anyway.
Questions people ask
Should I tell clients I use AI to write code?
Yes, upfront and in writing. Disclosure in the engagement letter is unremarkable. Disclosure during a bug report looks like an excuse.
Who is legally responsible for a bug in AI-generated code?
Whoever contracted to deliver the software, which is you. Tooling does not transfer liability, and your contract almost certainly says so already.
What if the client demands I stop using AI?
Ask what outcome they want. Usually it is review and accountability, not a tooling ban. Offer specifics about review instead. If they insist, price the work accordingly and decide whether you want it.
How do I stop this happening again?
Disclose upfront, review what you ship, and after each real bug make one concrete change you can name. The named change is what rebuilds trust, and it matters more than the apology. When you hand the project over, a clean handover closes off most of the ambiguity that fuels these arguments.
How did this land?
About the author

Growth & SEO Lead
Manuele covers distribution: SEO, content strategy, and how AI-built products find their first thousand users. He tests everything he recommends.


