{
  "question": "Can I train an AI model on code from GitHub?",
  "slug": "can-i-train-ai-on-github-code",
  "url": "https://www.rightshold.com/answers/can-i-train-ai-on-github-code",
  "short_answer": "MIT code: Needs review. GPL-3.0 code: Needs review.",
  "framing": "Each repository's license decides; training is not named in most code licenses.",
  "checks": [
    {
      "label": "MIT code",
      "license": "MIT",
      "license_name": "MIT License",
      "intended_use": {
        "model_training": true
      },
      "verdict": "needs_review",
      "answer": "Needs review",
      "findings": [
        "The license grants broad rights but attaches conditions (such as keeping notices) to copies and adaptations. Whether a trained model, or its output, is a copy or adaptation that carries those conditions is legally unsettled, and in some places training may fall under an exception such as fair use. A human reviewer should confirm this use for your case."
      ],
      "duties": [
        "attribution",
        "license_notice"
      ],
      "curation": "curated",
      "official_text": "https://opensource.org/license/mit"
    },
    {
      "label": "GPL-3.0 code",
      "license": "GPL-3.0-only",
      "license_name": "GNU General Public License v3.0",
      "intended_use": {
        "model_training": true
      },
      "verdict": "needs_review",
      "answer": "Needs review",
      "findings": [
        "The license grants broad rights but attaches conditions (such as keeping notices) to copies and adaptations. Whether a trained model, or its output, is a copy or adaptation that carries those conditions is legally unsettled, and in some places training may fall under an exception such as fair use. A human reviewer should confirm this use for your case."
      ],
      "duties": [
        "attribution",
        "license_notice",
        "state_changes",
        "share_alike",
        "source_disclosure"
      ],
      "curation": "curated",
      "official_text": "https://www.gnu.org/licenses/gpl-3.0.html"
    }
  ],
  "context": [
    "Whether a model trained on code is a derivative work is unsettled; Rightshold marks it for review where the license does not settle it."
  ],
  "sources": [
    {
      "title": "GitHub: Licensing a repository",
      "url": "https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository"
    }
  ],
  "check_it_yourself": {
    "mcp": {
      "tool": "check_license",
      "arguments": {
        "license": "MIT",
        "intended_use": {
          "model_training": true
        }
      }
    },
    "rest": "POST https://www.rightshold.com/v1/licenses/check"
  },
  "computed_from": "Rightshold license profiles at render time; not legal advice",
  "updated": "2026-10-19"
}