bandarra.me

AI-Generated Code: Ownership and Developer Responsibility

A few weeks ago I was discussing recommendations for organizations adopting AI developer tooling with a friend and, one of the points we agreed with, is that developers should treat code generated by AI as their own, and thoroughly review it themselves before submitting for review by their wider team.

Later in that week, I learned about the Your Brain on ChatGPT: Accumulation of Cognitive Debt when Using an AI Assistant for Essay Writing Task study, which triggered loads of discussions online. One of the takeaways from the study was the potential impact on the feeling of ownership of the work produced:

This trade-off highlights an important educational concern: AI tools, while valuable for supporting performance, may unintentionally hinder deep cognitive processing, retention, and authentic engagement with written material. If users rely heavily on AI tools, they may achieve superficial fluency but fail to internalize the knowledge or feel a sense of ownership over it.

This made me question the idea that developers should have ownership of the AI generated code. While this is, indeed, the best scenario, it may just not be in line with human nature.

But if developers are unable to feel ownership of the code generated by AI, what do they feel ownership of? Andrej Karpathy hinted on what that is in one of his tweets:

“The hottest new programming language is English”

What developers can feel ownership of are the prompts given to an AI to generate code, but does this make AI a programming language? Not really, and at least now how I’d like it to be.

Maybe, for prompts to be considered a programming language, they should work like a higher level language. That is, similar to how a compiler transforms C++ code into machine code, I’d expect AI to transform the prompts into C++ code (or any other language).

But this fails in a couple ways. The same set of prompts would need to generate the same output. If that was the case, developers would be able to commit the sequence of prompts, which they feel ownership of, to their GitHub repository and reproduce the entire application from them. But that’s not how AI works, the same set of prompts can produce widely different results.

Additionally, looking at the compiler analogy, when the C++ code is correct and the compiler produces the incorrect output, this is not a developer issue, but a compiler issue. A compiler that doesn’t always produce the correct, or even the same output is considered to be broken. But, with AI, the solution is to go back and tweak the prompt until it works.

Another question is that, if code becomes English, it's likely that submitting the full specification rather than the sequence of prompts that led to that specification is easier for the AI to reproduce, and for humans to maintain (even if maintenance is assisted by AI).

Maybe, over time, coding AI systems will get better at correctness and reproducibility, and developers will be able to build their work on top of what they will feel ownership of, the prompts.

In the meantime, while developers may not feel the same level of ownership over AI generated code, learning how to effectively review it is becoming an important part of the developer’s skillset.

You may also want to read