ai newsDo., 22. Okt.
EilmeldungOpenAI makes its Jev competitor widely available as decision model competition heats up

LicenseGuard MCP Server soll GPL-Verstoesse durch AI-Agents verhindern

Autonome Coding-Agents wie Claude Desktop, Cursor, Devin, Roo-Code und Cline schreiben zunehmend Produktionscode. Der LicenseGuard MCP Server soll verhindern, dass dabei unbeabsichtigt GPL-lizenzierte Codeschnipsel in kommerzielle Codebasen gelangen.

dev.toDonnerstag 02:03 · 22.10.DE5 Min. Lesezeit
Bild: dev.to

Autonome Coding-Agents (Claude Desktop, Cursor, Devin, Roo-Code, Cline) werden rasant zum wichtigsten Autor moderner Software. Sie schreiben API-Endpunkte, implementieren komplexe Algorithmen und refactoren Legacy-Abhängigkeiten in Sekunden.

Doch diese Geschwindigkeit bringt ein akutes rechtliches und architektonisches Risiko mit sich: unabsichtliche Copyleft-Kontamination.

Da LLMs mit Milliarden von Zeilen öffentlichen Code trainiert werden, merken sie sich häufig Ausschnitte aus GPL-2.0-, GPL-3.0- oder AGPL-3.0-Repositories und übertragen diese direkt in proprietäre, MIT- oder Apache-2.0-Codebasen. Schlimmer noch: Agents installieren munter pip install scapy oder importieren readline in einen kommerziellen SaaS-Mikrodienst, ohne zu erkennen, dass eine In-Process-Verknüpfung mit einer GPL-Bibliothek rechtlich dazu zwingt, bei Distribution die gesamte proprietäre Codebasis unter der GPL als Open Source freizugeben.

In diesem Tutorial betrachten wir LicenseGuard MCP, einen Open-Source- und Enterprise-Model-Context-Protocol-Server (MCP), der eine automatisierte Lizenzgrenze für AI-Coding-Swarms errichtet und SPDX 3.0, die REUSE Specification sowie Architecture Decision Records (ADRs) direkt in die Agent-Workflows erzwingt.

Warum schlagen Enterprise-Rechts- und Compliance-Teams bei AI-Codegenerierung Alarm?

Nach der Auslegung des Urheberrechts durch die Free Software Foundation (FSF) entsteht durch die Kombination einer Anwendung mit einer GPL-Bibliothek im selben Prozessraum ein einziges abgeleitetes Werk:

Die klassische GPL löstQuellen-Offenlegungspflichten nur aus, wenn man kompilierte Binaries oder Desktop-Anwendungen vertreibt. AGPL-3.0 und SSPL schließen jedoch diese Lücke: Wird eine Anwendung als Clouddienst über das Netzwerk angeboten, löst das eine verpflichtende Quellcode-Offenlegung für entfernte Nutzer aus.

Die REUSE Specification (ausgerichtet an ISO/IEC 5230 OpenChain) verlangt, dass jede Datei in einem Repository einen eindeutigen SPDX-License-Identifier und SPDX-FileCopyrightText deklariert. Wenn Agents neue Hilfsskripte oder Konfigurationsdateien anlegen, lassen sie diese Header fast ausnahmslos weg, wodurch sich enorme lizenzrechtliche technische Schulden anhäufen.

LicenseGuard verbindet Ihre AI-Coding-Agents über Standard-JSON-RPC 2.0 stdio mit einer deterministischen Compliance-Engine:

