My open source project is released under Apache2 License. I want people to use the library under Apache2 however I don't want people to copy the ideas/algorithms when they're building products similar to my library.

If I add a statement in README file detailing out the restriction then will it be okay? Does having a statement in README file is legally enforceable if needs arise?


After reading through all the great answers I agree it is a terrible idea for many reasons.

  • 26
    You can always reuse ideas. There's nothing the law can do to protect that. If you don't want people to reuse your ideas, then you can't publish the software/ideas. – curiousdannii Jan 26 at 0:05
  • 17
    You can not at the same time grant people the rights to use your code under Apache2 and also deny them those very rights. – Polygnome Jan 26 at 15:06
  • 7
    Also bear in mind that a project that says "Licensed under Apache 2, kinda" is going to scare a lot of people away. Not being sure about the license just isn't acceptable to many maintainers of other projects that might have used your library. – Karl-Johan Sjögren Jan 26 at 15:11
  • 2
    @curiousdannii: Patents exist. – user3840170 Jan 27 at 9:12
  • 1
    Thanks @MadHatter, I have accepted the answer. – Gurmit Teotia Feb 2 at 14:32

You're technically allowed to do this, but at that point your project is no longer Apache-licensed. You've created a new set of licensing terms, which are no longer open source. It would be in your interest to make this distinction clear, as to avoid confusion by people who look at your project. In particular, it would be confusing to have a LICENSE file with the Apache terms – put your custom license there instead, possibly with the Apache license as an appendix.

Note also that ideas are not copyright-protected. Certain methods can be patented, but in general the only available protection for general ideas or methods is a trade secret. Which requires that you keep it secret. Which is incompatible with making the library's source code available.

You should therefore re-examine your reasons for publishing this code, and for considering an open-source-ish license. There are good reasons for going open source, but it's also perfectly legitimate if your needs are different.

  • 8
    It might be worth pointing out that as well as being explicit about creating a new license, the OP should be very cautious about doing so. Existing licenses are carefully crafted by experts in the relevant laws; licenses created by non-experts are sometimes disparagingly referred to as "crayon licenses", as in "might as well have been drawn with a child's crayon". – IMSoP Jan 26 at 14:14
  • 6
    Including contradictory statements is going to hurt enforceability. If you have a LICENSE file that explicitly gives permission to do X, and a README that denies permission to do X, it's very unlikely that a judge will grant damages against someone who does X -- it says right there in the license (and thus in any automated tools that generated a summary based on comparison of that license to verbatim copies, which major companies often use) that they were permitted! Thus, someone would really want to modify the LICENSE file and explicitly have it no longer be Apache licensed at all. – Charles Duffy Jan 26 at 17:07
  • @CharlesDuffy exactly, this answer claims it's ok but I'd love to see an actual case where a readme took precedence over the license. – eps Jan 26 at 19:02
  • 8
    It's also worth noting that if you write a custom license without legal training (or even with it, with a handful of exceptions if your software is truly unique and valuable and the license terms are serviceable), and especially if you write a custom license that even purports to restrict people's ability to write other software if it contains similar ideas to your own, nobody with any sense is going to use your project. No company wants to take the risk that if they use your project once, you could come after them years later because a future project contains some vague similarity to yours. – Zach Lipton Jan 27 at 10:04
  • Would a statement in some random file really be legally binding if this wasn't explicitly mentioned in the actual license file? Do I really have to carefully analyze every single file in a repository to make sure I get the license right? Or are you assuming that the whole licensing agreement is stated in the README file? – Voo Jan 28 at 12:50

