AI Agent Code Reuse Disputes: Evidence Verification and Engineering Audit

    When an AI agent project faces accusations of copying code, strong claims alone settle nothing. This article explains how to separate factual questions from emotional rhetoric in code provenance disputes, distinguish functional similarity from implementation copying and license violations, build a verifiable evidence chain, and audit the actual execution chain of an AI agent—including service restarts, model configuration, online data queries, scheduled tasks, and skill management. It also outlines practical acceptance criteria for enterprises adopting AI agents.

    1. Setting the Scope First: Runtime Logs Are Not Evidence of Code Provenance

    When disputes arise over the origin of code in an AI agent project, three distinct questions must be separated: whether the system runs correctly, whether it uses code from other projects, and whether such use is properly licensed. These questions are related, but a single piece of evidence cannot answer all of them.

    The materials currently available mainly show a few operational steps: restarting the backend service, selecting a model and provider, running interactive configuration, querying weather online, creating a daily weather forecast task, and listing locally installed skills. These records help us understand the system’s entry points and intended usage, but they contain no source code comparison, no license files, no commit history, and no complete communication records.

    On that basis alone, no one can confirm that a project constitutes plagiarism, nor verify whether the response described in a disputed headline was accurate, complete, or taken out of context. A more professional approach is to convert emotional accusations into checkable questions:

    • Which files, functions, or modules are alleged to be improperly reused?
    • Where exactly does the claimed similarity between the two codebases appear?
    • Does the referenced code come from upstream dependencies both projects use?
    • What license governs the original code, and what obligations did the reuser fulfill?
    • When did the relevant code appear, and can a reliable provenance chain be established?
    • Does the public response explain technical facts, or merely state a position?

    Only once these questions are answered can the discussion shift from “whose tone is tougher” to “which facts can be independently verified.”

    2. Judging Code Reuse: Separate Function, Implementation, and Authorization

    1. Functional Similarity Does Not Mean Copied Implementation

    AI agents typically require model invocation, tool execution, task scheduling, state persistence, and permission control. Two systems that both support weather queries, daily scheduled tasks, and skill management reflect converging requirements for software of the same category—not evidence of copying.

    Common interactions such as configuration wizards, task lists, and service startup prompts have limited room for variation. A similar feature list, similar UI layout, or similar prompt wording is generally insufficient to prove direct copying of source code.

    A proper review should dig into the implementation layer and look for details that are unlikely to arise independently, such as:

    • Identical non-essential branching and exception-handling sequences;
    • The same rare variable names, mistaken comments, or typos;
    • The same defects patched the same way;
    • The same unusual data transformation pipelines;
    • Large blocks of continuous, identical code reflecting clear creative choices.

    Such details strengthen the discriminative power of the evidence—but common dependencies, generated code, standard examples, and shared upstream sources must still be ruled out.

    2. Code Similarity Alone Does Not Prove a Violation

    Code reuse is a normal part of software development. The key question is not “was someone else’s code used?” but “was there a right to use it, and were the conditions met?”

    Different licenses impose different requirements regarding copyright notices, license text, modification statements, source code availability, and redistribution. Some licenses permit broad use, while others attach additional obligations to specific forms of distribution. Auditors should read the actual terms of the applicable license rather than rely on the vague impression that “public code can be used freely.”

    Several distinct types of disputes should also be distinguished:

    • Attribution disputes: missing author information, copyright notices, or source statements.
    • License compliance disputes: unmet license conditions.
    • Contribution attribution disputes: someone else’s work presented as self-produced.
    • Legal infringement disputes: protected content used without authorization.

    These issues may coexist or involve only one of them, and they should not be conflated. Any definitive legal conclusion requires the applicable jurisdiction, the license text, and the actual manner of use.

    3. Build a Verifiable Evidence Chain, Not a Pile of Screenshots

    1. Fix the Audit Targets

    First, record the exact code versions of both parties being compared, the time they were obtained, the file scope, and integrity checksums. Otherwise, subsequent code changes will cause different participants to see different content.

    A minimal evidence set should include:

    • The complete source code of the compared versions, or a verifiable archive;
    • The corresponding licenses and copyright notices;
    • File paths and version information for the files in question;
    • Segment-by-segment diff explanations;
    • Relevant commit history;
    • Complete context of all publicly available communications.

    Screenshots are useful for illustration but cannot replace original files. They often lack version information and do not support full-text search or repeated comparison.

    2. Compare Code in Layers

    Comparison should not stop at an overall similarity percentage. A better method is to identify the disputed modules first, then examine text, structure, and behavior separately.

    At the text layer, examine continuous fragments, comments, and constants. At the structural layer, examine function organization, conditional branching, and call relationships. At the behavioral layer, observe outputs, exceptions, and edge cases under identical inputs.

    Note that a similarity percentage is not a legal threshold. Large amounts of boilerplate can inflate similarity ratios, while a small amount of critical code may carry high review value. Reports should therefore explain the origin and nature of the similar content—not just present a number.

    3. Interpret Timelines Cautiously

    An earlier commit date does not automatically mean the author holds original rights to all of that code. The code may originate from earlier private development, external contributions, or other public sources. Version history may also have gone through migrations, merges, and rewrites.

    Timelines help establish provenance relationships but cannot, on their own, determine authorship. Reliable conclusions usually require mutual corroboration among version history, public release records, original files, and contribution records.

    4. Auditing the AI Agent’s Actual Execution Chain from the Runtime Records

    Although the original operation records cannot prove where the code came from, they offer a valuable engineering audit entry point: examine the implementation, dependencies, and permissions of each layer along the functional call chain.

    A generic execution flow can be summarized as:

    User request → agent parses the goal → selects model and tools → executes actions → validates results → saves state → returns an execution report

    Each step may involve independent modules. A code provenance audit should cover the boundaries between these modules, not just the top-level interaction code.

    1. Service Restart: Process State Is Not Business Availability

    “The service has been restarted” usually only means the service management layer accepted the operation, or the process re-entered a running state. It does not automatically prove that model credentials are valid, external network access works, the scheduler has recovered, or task storage is accessible.

    A complete check should cover three layers at minimum:

    • Process layer: Is the background process alive? Does it crash repeatedly?
    • Dependency layer: Are configuration, storage, and required external connections available?
    • Business layer: Can a verifiable real task be completed?

    If a restart is followed only by checking the startup prompt, problems such as tasks not loading, skills being unavailable, or file write permissions failing can easily go unnoticed.

    2. Model Configuration: Configuration Complete Is Not Invocation Successful

    Interactive configuration typically involves service endpoints, authentication details, model selection, and runtime parameters. During an audit, verify where the configuration is stored, the override order, and the read logic—otherwise the UI may show an updated configuration while actual calls still use stale values.

    Credentials must never appear in plaintext in logs, error messages, or ordinary task outputs. To validate a configuration, execute a minimal request and confirm that the call path and returned content behave as expected—but receiving a response alone does not prove that all tool capabilities work.

    3. Online Queries: Prove the Information Comes from a Valid Data Source

    A weather query is not just generating natural language. The agent must obtain data with an explicit location and update timestamp, and state its validity window.

    Reliable results should answer:

    • Which location does the query correspond to?
    • When was the data published or updated?
    • What time range does the forecast cover?
    • When a request fails, is stale data used?
    • When information is missing, is that clearly flagged?

    If a valid data source cannot be reached, the system should report a failed or incomplete query—not generate seemingly real-time weather information from the language model’s general knowledge.

    5. The Daily Weather Task: From One Instruction to Verifiable Requirements

    “Generate a weather forecast for each district of Shanghai every morning at 7 a.m. and save it locally” looks simple, but it actually involves scheduling, area coverage, data acquisition, result generation, and file persistence—each with its own constraints.

    1. Define Task Semantics First

    Before creating the task, confirm the time zone, the list of districts, the forecast time range, the output directory, and the file naming rules. “Each district of Shanghai” is not equivalent to “Shanghai citywide weather,” and district coverage should be verified item by item against a maintained list.

    Exception handling also needs to be defined: if a query for one district fails, does the entire task terminate, or do successful results get kept while missing entries are logged? If the system is down at the scheduled time, does the task rerun or get skipped? These are business rules—the agent should not be left to guess them.

    2. Establish Verifiable Completion Criteria

    Task success should have objective grounds, for example:

    • The scheduled run was actually triggered;
    • All planned districts were processed;
    • Results include both data timestamps and generation timestamps;
    • Output files exist and are readable;
    • Partial failures are explicitly marked;
    • Execution logs can be correlated to the corresponding files.

    A file being written successfully proves only that the persistence step completed—not that the weather data is complete or fresh. A scheduler triggering successfully does not prove the task executed successfully.

    3. Prevent Duplicate Runs and Partial Files

    Scheduled tasks must account for restarts, retries, and concurrent execution. Use task identifiers combined with business dates to build deduplication records, and apply mutual exclusion controls per execution cycle.

    For file writes, a “write to a temporary file first, then replace the target file” approach reduces the risk of readers encountering partial files—though the actual reliability still depends on file system semantics and the replacement operation. Retries should have a retry limit and backoff strategy to avoid endless requests or sustained resource consumption.

    The following is an illustrative flow. It expresses design logic only and does not correspond to any specific tool interface:

    1. Receive scheduling event
    2. Determine time zone, business date, and district list
    3. Check whether this cycle has already completed
    4. Acquire execution lock and prevent concurrent duplicates
    5. Query weather per district, recording data timestamps and errors
    6. Validate district coverage and result format
    7. Write to a temporary file and publish results
    8. Save execution state and release the execution lock
    9. Return a success, partial success, or failure report

    6. Skill Management Is Both Capability Discovery and Supply Chain Auditing

    When listing local skills, do not focus only on “how many are installed.” A skill may contain prompt templates, scripts, dependency specifications, and execution entry points—and its risk depends on what it actually executes and what permissions it holds.

    Confirm each of the following separately:

    • Whether each skill is installed and enabled;
    • Whether its required dependencies are satisfied;
    • Where its content came from and whether the version is traceable;
    • Whether it requires network access, file writes, or process execution permissions;
    • Whether its actual behavior deviates from its description;
    • Whether uninstalling or upgrading leaves residual entry points.

    This layer matters especially in code reuse disputes. The top-level code may be self-developed, but some skills, examples, or helper scripts may come from external sources. Reviewing only the main program while ignoring extensions leaves blind spots in provenance and licensing.

    A safer practice is to record, for each extension component, its source, version, license terms, modifications, and permission scope—and re-check them on every update, rather than treating a one-time installation review as permanently valid.

    7. Public Responses Should Provide Facts, Not Substitute for Evidence

    Aggressive wording in a dispute may shape public perception, but it proves nothing about whether code was copied. A technically effective response should focus on specific files and licensing circumstances:

    1. Confirm or deny which code snippets were used;
    2. Explain where those contents came from;
    3. Provide the corresponding versions and licenses;
    4. Explain the attribution and compliance measures already in place;
    5. Propose remediation for any genuine omissions;
    6. Preserve materials that third parties can independently verify.

    Likewise, the accusing party should avoid drawing definitive conclusions based solely on functional similarity, fragmentary screenshots, or incomplete chat logs. The more heated a public dispute becomes, the more essential it is to clearly separate confirmed facts, reasonable inference, and unverified claims.

    8. Before Adopting AI Agents, Enterprises Should Audit Both Capability and Provenance

    When evaluating an AI agent, enterprises should not treat “installed successfully, can converse, can create tasks” as the full acceptance standard. At least four categories of checks are needed:

    • Functional acceptance: Are tasks completed according to explicit requirements?
    • Operational acceptance: Are restarts, failure retries, and state recovery verifiable?
    • Security acceptance: Are credentials, network access, and file writes properly constrained?
    • Provenance acceptance: Is license information for code, dependencies, and skills complete?

    These four checks are independent of each other. A functionally working system is not necessarily license-compliant, and license compliance says nothing about whether execution is secure and reliable.

    For the materials at hand, the defensible conclusion is this: they demonstrate several operational entry points of an AI agent, but they do not support a definitive judgment on the code dispute. What deserves attention is not the strong wording in the headline, but whether a complete evidence chain for code provenance can be formed—and whether service restarts, model invocations, online queries, scheduled execution, and skill loading all have traceable, verifiable engineering records. Only by handling both lines well can one avoid false accusations while also reducing real compliance and operational risks.