HACKER Q&A
📣 ugjka

Is there a license that forbids your code from being used to train AI?


Is there a license that forbids your code from being used to train AI?


  👤 JohnFen Accepted Answer ✓
You can make your license have any terms you want. You could even do something like use one of the standard licenses and add your own clause about AI to them. But do involve an attorney to help draft it if you go this route.

The bigger question is -- will it do any good? I doubt that AI scrapers are reading license agreements to ensure they're allowed to scrape sites, so the first question is -- can you detect license violations?

And the second question is -- if you can detect them, are you in a position to enforce them? If you can't afford to take a violator to court, the terms of the license don't really matter much beyond being sabre-rattling.


👤 robocat
Maybe use unique tokens in your license: then you can try and see if the model has been trained on your tokens.

See the code completion of the FFmpeg GPL license text in the first video: https://codeium.com/blog/copilot-trains-on-gpl-codeium-does-...


👤 barbariangrunge
I wish you could do this for copyrighted written work like blogs and newsletters, but I assume any disclaimers you add will get ignored by the web scrapers

👤 ezekg
But then the zealots will say it’s not open source.