The user wants an "open-source license compatibility matrix and policy."
1. Analyze the Request:
- Goal: Create a document that explains which open-source licenses are compatible with each other and outlines a policy for using them.
- Components:
- License Matrix: A visual or tabular representation of compatibility (permissive vs. copyleft, combining code).
- Policy: Guidelines for developers/contributors on how to choose licenses, how to handle dependencies, and legal compliance.
- Target Audience: Likely a software organization, a team of developers, or an open-source project maintainer.
- Tone: Professional, legalistic but accessible (not actual legal advice, but policy-like).
2. Structure the Output:
A good policy document needs structure.
- Title & Introduction: Purpose and scope.
- Definitions: What is "compatibility"?
- The Matrix: The core visual aid. (This is hard to render perfectly in text, but a Markdown table works well).
- Policy Guidelines:
- Inbound (Using external code).
- Outbound (Releasing code).
- License Categories: Briefly explain Permissive, Weak Copyleft, Strong Copyleft.
- Disclaimer: Essential.
3. Drafting the Content - Section by Section:
-
Title: "Open Source License Compatibility Matrix & Policy"
-
Introduction: "This document provides guidance on..."
-
The Matrix (The Tricky Part):
- I need to select the most common licenses. Trying to list every license is impossible.
- Selected List: MIT, Apache 2.0, BSD (2/3-clause), LGPL, GPL v2/v3, AGPL, MPL.
- Concepts:
- Permissive + Permissive = Compatible (usually MIT/BSD/Apache).
- Permissive -> Copyleft = Compatible (if the result is Copyleft).
- Copyleft + Copyleft = Tricky (GPLv2 only vs GPLv3 is a common pitfall).
- Copyleft -> Permissive = Incompatible (Viral effect).
- Format: A Markdown table is best.
- Refinement: Instead of a giant N x N matrix which is hard to read, I'll categorize them by "Can [License A] code be included in a project licensed under [License B]?"
- Better approach for text generation: Define "Safe to Combine" groups. Or, stick to a simplified matrix showing "Inbound Code" vs "Project License".
- Let's try a simplified compatibility logic table:
- If Project is MIT/BSD/Apache: Can use MIT/BSD/Apache. Cannot use GPL/LGPL (unless project switches to GPL/LGPL).
- If Project is GPL: Can use MIT/BSD/Apache/GPL.
- If Project is Proprietary: Can use MIT/BSD/Apache. Cannot use GPL/LGPL.
- Decision: I will provide a categorical matrix (Permissive vs. Copyleft) and specific notes on common interactions.
-
The Policy (The "Rules"):
- Default License: What should the org use? (Usually MIT or Apache for permissive, GPL for copyleft).
- Inbound (Using others' code):
- Always check the
LICENSE file.
- Maintain
NOTICE files (crucial for Apache 2.0 and BSD).
- Dependency management (transitive dependencies).
- Outbound (Contributing back):
- Sign-off procedures (DCO or CLA).
- Prohibited Licenses: Usually AGPL (for commercial proprietary software) or non-OSI approved licenses (JSON, WTFPL, etc.).
-
Compatibility Logic Explanation (The "Why"):
- Permissive: "Do whatever, keep copyright notice."
- Weak Copyleft (LGPL/MPL): "Modify the library -> share changes. Link to it -> do whatever."
- Strong Copyleft (GPL): "Distribute binary -> share source."
- Network Copyleft (AGPL): "Use over network -> share source."
4. Refining the Content & formatting:
- Self-Correction during drafting: A full matrix with checkboxes is confusing in plain text. It's better to list "Compatibility Rules" based on the Project's target license.
- Structure Change:
- Policy Statement (High level).
- License Tiers/Definitions.
- The Matrix (Grouped by "Can I use X in Y?").
- Process/Procedures (What to do when adding a dependency).
5. Drafting the Matrix specifically:
I will create a table with rows for "Incoming Dependency" and columns for "Project License Strategy".
- Scenario: Can I use a GPL library in a Proprietary project? No.
- Scenario: Can I use an MIT library in a GPL project? Yes.
- Scenario: Can I use an Apache 2.0 library in a GPLv2 project? NO (Patent clause conflict). Crucial detail.
6. Final Polish:
Add a strong "Not Legal Advice" disclaimer. Ensure the tone is policy-oriented (e.g., "Employees must...", "The policy is...").
(Self-Correction on GPLv2 and Apache 2.0):
This is a specific incompatibility. GPLv2 is incompatible with Apache 2.0 due to the patent termination clause, unless the GPLv2 software has the "or later" clause allowing upgrade to GPLv3. I need to make sure this nuance is captured.
7. Final Output Generation: (Proceeding to generate the response based on these steps.)
Here is a comprehensive draft of an Open Source License Compatibility Matrix & Policy.
This document is designed to be adapted for a software engineering organization, an open-source foundation, or an internal corporate legal guideline.
Open Source License Compatibility Matrix & Policy
Version: 1.0
Date: [Insert Date]
Status: Draft
1. Purpose
This document establishes the policy for using open-source software (OSS) within [Organization Name] projects. It provides a high-level compatibility matrix to ensure that our software complies with license obligations and avoids legal risks regarding intellectual property (IP) contamination.
Disclaimer: This document is for informational purposes only and does not constitute legal advice.
2. License Categories
To understand compatibility, we categorize licenses into four distinct buckets based on their restrictions and obligations:
- Permissive (Green): Minimal restrictions. Requires only attribution and preservation of copyright notices. (e.g., MIT, BSD, Apache 2.0).
- Weak Copyleft (Yellow): Requires sharing modifications to the original library, but allows linking proprietary code to it without infecting the proprietary code. (e.g., LGPL, MPL, EPL).
- Strong Copyleft (Red): Requires any project that includes, links statically, or derives from this code to be released under the same license. Infects the whole codebase. (e.g., GPLv2, GPLv3, AGPL).
- Proprietary (Black): Source-available or standard commercial software. Not OSS, but often used alongside it.
3. The Compatibility Matrix
The following matrix determines if Code A (Incoming Dependency) can be used in Project B (Your Project License).
Legend:
- ✅ Compatible: Safe to combine.
- ⚠️ Conditional: Requires specific architectural decisions (e.g., dynamic linking).
- ❌ Incompatible: Violates license terms. Do not combine.
- 🧨 Conflict: License terms clash (e.g., Apache 2.0 within GPLv2-only).
| Incoming Dependency (Library) | Proprietary (Closed Source) | Permissive (MIT/BSD/Apache) | Weak Copyleft (LGPL/MPL) | Strong Copyleft (GPL/AGPL) |
|---|
| MIT / BSD (2 & 3 Clause) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
| Apache 2.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes (GPLv3 only) |
| LGPL v2.1 / v3 | ⚠️ Dynamic Link Only | ⚠️ Dynamic Link Only | ✅ Yes | ✅ Yes |
| MPL 2.0 / EPL | ⚠️ File-Level Isolation | ⚠️ File-Level Isolation | ✅ Yes | ✅ Yes |
| GPL v2 / v3 | ❌ No | ❌ No | ❌ No | ✅ Yes (Same Version) |
| AGPL (Network) | ❌ No | ❌ No | ❌ No | ✅ Yes (AGPL Only) |
| CDDL / Common Development and Distribution License | ⚠️ File-Level Isolation | ⚠️ File-Level Isolation | ✅ Yes | ❌ No (Incompatible) |
| GPLv2 Only | ❌ No | ❌ No | ❌ No | 🧨 Conflict (w/ v3) |
Key Compatibility Nuances
- Apache 2.0 & GPLv2: Apache 2.0 is technically incompatible with GPLv2 because of patent termination clauses. However, Apache 2.0 is compatible with GPLv3. If your project is GPLv2-only, you generally cannot use Apache 2.0 libraries.
- LGPL & Static Linking: If you statically link an LGPL library to your proprietary code, your code effectively becomes "derived work" and must be open-sourced. Policy: Always dynamically link LGPL libraries.
- AGPL over HTTP: The AGPL closes the "SaaS loophole." If an AGPL library is used on a server and users interact with it over a network, you must provide the source code of your entire application to those users.
4. Usage Policy
4.1. Approved Licenses (Green Light)
These licenses can be used freely in both open-source and proprietary projects, provided the LICENSE file is included in the final distribution and attribution is given in the "About" or "Credits" section of the software.
- MIT License
- BSD 2-Clause & 3-Clause
- Apache License 2.0 (Preferred for modern projects due to patent protections)
- ISC License
- Artistic License 2.0
4.2. Restricted Licenses (Yellow Light)
Usage of these licenses requires architectural review to ensure isolation boundaries are maintained.
- LGPL (Lesser GPL): Allowed only if the library is maintained as a separate, dynamically linked module.
- MPL 2.0 (Mozilla Public License): Allowed. MPL is file-level copyleft. You can mix MPL files with proprietary files, but if you modify the MPL files, you must share those specific files.
- CDDL: Similar to MPL. Allowed with file-level isolation.
4.3. Forbidden / High-Risk Licenses (Red Light)
These licenses are strictly prohibited for use in any core proprietary product unless the organization intends to release the full source code.
- GPL (v2 & v3): Do not include GPL code in proprietary repositories.
- AGPL: Strictly prohibited in commercial/SaaS products without explicit CTO/Legal approval.
- SSPL (Server Side Public License): Not an OSI-approved open-source license. Treated as proprietary.
5. Contributor Workflow
For Inbound Contributions (Using 3rd Party Code)
- Check License: Before copying code from StackOverflow or GitHub, check the license header.
- Snippet Policy: Small snippets (under ~10 lines) of code generally fall under "Fair Use" but should be attributed in comments. Do not copy whole files unless the license is approved.
- Forking: If forking a repo, retain the original
LICENSE file. Do not delete it.
For Outbound Contributions (Releasing Code)
- Headers: All source files must contain the standard license header.
- Example:
// SPDX-License-Identifier: Apache-2.0
- Notice File: A
NOTICE or ATTRIBUTIONS file must be generated during the build process listing all 3rd party OSS libraries and their licenses.
6. Enforcement
- Automated Scanning: All CI/CD pipelines must run a license scanning tool (e.g., FOSSA, Snyk, Black Duck, or
license-checker for NPM).
- Break the Build: The build pipeline should fail if a "Red Light" (GPL/AGPL) dependency is introduced into a proprietary project context without a manual override approval.
7. Approval Workflow
If a developer needs to use a library with a "Red Light" license or a license not listed here, the following steps must be taken:
- Submit a License Exception Request to the Open Source Review Board (OSRB).
- Justify why the component is necessary and why alternatives are insufficient.
- Legal team must review the specific integration method (linking vs. executing).
Appendix: Quick Reference for Developers
- Can I use GPL code in my internal tool?
- Yes, if the tool stays internal. (GPL distribution triggers only when you give the software to others). However, be careful not to accidentally distribute it (e.g., via a Docker image to a client).
- Can I use an MIT library in my proprietary software?
- Yes. Just keep the copyright notice.
- I copied code from a blog. Is it licensed?
- Legally: All code is copyright-protected by default unless explicitly licensed.
- Action: Assume "All Rights Reserved" (Red Light) unless the blog states otherwise.