┌────────────────────────────────────────────────────────┐ │ AI Coding Agents │ │ (Claude Desktop, Cursor, Devin, Roo-Code) │ └───────────────────────────▲────────────────────────────┘ │ JSON-RPC 2.0 (stdio) ┌───────────────────────────▼────────────────────────────┐ │ LicenseGuard Pro MCP Engine │ ├───────────────────────────┬────────────────────────────┤ │ 1. License Matrix Checker │ 4. AST Copyleft Tracer │ │ (MIT, Apache, GPL, AGPL│ (In-Process vs Subproc) │ ├───────────────────────────┼────────────────────────────┤ │ 2.

SPDX Header Validator │ 5. REUSE & dep5 Scaffolder │ │ (ISO/IEC 5230 Standard)│ (LICENSES/*.txt trees) │ ├───────────────────────────┼────────────────────────────┤ │ 3. License Risk Scorer │ 6.

Architecture ADR Engine │ │ (SaaS vs Binary models)│ (Formal legal rulings) │ └───────────────────────────┴────────────────────────────── 🛠️ Schritt 1: Prüfung von Code-Snippets gegen die Lizenzen des Host-Projekts Wenn ein Agent vorschlägt, eine Bibliothek zu importieren, fragt er audit_code_license_boundaries ab:

# Kontaminiertes Snippet, vorgeschlagen von einem Agenten: """ /* * This program is free software; you can redistribute it and/or modify * under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License. */ def calculate_metrics(data): return [x * 1.5 for x in data] """ Beim Audit gegen ein Apache-2.0- oder kommerzielles Host-Projekt liefert LicenseGuard folgendes zurück:

{ "host_project_license": "Apache-2.0", "status": "CONTAMINATED_COPYLEFT", "detected_licenses": [ "GPL-3.0-only" ], "compatibility_evaluations": [ { "target_host_license": "Apache-2.0", "dependency_license": "GPL-3.0-only", "is_compatible": false, "risk_level": "CRITICAL_CONTAMINATION", "reason": "GPL viral copyleft forces the entire combined work to be licensed under GNU General Public License v3.0 only, conflicting with host Apache-2.0.", "action_required": "Replace dependency with MIT/Apache-2.0 alternative or isolate across subprocess CLI pipe." } ] } Der Agent wird sofort daran gehindert, das kontaminierte Snippet zu committen, und zum Refactoren aufgefordert.

Statt lediglich Textstrings abzugleichen, analysiert LicenseGuard Pro den Abstract Syntax Tree (AST) von Python/JS/Go:

import subprocess def run_isolated_utility ( payload: dict ) -> str: # Safe: Subprocess standard stream boundary preserves Apache-2.0 host license result = subprocess. run ( [ " gpl_converter ", " --input ", " - " ], input = json. dumps ( payload ), capture_output = True, text = True, check = True ) return result. stdout LicenseGuard bewertet dieses Muster wie folgt:

{ "overall_status": "ISOLATED_BOUNDARY_SAFE", "has_subprocess_isolation": true, "is_contaminated": false, "detections": [ { "module": "gpl_converter", "license": "GPL-3.0-only", "linkage_type": "ISOLATED_SUBPROCESS_PIPE", "contamination_risk": "LOW", "verdict": "Allowed: Subprocess boundary creates an independent work under FSF GPL FAQ." } ] } 📜 Schritt 3: Erstellung formeller License Architecture Decision Records (ADRs) In der realen Entwicklungspraxis (etwa im Hardware-Design oder bei Open-Source-Kernel-Modulen) müssen Entwickler Grenzentscheidungen dokumentieren (zum Beispiel: "Dürren zitierte GPL-Schaltkreis-Konstanten in einem Apache-2.0-Repository liegen?").

LicenseGuard Pro erstellt vollständige Markdown-Architecture-Decision-Records:

licenseguard adr 19 "GPL Boundary Ruling for Cited Circuit Constants" --host Apache-2.0 --dep GPL-3.0-only Generierte Ausgabe ( docs/decision-records/0019-gpl-boundary-ruling.md ):

# 0019. GPL Boundary Ruling for Cited Circuit Constants - **Status:** `RATIFIED` - **Host Repository License:** `Apache-2.0` - **Evaluated Dependency License:** `GPL-3.0-only` ## 1. Context & Problem Statement When engineering swarms assemble polyglot systems, dependencies carrying copyleft terms introduce viral distribution requirements.

Eine verbindliche Governance-Entscheidung ist erforderlich, um festzustellen, ob eine Verknüpfung oder zitierte Daten Pflichten zu einem abgeleiteten Werk auslösen. ## 2. Decision **Ruling:** Isolate the GPL-3.0-only components strictly outside the in-process execution boundary. Communication must occur exclusively via subprocess standard streams, preserving the Apache-2.0 license for the main application and preventing copyleft contamination. ## 3.

Compliance Attestation This decision record serves as legal evidence of architectural due diligence under OpenChain ISO/IEC 5230 and REUSE Specification 3.0. 🚦 Schritt 4: Automatisierung von CI/CD-Gates in GitHub Actions Damit menschliche Entwickler und AI-Swarms niemals versehentlich Copyleft-Code mergen, generiert LicenseGuard sofort einsatzbereite GitHub-Actions-Workflows (.github/workflows/license-compliance.yml ):

name: Open-Source License & REUSE Compliance Guard on: [ push, pull_request ] jobs: license-audit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: ' 3.11' - run: pip install licenseguard-mcp reuse - run: python -m licenseguard.cli scan. - run: python -m licenseguard.cli audit. --host Apache-2.0 - run: reuse lint 🚀 Erste Schritte Open-Source-GitHub-Repository: Klonen Sie die Lite-Version und integrieren Sie sie in Claude Desktop oder Cursor: 👉 https://github.com/johannschiffer/licenseguard-mcp

Enterprise-Pro-Edition (14,99 USD): Schalten AST-basiertes Copyleft-Linkage-Tracing, REUSE- und dep5-Manifest-Generatoren, den Architecture-Decision-Record-Scaffolder (ADR) sowie die Docker-Sandbox frei: 👉 https://johanld.gumroad.com/

Indem Sie automatisierte Lizenz-Leitplanken direkt in den MCP-Kontext Ihrer Agents integrieren, schützen Sie Ihr Unternehmen vor viraler Urheberrechtskontamination, ohne die autonome AI-Entwicklung auszubremsen.

Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.

Original (Englisch) anzeigen

Autonomous coding agents ( Claude Desktop, Cursor, Devin, Roo-Code, Cline ) are rapidly becoming the primary authors of modern software. They write API endpoints, implement complex algorithms, and refactor legacy dependencies in seconds.

However, this velocity introduces an acute legal and architectural risk: Unintentional Copyleft Contamination.

Because LLMs are trained on billions of lines of public code, they frequently memorize and transcribe snippets from GPL-2.0, GPL-3.0, or AGPL-3.0 repositories directly into proprietary, MIT, or Apache-2.0 codebases. Worse yet, agents will happily pip install scapy or import readline into a commercial SaaS microservice without recognizing that in-process linkage to a GPL library legally forces the entire proprietary codebase to be open-sourced under the GPL upon distribution.

In this tutorial, we will explore LicenseGuard MCP, an open-source and enterprise Model Context Protocol (MCP) server that establishes an automated license boundary barrier for AI coding swarms, enforcing SPDX 3.0, the REUSE Specification, and Architecture Decision Records (ADRs) directly inside your agent workflows.

Why are enterprise legal and compliance teams sounding the alarm over AI code generation?

Under the Free Software Foundation's (FSF) interpretation of copyright law, combining an application with a GPL library in the same process space creates a single derivative work:

Traditional GPL only triggers source code distribution obligations when you distribute compiled binaries or desktop apps. However, AGPL-3.0 and SSPL close this loophole: offering an application as a cloud service over the network triggers mandatory source code disclosure for remote users.

The REUSE Specification (ISO/IEC 5230 OpenChain aligned) requires every file in a repository to declare an unambiguous SPDX-License-Identifier and SPDX-FileCopyrightText. When agents create new helper scripts or configuration files, they almost universally omit these headers, accumulating massive licensing technical debt.

LicenseGuard connects your AI coding agents via standard JSON-RPC 2.0 stdio to a deterministic compliance engine:

┌────────────────────────────────────────────────────────┐ │ AI Coding Agents │ │ (Claude Desktop, Cursor, Devin, Roo-Code) │ └───────────────────────────▲────────────────────────────┘ │ JSON-RPC 2.0 (stdio) ┌───────────────────────────▼────────────────────────────┐ │ LicenseGuard Pro MCP Engine │ ├───────────────────────────┬────────────────────────────┤ │ 1. License Matrix Checker │ 4. AST Copyleft Tracer │ │ (MIT, Apache, GPL, AGPL│ (In-Process vs Subproc) │ ├───────────────────────────┼────────────────────────────┤ │ 2.

SPDX Header Validator │ 5. REUSE & dep5 Scaffolder │ │ (ISO/IEC 5230 Standard)│ (LICENSES/*.txt trees) │ ├───────────────────────────┼────────────────────────────┤ │ 3. License Risk Scorer │ 6.

Architecture ADR Engine │ │ (SaaS vs Binary models)│ (Formal legal rulings) │ └───────────────────────────┴────────────────────────────┘ Enter fullscreen mode Exit fullscreen mode 🛠️ Step 1: Auditing Code Snippets Against Host Project Licenses When an agent suggests importing a library, it queries audit_code_license_boundaries:

# Contaminated snippet suggested by an agent: """ /* * This program is free software; you can redistribute it and/or modify * under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License. */ def calculate_metrics(data): return [x * 1.5 for x in data] """ Enter fullscreen mode Exit fullscreen mode When audited against an Apache-2.0 or commercial host project, LicenseGuard returns:

{ "host_project_license": "Apache-2.0", "status": "CONTAMINATED_COPYLEFT", "detected_licenses": [ "GPL-3.0-only" ], "compatibility_evaluations": [ { "target_host_license": "Apache-2.0", "dependency_license": "GPL-3.0-only", "is_compatible": false, "risk_level": "CRITICAL_CONTAMINATION", "reason": "GPL viral copyleft forces the entire combined work to be licensed under GNU General Public License v3.0 only, conflicting with host Apache-2.0.", "action_required": "Replace dependency with MIT/Apache-2.0 alternative or isolate across subprocess CLI pipe." } ] } Enter fullscreen mode Exit fullscreen mode The agent is immediately blocked from committing the contaminated snippet and prompted to refactor.

Rather than merely matching text strings, LicenseGuard Pro analyzes the Python/JS/Go Abstract Syntax Tree (AST):

import subprocess def run_isolated_utility ( payload: dict ) -> str: # Safe: Subprocess standard stream boundary preserves Apache-2.0 host license result = subprocess. run ( [ " gpl_converter ", " --input ", " - " ], input = json. dumps ( payload ), capture_output = True, text = True, check = True ) return result. stdout Enter fullscreen mode Exit fullscreen mode LicenseGuard evaluates this pattern:

{ "overall_status": "ISOLATED_BOUNDARY_SAFE", "has_subprocess_isolation": true, "is_contaminated": false, "detections": [ { "module": "gpl_converter", "license": "GPL-3.0-only", "linkage_type": "ISOLATED_SUBPROCESS_PIPE", "contamination_risk": "LOW", "verdict": "Allowed: Subprocess boundary creates an independent work under FSF GPL FAQ." } ] } Enter fullscreen mode Exit fullscreen mode 📜 Step 3: Generating Formal License Architecture Decision Records (ADRs) In real-world engineering (such as hardware design or open-source kernel modules), developers must document boundary rulings (e.g. "Can cited GPL circuit constants reside in an Apache-2.0 repo?" ).

LicenseGuard Pro scaffolds complete Markdown Architecture Decision Records:

licenseguard adr 19 "GPL Boundary Ruling for Cited Circuit Constants" --host Apache-2.0 --dep GPL-3.0-only Enter fullscreen mode Exit fullscreen mode Generated Output ( docs/decision-records/0019-gpl-boundary-ruling.md ):

# 0019. GPL Boundary Ruling for Cited Circuit Constants - **Status:** `RATIFIED` - **Host Repository License:** `Apache-2.0` - **Evaluated Dependency License:** `GPL-3.0-only` ## 1. Context & Problem Statement When engineering swarms assemble polyglot systems, dependencies carrying copyleft terms introduce viral distribution requirements.

A definitive governance ruling is required to establish whether linkage or cited data triggers derivative work obligations. ## 2. Decision **Ruling:** Isolate the GPL-3.0-only components strictly outside the in-process execution boundary. Communication must occur exclusively via subprocess standard streams, preserving the Apache-2.0 license for the main application and preventing copyleft contamination. ## 3.

Compliance Attestation This decision record serves as legal evidence of architectural due diligence under OpenChain ISO/IEC 5230 and REUSE Specification 3.0. Enter fullscreen mode Exit fullscreen mode 🚦 Step 4: Automating CI/CD Gates in GitHub Actions To ensure human developers and AI swarms never accidentally merge copyleft code, LicenseGuard generates ready-to-run GitHub Actions workflows (.github/workflows/license-compliance.yml ):

name: Open-Source License & REUSE Compliance Guard on: [ push, pull_request ] jobs: license-audit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: ' 3.11' - run: pip install licenseguard-mcp reuse - run: python -m licenseguard.cli scan. - run: python -m licenseguard.cli audit. --host Apache-2.0 - run: reuse lint Enter fullscreen mode Exit fullscreen mode 🚀 Get Started Open Source GitHub Repository: Clone the Lite version and integrate it into Claude Desktop or Cursor: 👉 https://github.com/johannschiffer/licenseguard-mcp

Enterprise Pro Edition ($14.99 USD): Unlock AST-Level Copyleft Linkage Tracing, REUSE & dep5 Manifest Generators, Architecture Decision Record (ADR) Scaffolder, and Docker sandbox: 👉 https://johanld.gumroad.com/

By putting automated license guardrails directly into your agents' MCP context, you protect your company from viral copyright contamination without slowing down autonomous AI development.

Originaltitel: How to Prevent AI Agents from Accidentally Injecting GPL Violations into Commercial Codebases: A LicenseGuard MCP ServerQuelle: dev.to (dev.to). Original öffnen