Who owns AI-generated code — and why "mine" and "only mine" are different things

You spent an evening building an app together with a model. Fair question: whose is it now?
The answer sounds simple — yours. Then you open the provider's terms and find two words that change everything: "if any". "We assign you all our rights in the output, if any." That clause isn't decoration.
This isn't legal advice. It's a map: where the obvious ends, and which question to take to a lawyer once the project starts making money.
Short answer: you can use it, owning it is harder
Separate two questions in your head and the confusion ends:
- May I use, sell, publish this? Almost certainly yes — the provider's terms decide that.
- Can I stop someone else from using it? That's where it gets interesting, and copyright law decides it.
Most arguments happen because both get mashed into the word "owns". They don't line up.
What the provider's terms say
OpenAI's terms put ownership like this: as between you and OpenAI, you keep your rights in the input and own the output — and then, "We hereby assign to you all our right, title, and interest, if any, in and to Output."
Read it slowly. The company assigns its rights — the ones it has. "If any" honestly admits there may be none. Nobody promises the rights exist at all.
It's like buying a flat with the wording "I transfer all my rights to it, if I have any". You'll probably be allowed to live there. Defending yourself against a third party with that piece of paper — no.
What copyright law says
The US Copyright Office, in its report on what is protectable in the generative era, landed on this: the output of generative AI is protected by copyright only where a human has determined sufficient expressive elements. And separately: writing prompts — "the mere provision of prompts" — isn't enough for that.
AI itself doesn't kill protection, though. The same conclusion says using AI to assist in creation, or including AI-generated material in a larger human-made work, doesn't bar copyrightability. Protection appears wherever your contribution is:
- your own human-authored text is perceptible in the result;
- you creatively arranged or modified the model's output.
Which gives an awkward but useful takeaway: pure generation belongs to nobody. A file the model produced whole from one line of prompt probably isn't owned by anyone — and you won't be able to stop someone else from using it.
Nobody handed you the only copy
The second gap between expectation and reality sits a section below in those same terms. Literally: due to the nature of AI, output may not be unique and other users may receive similar output. And the assignment to you doesn't extend to other users' output.
Practical translation: that generic component you asked for was almost certainly produced for someone else today too. Not because anyone stole it — because the question was the same.
So don't bet on "my code is unique". A vibe-built project's value lives outside the source: the audience, the data, how fast you ship fixes, your reputation.
The third layer: someone else's licence
Models learned partly on open code. Occasionally output can be a recognisable chunk of someone's project — and that project has a licence, which didn't evaporate because the text arrived through a chat window.
The risk for a small project is low, but checking is cheap:
- a strangely specific function name or comment — search for it verbatim;
- a whole ready-made module out of nowhere — worry more than about ten lines;
- some editors and agents have a public-code match filter — turn it on if it exists.
What to do in practice
Put a human in. Architecture, arrangement, edits, choosing between variants — that's the contribution the law notices.
Keep the history in git. A chain of commits is the best evidence that a person made decisions behind the code. You can't assemble it after the fact.
Don't build a business on "nobody can copy this". Build on speed and on users.
Read your own provider's terms, not a summary online. OpenAI, Anthropic and Google word this differently, and consumer chat rules differ from API rules.
Don't feed the model things that aren't yours. Someone else's proprietary code in a prompt is its own story: what not to paste into an AI chat.
Can I sell an app written by AI?
Yes. Provider terms allow commercial use of output, free tiers included. The limit isn't on selling — it's that protecting the source from copying will be harder than you assume.
Do I have to disclose that AI wrote the code?
For code, usually not. But app stores, marketplaces and clients have their own disclosure rules, and an AI clause in a contract work agreement is increasingly common. Read the contract before signing.
If I rewrote everything after the model, does it become mine?
Then your contribution is protected: the edits, the structure, the arrangement. That's exactly the case the Copyright Office describes as creative modification of the output. The more of your decisions a file contains, the closer it is to an ordinary authored work.
The AI Architect 2027 course: step by step from computer basics to your own app and first customers. 543 short lessons on your phone.





