Blog

AI Writes the Code. Who Owns the System?

AI made generating code cheap. Deciding whether it belongs, drawing real boundaries and proving it works is still an engineering job — and someone owns it.

By Pouya GhourchianiGhourchiani

engineeringdeveloper-tooling

Direct answer

AI coding tools changed what is expensive. Writing an endpoint, a query, a Docker config or a test suite is now fast and cheap. What did not get cheaper: deciding whether that code should exist, where its logic should live, what happens when a dependency fails, and how anyone will know it actually works. Those questions have an owner, and it is still a person.

Generating code stopped being the bottleneck

I use AI coding tools heavily. They generate API endpoints, database queries, components, Docker configs, tests — sometimes whole features — faster than I can type the prompt twice.

That is real, and it is useful. But it moved the hard part somewhere else. The questions I now spend my time on are the ones the generated code never asks:

  • Should this service exist at all?
  • Where should this logic live?
  • What happens when Redis goes down?
  • What happens under concurrent requests?
  • Is this secure?
  • Can someone debug it at 3 AM?
  • Will the next developer understand it?

None of these are answered by more code. They are answered by understanding the system the code is going into — architecture, infrastructure, failure modes, security. That is the part of engineering I have been moving toward, and it is why I build things like Aurum RS and NebulaGrid: to understand what happens underneath the API, not just to produce one.

Cheap code makes cheap abstractions

One failure mode gets worse when code is free: abstracting too early.

I have worked in codebases where almost every dependency had an interface. Repository interfaces, service interfaces, factory interfaces, adapters around adapters. Everything looked clean — until you had to change something, and a small change meant tracing one behavior through five layers to find where the actual decision was made.

An assistant will happily generate that structure for you, because it looks like good architecture. The problem was never the abstractions themselves. It was creating boundaries before there was a real reason for them.

The rule I follow now:

  • If two components do not need to evolve independently, I do not separate them by default.
  • If a module does not need a stable boundary, I do not create one because it looks cleaner.
  • If an abstraction is harder to understand than the dependency it hides, I question it.

A few strong boundaries beat dozens of artificial ones — and generated code makes the artificial ones cost nothing to add and a lot to remove. (One example of a boundary that is worth having: Axum gateway auth boundaries.)

“Done” needs evidence, not a confident message

The second thing AI tools are very good at is sounding finished.

When I built opencode-browser-agent — a plugin that lets a coding agent work in the browser you are already logged into — the design rule that mattered most was not a feature. It was this: clicking a button is not proof that a task succeeded. Completion has to be verified with network evidence and read-back, not assumed from the fact that an action ran.

Wireglass applies the same idea to networking: a protocol that is advertised (an Alt-Svc header) is never reported as working until a real QUIC handshake completes, and a UDP timeout is reported as a timeout, not as proof that UDP is blocked.

That is the standard I want from AI-written changes too. “The tests pass” is evidence. “The endpoint returned 200 with the expected body” is evidence. “The agent said it is done” is not.

Faster is not the same as wiser

The same pattern shows up at company scale. AI can write reports, analyze data, handle customer requests and automate whole workflows, and yes, it reduces costs. But doing the work is not the same as understanding the work:

  • Who takes responsibility when an automated decision goes wrong?
  • Who notices when a customer’s problem does not fit the usual pattern?
  • Who challenges a bad decision instead of following the data?
  • Who knows the context that never made it into the system?

There is a version of this for code, too. Shipping something you do not understand feels safe because the risk does not point at you — it points at whoever trusted you: the user, the business, the next team that builds on it. The speed is real; the risk just moves downstream to someone who cannot read the code.

AI can make a team faster. It does not automatically make it wiser. The opportunity is letting it handle repetitive work while people keep judgment, context and responsibility.

What I check before keeping AI-written code

  1. Does it belong? Would I have written this service, module or dependency myself? If not, why does it exist now?
  2. Where does the decision live? I can point to the one place a behavior is decided — not five layers that forward it.
  3. What fails, and how loudly? Timeouts, a dead cache, a missing secret, concurrent writes: each has a visible, honest error instead of a silent fallback.
  4. Is it proven? A test, a request with a checked response, or a read-back — not a summary of what was supposedly done.
  5. Can the next person own it? If I cannot explain it at 3 AM, it is not finished.

AI writes a lot of my code now. The system is still mine.