{
  "question": "Can I use MIT, GPL or AGPL code in a closed-source SaaS?",
  "slug": "can-i-use-mit-gpl-or-agpl-code-in-a-closed-source-saas",
  "url": "https://www.rightshold.com/answers/can-i-use-mit-gpl-or-agpl-code-in-a-closed-source-saas",
  "short_answer": "MIT: yes, keep its copyright and license notice. GPL: yes for code that only runs on your own servers, because the GPL's source-sharing duty is triggered by giving people copies, not by running the software for them; anything you hand to users (a mobile or desktop app, an on-premises build, JavaScript sent to the browser) is a copy. AGPL-3.0: if you modify AGPL code, or build your code into it, and users interact with it over a network, you must offer those users the source of that version, so it does not fit a closed-source SaaS unless you run it unmodified as a separate component or get a different license from the author.",
  "checklist": [
    "List every dependency and its license, including transitive ones (npm sbom, pip-licenses, cargo metadata or your build tool's equivalent).",
    "Split what only runs on your servers from what you ship to users: mobile and desktop apps, on-premises or self-hosted builds, container images you give customers, and JavaScript served to browsers.",
    "Permissive code (MIT, BSD, ISC, Apache-2.0): keep the copyright and license text in everything you ship; Apache-2.0 also asks you to keep its NOTICE file and mark files you changed.",
    "GPL code in anything you ship conflicts with keeping that product closed. LGPL libraries can be used from closed code if users can swap in their own modified version of the library.",
    "AGPL components: note whether you changed them or linked your code into them. If so, and users reach them over a network, you owe those users the source. Options: replace the component, run it unmodified as a separate service, or ask the author for a commercial license.",
    "Treat source-available licenses (BUSL-1.1, Elastic-2.0, SSPL) separately: they are not open source and can restrict production use or offering the software as a hosted service.",
    "Write down each decision and re-check when a dependency changes license in a new version."
  ],
  "sections": [
    {
      "heading": "Why hosting is different from shipping",
      "points": [
        "The GPL's obligations attach to conveying copies. Running GPL software on your own servers and letting people use it over the web does not convey a copy, so it does not by itself oblige you to publish source.",
        "The AGPL closes that gap on purpose: its section 13 requires that users interacting with a modified version over a network be offered its corresponding source.",
        "Front-end code is the usual trap. JavaScript, WebAssembly or CSS bundled and sent to browsers is distributed to every visitor, so GPL code in the front end is shipped, even in a SaaS."
      ]
    }
  ],
  "checks": [
    {
      "label": "MIT code, modified, in a commercial hosted service",
      "license": "MIT",
      "license_name": "MIT License",
      "intended_use": {
        "commercial_use": true,
        "modification": true,
        "deployment": true
      },
      "verdict": "permitted",
      "answer": "Yes",
      "findings": [
        "Every use you described is granted by MIT, and nothing you described is prohibited."
      ],
      "duties": [
        "attribution",
        "license_notice"
      ],
      "official_text": "https://opensource.org/license/mit"
    },
    {
      "label": "GPL-3.0 code, modified, run on your own servers",
      "license": "GPL-3.0-only",
      "license_name": "GNU General Public License v3.0",
      "intended_use": {
        "commercial_use": true,
        "modification": true,
        "deployment": true
      },
      "verdict": "permitted",
      "answer": "Yes",
      "findings": [
        "Every use you described is granted by GPL 3.0, and nothing you described is prohibited."
      ],
      "duties": [
        "attribution",
        "license_notice",
        "state_changes",
        "share_alike",
        "source_disclosure"
      ],
      "official_text": "https://www.gnu.org/licenses/gpl-3.0.html"
    },
    {
      "label": "AGPL-3.0 code, modified, offered to users over a network",
      "license": "AGPL-3.0-only",
      "license_name": "GNU Affero General Public License v3.0",
      "intended_use": {
        "commercial_use": true,
        "modification": true,
        "deployment": true
      },
      "verdict": "permitted",
      "answer": "Yes",
      "findings": [
        "Every use you described is granted by AGPL 3.0, and nothing you described is prohibited."
      ],
      "duties": [
        "attribution",
        "license_notice",
        "state_changes",
        "share_alike",
        "source_disclosure",
        "network_source_offer"
      ],
      "official_text": "https://www.gnu.org/licenses/agpl-3.0.html"
    }
  ],
  "checks_note": "Yes means the license grants the use, on the duties listed. Duties such as source_disclosure, share_alike and network_source_offer are the ones that conflict with keeping a product closed-source.",
  "ask_rightshold": {
    "start": "https://www.rightshold.com/start?ref=seo",
    "mcp_endpoint": "https://www.rightshold.com/mcp",
    "ask": "My SaaS backend uses a modified AGPL-3.0 library and the front end bundles an MIT package. What do I owe users?",
    "mcp_call": {
      "tool": "license_compatibility",
      "arguments": {
        "licenses": [
          "MIT",
          "GPL-3.0-only",
          "AGPL-3.0-only"
        ],
        "intended_use": {
          "commercial_use": true,
          "deployment": true
        }
      }
    },
    "also": [
      "check_license answers one license for one use, with the duties that come with it.",
      "Pass a GitHub, npm or PyPI page as source_url and Rightshold reads the license that page declares."
    ]
  },
  "sources": [
    {
      "title": "GNU Affero General Public License v3.0",
      "url": "https://www.gnu.org/licenses/agpl-3.0.html"
    },
    {
      "title": "GNU General Public License v3.0",
      "url": "https://www.gnu.org/licenses/gpl-3.0.html"
    },
    {
      "title": "GNU: Why the Affero GPL",
      "url": "https://www.gnu.org/licenses/why-affero-gpl.html"
    },
    {
      "title": "The MIT License (OSI)",
      "url": "https://opensource.org/license/mit"
    },
    {
      "title": "Apache License 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0"
    }
  ],
  "related": [
    {
      "title": "Can I use GPL code in proprietary software?",
      "url": "https://www.rightshold.com/answers/can-i-use-gpl-code-in-proprietary-software"
    },
    {
      "title": "GPL vs AGPL",
      "url": "https://www.rightshold.com/answers/gpl-3-0-vs-agpl-3-0"
    },
    {
      "title": "Can I use BUSL-1.1 software in production?",
      "url": "https://www.rightshold.com/answers/can-i-use-busl-1-1-software-in-production"
    },
    {
      "title": "Check all npm dependency licenses",
      "url": "https://www.rightshold.com/answers/how-to-check-licenses-of-all-npm-dependencies-before-shipping"
    }
  ],
  "computed_from": "Curated guidance; license verdicts computed from Rightshold's license profiles at render time. Not legal advice.",
  "updated": "2026-10-28"
}