If you don't want people to copy your ideas and algorithms you should not use an open source licence at all. Putting some kind of statement in your README would just add contradiction to your files. Apache 2 license grants the permissions you don't want to grant, using it and saying the opposite in another place would just be confusing and contradictory. If you don't want people to copy the ideas and algorithms of your library, no open source license will fit your needs.

  • Ideas are not copyrightable. To protect idea you have to hide it (by obfuscation) or cover by a patent. While copyright law is almost universal worldwide patent law is not. You have to issue patents in each country / market you have interests (there are some unions like crosspatenting in EU, but I'm not expert here). – gavenkoa Feb 6 at 19:51
  • 1
    @gavenkoa It doesn't change the fact that if you release a software under an open source license, you are allowing others to have access to your ideas and if your are releasing a software more specifically under Apache 2 license and you have some patent over those ideas you are explicitly granting a patent license to use those as stated in details in the item 3 of this specific license. – Iogui Feb 6 at 22:12

Short answer,as well as everything else, its not likely to be enforceable, simply because you didn't present it as part of the license.

Let's look at your idea, and start from basics, the license itself.

Your software will have some license attached. You've suggested Apache2. So somewhere there will be a file that makes clear, "this following text below, is the license", or else, "in this named file is the license".

The user has to know that that's the license. As an extreme example if your source code is 6000.files and contains a file called "/tmp/cache/trash/oldcode.php" that actually contains unannounced and without header, the license text, and nothing points to it as being such, probably no court will agree its binding on a user, because that's just not reasonable to assume. (They might instead stipulate that this means no license was granted, but the point is, the license must clearly be identifiable as such, by a reasonable user, to be enforceable)

So you need to provide a file or document that's clearly and obviously "the" license. That could be a top level file or directory called "LICENSE", or a config file item that you have to change to "yes" to confirm you read a specific named file, for it to run, or a first-run UI. I've seem all 3 of those, used. But the user has to agree to something specific, in a legally unambiguous definite way.

And that's your problem.

  • If that file is the Apache2 license terms, it won't include your clause.
  • If it includes your clause, then its a custom license not an Apache2 license.
  • If you try to stuff your custom terms in a README file, firstly there's no legal obligation or reason a conscientious user would have had to read and agree that file. So its not legally binding. Secondly the license is this other file over here - it says so! - so clearly that README whatever it says, and whatever anything else.says, it isn't the license agreement or any part of it, because the license is this text here, which doesn't state that other text is to be included. (And if it did, then once again it wouldn't be the Apache2 license text..)

It fails whatever you do.

Your 2nd legal problem

The 2nd legal problem is that you are trying to DIY a legal text. That means that aside from any issue of user reluctance about a modified/custom license, and aside from stuffing text in some other file and trying to claim "its part of the license anyway", you have a second problem.

You need to be able to define, in terms adequate for a court to take note, exactly what may and may not be done with your code. Exactly how the restrictions will.work, to draw a precise line what makes it valid or invalid use, no ambiguity or inadvertent errors in a legal sense that could make it unenforceable. I honestly would say, don't even think of it. Even the simplest term is not obvious.

Example: Say you just wanted to say "not be used in any company with over 10 employees". Simple, right? How can that simple a clause have a loophole? But what about a 1000 staff company with a separate group company of 9 that would use it on behalf of them all? What if they have 8 staff but outsource all the rest to a contractor with 500 staff on their project? Just making the point, legal text stuff is NOT for amateurs. Even seeming simple terms are not.

And finally your 3rd legal problem

As stated, you can't copyright/license a pure idea anyway. Only a specific implementation of it (your own code). Meaning you can't copyright the idea of a database, an audio editor or a file archiver, the idea of a bubble sort, or a technique for identifying faces in an image. You cant stop someone else seeing the concept and figuring out their own way to do it, on their own clock, to compete with yours. You can only copyright Postgresql, Sony Vegas, or gzip, if you created those, or your specific code for a bubble sort or face ID.


Normally, ideas and algorithms are protected by patents, not copyright (at least that's what I was taught in that class we had as CS majors).

I am not sure, but my gut feeling is that the FOSS community takes a dim view of software patents.

I am not sure how other FOSS licenses interact with patents, but Apache 2 license explicitly contains wording which grants the user of the software a license to use your patents as used in the software.

  • 2
    The applicability of patent law to ideas and algorithms is complicated, controversial, and rather unclear at the moment. In the US, see Alice v. CLS Bank and much of the surrounding commentary. In short: The Supreme Court has made a supreme mess of the law, and nobody has any idea what you can or can't patent. – Kevin Jan 26 at 17:16
  • I live in Poland and that's knowledge from ten years ago. Anyway, patents are most definitely more applicable to ideas and algorithms than copyright is. You can't copyright and algo, you can try patenting it. – Jan Dorniak Jan 26 at 17:18
  • 1
    Patents can only apply to specific implementations of ideas/algorithms. There's nothing you can legally do to stop someone saying "Oh wow, that's really cool, I'll do something like that." – curiousdannii Jan 27 at 0:42
  • @curiousdannii Why are you so sure you can replicate "invention" covered by a patent without problems? All patents state that they differ from something else in some particularly distinctive way. Otherwise the original patent has power over your product. – gavenkoa Feb 6 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.