Skip to content
HomeCase studiesThoughtsOpen source
Thoughts

When do I actually accept AI-generated code?

30 Nov 2026

I use AI quite a lot when writing code, but I've become more selective about what I accept from it.

The more I use it, the more I realize that getting code to work is probably the easiest part.

Before any code is written

I like to start by discussing the problem, the architecture and the implementation plan with AI.

Sometimes I already have a solution in mind and use AI to challenge it. Sometimes it points out something I haven't considered.

I also like to establish clear acceptance criteria before the implementation starts. Otherwise, we might end up with working code that solves the wrong problem.

Code that feels at home

I'm happy to let AI handle repetitive code, especially when there are already established patterns in the codebase.

What I care about is whether the result feels like it belongs there.

An existing architectural decision shouldn't be ignored just because AI found another way of doing things.

I don't want a simple fix to become a refactoring project, an unnecessary abstraction or a collection of backward compatibility layers for things we don't even need to support.

And just because we can generate a lot of code quickly doesn't mean we should open massive pull requests. I still prefer small, progressive changes that my teammates can comfortably review.

Predictability matters a lot to me.

It depends on what I'm building

I'm much more relaxed when working on a personal project or experimenting with an idea.

For a simple UI, I might be comfortable accepting the implementation after reviewing it in the browser. For something that handles merchants' money, it's a completely different conversation.

I've also found value in giving AI framework-specific guidance. Tools like Laravel Boost help AI work with the conventions and ecosystem we're already using instead of reinventing things.

But guidance isn't a substitute for judgment.

Working isn't enough

I don't like accepting workarounds just because they make a test pass.

I want tests that cover actual behavior, including what happens when things go wrong. Not duplicated tests or tests that mock away the very thing we're trying to verify.

For frontend changes, I prefer testing the actual experience in a browser. There's a difference between a component that compiles and one that actually works for the person using it.

I also like having another AI agent independently review the implementation, but that doesn't replace human code review.

Would I approve the same code from a teammate?

I've come to realize that this is probably the simplest question I can ask myself.

If I'd ask a teammate to simplify an abstraction, split a pull request or reconsider an implementation, why would I accept those same things from AI?

I want AI to help me write better software, not make me more comfortable accepting worse software :)

Another thoughtMCP made tutorials obsolete
WhatsApp LinkedIn GitHub