Open-Source AI Agent Code Copying Disputes: Provenance and License Compliance

    Code similarity alone does not settle an open-source AI agent dispute. This article explains how to assess code provenance through textual, structural, historical, and dependency evidence, review license obligations, preserve evidence during disputes, and integrate SBOMs, software composition analysis, and compliance gates into development workflows.

    1. The Real Issue: Not Just Similarity, but Compliance

    Public discussions of alleged copying in open-source AI agent projects often focus on subjective observations such as similar interfaces or overlapping features. From an engineering and legal perspective, the more useful distinction is this: code similarity is evidence to investigate; compliance with the original license’s attribution, notice, and modification requirements is central to the conclusion.

    General-purpose agent projects commonly share several architectural elements:

    • A unified, extensible mechanism for loading skills.
    • Abstraction layers for tool invocation and model orchestration.
    • Persistent conversations and memory.
    • Scheduled tasks and messaging gateways.

    These designs have converged across the industry, so independently developed implementations may have similar structures. Allegations therefore require reproducible evidence, not visual impressions alone.

    2. Building an Evidence Chain: Four Layers

    2.1 Textual Evidence

    Residual text is often the easiest evidence to discover and the hardest to explain: comments, log messages, error strings, sample configurations, or even distinctive spelling mistakes and author initials from the original project.

    Such details generally have no functional reason to appear verbatim in an independent implementation. They can therefore provide strong clues about provenance.

    2.2 Structural Evidence

    Abstract syntax tree comparisons, control-flow graph isomorphism checks, function boundaries, and naming patterns can help identify code that has been copied and then renamed or superficially rewritten.

    Locality-sensitive hashing techniques are also used for large-scale approximate matching. The following example illustrates a SimHash-based approach:

    1. import hashlib
    2. from collections import Counter
    3. def shingles(text: str, k: int = 5):
    4. tokens = text.split()
    5. return [" ".join(tokens[i:i + k]) for i in range(len(tokens) - k + 1)]
    6. def simhash(text: str, k: int = 5, bits: int = 64) -> int:
    7. vector = [0] * bits
    8. for gram in shingles(text, k):
    9. h = int(hashlib.md5(gram.encode()).hexdigest(), 16)
    10. for i in range(bits):
    11. vector[i] += 1 if (h >> i) & 1 else -1
    12. out = 0
    13. for i in range(bits):
    14. if vector[i] > 0:
    15. out |= 1 << i
    16. return out
    17. def similarity(a: str, b: str) -> float:
    18. ha, hb = simhash(a), simhash(b)
    19. return 1 - bin(ha ^ hb).count("1") / 64

    Similarity scores must be interpreted carefully. Formatting changes, language ports, and framework rewrites can reduce textual similarity without establishing independent authorship. Structural comparisons should therefore be combined with repository history rather than treated as standalone proof.

    2.3 Historical Evidence

    Commit timelines can be among the strongest sources of evidence. Relevant questions include:

    • In what order did files first appear?
    • How large was the initial commit?
    • Were many files imported at once, with little evidence of incremental development?
    • Was author metadata uniformly rewritten?

    Projects developed over time typically show repeated, incremental changes. A bulk import deserves investigation, although the timeline must be assessed alongside the other evidence.

    2.4 Dependency and Build Evidence

    Lockfiles, dependency mirror settings, build scripts, cache directory names, and residual paths in packaged artifacts can reveal the original engineering environment.

    This layer is frequently overlooked, yet it can be decisive in tracing where a codebase came from.

    3. License Obligations Must Be Checked Individually

    Different license families impose different requirements. The following table provides a high-level comparison; the applicable license text determines the precise obligations.

    License family Attribution and notices Modification notices Copyleft scope Network-service provisions
    Permissive, such as MIT and BSD variants Retain copyright and license notices Generally not required None None
    Permissive with an explicit patent grant, such as Apache 2.0 Retain required notices Mark modified files None None
    Weak copyleft, such as LGPL variants Retain required notices Identify modifications as required Library-level obligations None
    Strong copyleft, such as GPL variants Retain required notices Identify modifications as required Covered derivative work as a whole No network-use-only trigger
    Network copyleft, such as AGPL variants Retain required notices Identify modifications as required Covered derivative work as a whole Source-access obligations can apply to modified software used over a network

    Two points matter especially.

    First, permissive licenses generally do not require derivative code to be released as open source. However, removing required copyright or license notices is itself a compliance violation and can jeopardize the permission to use the code.

    Second, for network-copyleft licenses, “we do not distribute it; we only provide an online service” does not necessarily avoid source-code obligations. The relevant license provisions must still be reviewed.

    4. Why Deleting Accounts Does Not Resolve a Dispute

    Deleting a repository or closing an account is a technical governance anti-pattern. It can destroy commit history, weaken the team’s ability to demonstrate independent development, and potentially raise concerns about evidence destruction.

    A more defensible response follows a structured process:

    1. Freeze and preserve. Pause distribution of the affected versions and preserve complete repository history and snapshots of build artifacts.
    2. Commission an independent comparison. Have a party without a conflict of interest review structural and historical evidence and produce a reproducible report.
    3. Classify the findings. Distinguish among independently implemented functionality, reuse without required attribution, and a substantially derivative implementation.
    4. Remediate. Restore attribution and license notices, publish modification notices, and, where required, release the corresponding source code under the original license or replace the implementation.
    5. Improve the process. Introduce automated compliance gates to reduce the likelihood of recurrence.

    5. Enterprise Risk Controls: SBOMs, Composition Analysis, and Gates

    For enterprises, the central risk is not whether open source is used, but whether that use is visible and controllable. Three practical layers can support that goal.

    Layer 1: Software Bill of Materials

    The build pipeline should generate a software bill of materials (SBOM) for each release. It should record component names, versions, licenses, sources, and hashes, then archive the results in object storage to establish a traceable release baseline.

    Layer 2: Software Composition Analysis Gates

    Software composition analysis (SCA) in continuous integration can scan source code and dependencies for license classifications and known vulnerabilities. Policy violations should block merging.

    The following platform-neutral example illustrates the intended gate rather than a specific CI platform’s syntax:

    1. # Platform-neutral illustration of a pipeline compliance gate
    2. stages:
    3. - name: license-gate
    4. steps:
    5. - run: sca scan --license-policy ./policy.yml --fail-on violation
    6. - run: sbom generate --format spdx --output dist/sbom.spdx
    7. rules:
    8. - on: pull_request
    9. action: block_merge

    Layer 3: License Allowlists and Exception Approval

    Classify licenses as allowed, requiring review, or prohibited for the relevant use case. Exceptions should be documented and assigned a review interval.

    1. allow: [MIT, BSD-2-Clause, BSD-3-Clause, Apache-2.0]
    2. review: [LGPL-2.1, LGPL-3.0, MPL-2.0]
    3. deny: [GPL-3.0, AGPL-3.0] # Example policy for closed-source distribution

    Supporting controls should include signed commits, protected branches, and mandatory code review on the code-hosting platform. Logs and monitoring alerts should feed into a centralized logging service so that large code imports remain auditable.

    When using cloud container platforms and pipeline services, make these gates release prerequisites rather than post-release cleanup tasks.

    6. A Compliance Checklist for In-House Agent Projects

    Enforce License Headers

    Maintain consistent license identifiers and copyright lines in source-file headers, using templates and checks to enforce them.

    The following script checks for an SPDX license identifier in the first five lines of Python and TypeScript files:

    1. #!/usr/bin/env bash
    2. set -euo pipefail
    3. missing=0
    4. while IFS= read -r f; do
    5. head -n 5 "$f" | grep -q "SPDX-License-Identifier" || { echo "Missing license identifier: $f"; missing=1; }
    6. done < <(find src -name '*.py' -o -name '*.ts')
    7. exit $missing

    Apply the Checklist Beyond Source Code

    • When studying open-source implementations, distinguish borrowing design ideas from copying implementation text. If code is reused, preserve its provenance and document modifications.
    • Include skills, prompt templates, and sample datasets in license management. Compliant code does not automatically make the accompanying assets compliant.
    • Before external distribution, review the complete SBOM and retain the review record.
    • Establish a dispute-response plan that assigns responsibility for evidence preservation and defines consistent external communications.

    7. Conclusion

    The open-source AI agent ecosystem depends on respecting license terms. Disputes should be resolved through a complete evidence chain and an assessment of applicable obligations—not through public attention or superficial similarity.

    Deleting history or closing accounts only makes the situation harder to evaluate. For developers and teams, integrating SBOMs, composition analysis, and license gates into everyday pipelines is a practical, cost-effective way to protect both their projects and the open-source work they depend on.