Back to the blog
Open SourceAILicenses

Should AI-generated code be open source?

November 16, 2026·6 min read·Diego Horvatti

Every function your AI assistant spits out in two seconds came from somewhere. That somewhere is, in large part, open source code written for free by thousands of people. Jakub Jankiewicz, author of jQuery Terminal and LIPS Scheme, used this idea as the starting point for a provocative post: all AI-generated code should be open source. It sounds like the exaggeration of a tired open source maintainer. But the argument is more solid than it seems. And it touches a question almost nobody asks day to day: who owns the AI-generated code you commit?

What the post argues

The reasoning fits in three steps.

First: the models were trained on a mountain of public repositories. GitHub, GitLab, npm packages, Stack Overflow answers. A lot of that is licensed MIT, Apache, GPL. In other words, licenses that ask for something in return, even if it's just keeping the copyright notice.

Second: what comes out of the model is, in a way, a derivative of that collective material. Nobody can point to the exact line each snippet came from. But all the knowledge came from there.

Third: if the raw material is shared, the product should go back to the commons. It's a matter of reciprocity. You took from the public library, you give back to the public library.

I don't agree with all of it. But the third step bothered me in the good way. The kind that makes you rethink something you thought was settled.

Does AI-generated code have an owner?

This is where the discussion gets less philosophical and more legal.

In the United States, the Copyright Office has made it clear in more than one guidance document that material produced solely by a machine, without meaningful human creative contribution, is not protected by copyright. The Thaler v. Perlmutter case reinforced this in court: a work with no human author has no copyright.

Translating that to your repository: if you asked "create a users CRUD with Prisma" and accepted the result without changes, there's a good chance that snippet has no owner at all. Not you, not your company, not the model's company.

If nobody owns it, putting "all rights reserved" on top is just decoration.

This takes Jakub's argument to another level. He isn't asking you to give up something valuable. In many cases, he's asking you to acknowledge a situation that already exists: that code is, in practice, public domain wearing an owner's badge.

Of course, reality is full of gray areas. When you rewrite it, adjust the architecture, combine three suggestions and fix the bugs, then there is human contribution. And Brazil still has no firm case law on this. But the direction of the wind is clear.

The risk nobody brings up in code review

There's a second, more practical problem: the model sometimes returns a snippet nearly identical to existing code. The 2022 class action against GitHub, Microsoft and OpenAI was born from exactly this. Copilot reproducing licensed code without the attribution notice. Most of the claims were dismissed, but the discomfort remains.

Think about a very common scenario:

// Suggestion accepted from autocomplete, no review
export function debounce<T extends (...args: any[]) => void>(fn: T, wait = 300) {
  let timer: ReturnType<typeof setTimeout> | undefined
  return (...args: Parameters<T>) => {
    clearTimeout(timer)
    timer = setTimeout(() => fn(...args), wait)
  }
}

This debounce is so generic it causes no trouble at all. Now swap it for a specific algorithm, like an unusual parser or a compression routine, that came almost word for word from a GPL project. You just put copyleft code into a closed product. And nobody noticed, because the diff looked like your usual code.

If AI-generated code were open by default, that risk would be visible. Anyone could compare it, point out the source, ask for attribution. Closed, it stays hidden until someone files a lawsuit.

Where I disagree

Forcing all AI-generated code to be open source doesn't work in real life. And it's not for lack of goodwill.

  • The line doesn't exist. Today almost every file has a bit of AI in it. Autocomplete here, a refactor there, a generated test. What percentage makes a file "generated"? 30%? One line?
  • The value is rarely in the code. What sets a SaaS apart is the business logic, the data, the operations, the support. The login form code is nobody's secret.
  • Security and contracts. Some clients require code confidentiality by contract. No banking system is going to open up an internal integration because of a thesis about reciprocity.

So, for me, the thesis works better as a compass than as a rule. It points to an honest question: how much of what you treat as property is really yours?

And here's my strong opinion: many companies will find out that a good chunk of their "proprietary code" has no legal protection at all. Those who treated the repository like a vault will have to admit the vault door was open. The value was always somewhere else.

What changes in your workflow

You don't need to open up your company's repository tomorrow. But you can work in a more conscious way.

1. Mark what came from AI. It doesn't need to be bureaucratic. A commit trailer already helps you trace things later:

git commit -m "feat: streaming CSV parser" \
  -m "Assisted-by: AI model (reviewed and adjusted manually)"

If a license question or an audit ever comes up, you know where to look.

2. Turn on the public code filter. Tools like Copilot have an option to block suggestions that match public code. Leave it on. It costs nothing.

3. Review specific snippets with suspicion. Generic code (debounce, email validation, a fetch hook) is safe ground. A rare algorithm, with odd variable names and comments in another language, deserves a quick GitHub search before the merge.

4. Give back when it makes sense. Solved an annoying problem with AI's help and it turned into a standalone utility? Publish it. A small npm package, a gist, a PR to the project you use. That's exactly the spirit of the thesis, just voluntary.

5. Read your dependencies' licenses. Sounds obvious. Nobody does it. A quick npx license-checker --summary shows in seconds whether you have GPL hiding in node_modules.

And open source, does it win or lose?

This is the part that truly worries me. Open source maintainers are being scraped by crawlers, receiving low-quality AI-generated PRs and watching their documentation traffic drop, because people ask the chat instead of opening the site. The project feeds the model and loses the reader who could have become a contributor or sponsor.

Jakub's idea is an attempt to close that loop. If AI eats from the commons, let it feed the commons back. Even without becoming law, it can become culture. And culture changes faster than courts.

My position is simple: I don't think all AI-generated code should be open source by obligation. But I think you should write as if it were. Clean code, traceable, no hidden copied snippet, and willing to give back what you can. If someone opens your repository one day, you won't be embarrassed. And let's be honest, it's the least you can do after years of copying Stack Overflow answers without upvoting.

If you want to see how I apply this in my own projects, take a look at what I've been building.

LinkedIn summary

Does AI-generated code have an owner? Maybe less than you think.

In the US, a work with no human author has no copyright. If you accepted that CRUD without touching anything, there's a good chance it belongs to no one. Not you, not your company.

Jakub Jankiewicz goes further: if AI learned from open code, what it generates should go back to the open.

I don't agree with turning this into a rule. The line between human and generated code no longer exists, and a product's value is rarely in the code.

Still, the idea works as a compass for me. Write as if the repository might go public one day: traceable, reviewed, no hidden GPL snippet, and willing to give back what you can.

I wrote on the blog about what changed in my workflow in practice. How do you handle this on your team?

#ArtificialIntelligence #OpenSource #SoftwareDevelopment #Copyright #Programming