I am writing an R package for my employer which will be used as part of the backend of a proprietary web application. We intend to distribute this under some type of open source license.

If we license it under AGPL, does that allow us to reference other packages that are licensed under GPL/MIT?

If a competitor uses our R package in the backend of a competing application, would they need to open source their entire application in order to remain compliant with our AGPL license?

Would this allow us to keep the rest of our application proprietary?

Is there a better or alternative way to allow our R package to be open source while limiting the possibility that it might be used as part of a competing proprietary application?

  • Note you do not have to comply with your own licence (unless you include 3rd party code, that forces this licence). Commented May 27, 2019 at 21:56

1 Answer 1


The goal of the (A)GPL is to ensure end user freedom, not to limit competitors. These goals do have some overlap but are fundamentally divergent. A pro-freedom license like the AGPL doesn't exactly fit your anti-competitive requirements, and will likely leave you frustrated as it isn't effective for your goals. For example, MongoDB and Redis stopped using the AGPL in 2018 because the license didn't work for their goals.

The GPL triggers requirements when others receive a copy of the software. The AGPL additionally triggers requirements when others interact with the software over a network. If none of these cases trigger, you can already use (A)GPL-covered software without any requirements, such as running the software in combination with proprietary parts. (Note that this also means that competitors could use such software without any obligations.)

If you write software that is combined with GPL-covered software, you must either (a) not trigger license requirements (like distributing the software), or (b) license it under a GPL-compatible license.

I think this means that your goals (denying your software to competitors) are best served by not publishing your software at all. The GPL does not require you to do so if you only run your software on your own servers.

If you do publish your software then we have to discuss GPL versions for a moment. GPLv2 and GPLv3 are fundamentally incompatible, unless there is an upgrade clause such as “or any later version”. GPLv2 and AGPLv2 are incompatible as well. However, GPLv3 may be combined with AGPLv3. This means:

  • if you have a mix of GPLv2-only and GPLv3-only libraries, you cannot distribute the resulting software. Workarounds like splitting the software into multiple services may be possible.
  • if you have GPLv2-only libraries, the GPLv2 is the strongest open source license you can use for the entire software.
  • if you have GPLv2-or-later or GPLv3 libraries, you can choose the GPLv3 or AGPLv3 license for the entire software.

While the (A)GPL is required for the software as a whole, you could license the code that your company wrote under more permissive licenses (e.g. MIT). However, this is at odds with your goal of using a license that is as copyleft as possible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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