Implementation Guide

    What Engineering Leaders Should Do After Shipping GPL Code Generated by an AI Assistant

    Treat it as an incident with an evidence trail. Scope the affected code, commits, releases and distribution channels. Establish where the code came from and what licence context it carries. Ask legal counsel whether copyleft obligations apply. Then choose a remediation path (replacement, rewrite, relicensing or compliance) and record each decision. Afterward, move policy enforcement into the coding assistant's execution path so the same exposure is caught before code reaches a repository.

    A six-step response sequence

    1. 1

      1. Preserve and open the record

      Snapshot the affected repositories, tags and build artifacts. Open an incident with an owner and a remediation timeline.

    2. 2

      2. Scope the code

      Identify the files, functions and commits that match or derive from licensed code, including later edits by people or tools.

    3. 3

      3. Map releases and channels

      List every release, package, container image, internal system and customer delivery that contains the code.

    4. 4

      4. Establish origin and licence context

      Link each fragment to the assistant session, user, repository and commit that introduced it, and to the likely upstream source.

    5. 5

      5. Assess obligations with counsel

      Give counsel the scope, origin evidence and distribution model, and ask which obligations apply.

    6. 6

      6. Remediate and verify

      Choose a path, implement it, rebuild, rescan and record the outcome.

    Why this is an engineering and evidence problem first

    GPL is a copyleft licence family. When code under it is copied into a product, or a work derives from it, the licence may attach conditions to how that product is distributed or deployed. Whether those conditions apply to your situation depends on the licence version, how the code is combined with your own, and how the software reaches users. That determination belongs to legal counsel, and this guide does not give legal advice.

    What engineering leaders control is the quality of the facts counsel receives. A team that cannot say which commits contain the code, which releases shipped them, and which assistant session produced them will spend its time reconstructing history instead of deciding. NIST AI 600-1 recommends documenting the origin and history of generated data and aligning generative AI use with copyright and intellectual property law. In practice, the response is only as defensible as the records behind it.

    Open the incident formally. Name an owner, bring in legal early, and set a timeline for stakeholders. NIST also recommends maintaining procedures for remediating issues that trigger incident response, with timelines for the remediation plan.

    Establishing origin and licence context

    Start with what your own systems already know. Commit history shows who committed the code and when. Pull request metadata shows whether an assistant connected to the repository created the change. NIST's coding-assistant use case describes exactly this pattern: the assistant connects to the source repository, edits code, and creates and commits pull requests. Each of those actions is a point where a generation event could have been recorded.

    Next, compare the code against known licensed code. Snippet matching, similarity analysis and dependency scanning each have limits. Exact-match tools can miss code that was renamed or lightly restructured. Similarity tools can flag common idioms that no one owns. Dependency scanners and SBOMs describe declared components, and may not see a fragment pasted into a source file. Use more than one method, treat results as leads for review, and have an engineer inspect each match before it goes to counsel.

    NIST SP 800-204D recommends verifying the provenance of ingested code and generating an SBOM with dependency scanning from the first commit. Applying that to the affected builds gives you a component baseline to compare against what was actually shipped.

    Remediation paths and decision criteria

    There is rarely one correct path. Counsel's view of the obligations, the size of the affected code, and the cost of change to customers usually decide it. Different paths may suit different components in the same incident.

    • Remove and replace: Substitute a permissively licensed or internally owned implementation. Suits small, well-isolated fragments with clear interfaces. Ship a patched release and confirm the old one is retired or supported.
    • Rewrite independently: Have engineers who have not seen the matched code write the functionality from a specification. Suits larger pieces where behaviour must be preserved. Keep a record of who wrote it, from what inputs, and how it was reviewed.
    • Comply with the licence: Meet the conditions counsel identifies for the affected releases. Suits cases where the business can accept those conditions. It needs coordinated release, notice and distribution handling.
    • Relicense or obtain permission: Seek different terms from the rights holder. Suits cases where the owner is identifiable and willing. It depends on facts outside engineering's control, so run it in parallel with another path.

    Retaining evidence that supports a defensible response

    Decide what you will need to show counsel, auditors or customers, and capture it as you go. At minimum: the scoped findings, the origin analysis for each fragment, counsel's assessment, the remediation path chosen and why, the builds and releases affected, and the verification that the fix worked. NIST SP 800-218A calls for recording and triaging all discovered issues along with their recommended remediations. Treat the licence finding like any other triaged defect.

    Going forward, keep a tamper-resistant history of what the assistant generated, modified or shared. NIST AI 600-1 recommends content transparency solutions that document each such instance to enable traceability. If that history exists, scoping questions are answered from records, and the next incident starts with facts instead of reconstruction.

    Also review how the assistant is permitted to act. NIST SP 800-204D recommends granular authorizations for tasks such as generating and committing code to source control. An assistant that can commit directly without review removes the checkpoint where a licence concern would normally be raised. Extend code review policy to cover AI-related code explicitly, and hold a short after-action review once remediation is verified.

    From after-the-fact review to enforcement in the execution path

    Scanning and review find problems after code has entered a repository, and sometimes after it has shipped. They remain necessary, but they cannot prevent recurrence on their own. Closing the gap requires policy that acts while the assistant is working.

    Trussed enforces policy in the execution path of coding assistants, alongside models, agents, tools and MCP servers. Policy is enforced at runtime, not reviewed after the fact. For each interaction or tool call, the decision can be to allow, redact, block, rate limit or escalate for human approval. Trussed code provenance provides the origin, licence and security context of code, so a policy can treat output with a licence concern differently from unremarkable output, for example by routing it to a reviewer before it is committed.

    Every enforcement decision also produces audit-ready evidence, so the record of what the assistant was allowed to do and what it did exists without reconstruction. Trussed deploys self-managed in the customer cloud, with configurable retention and data residency. Detection of licensed code has inherent limits, so provenance signals should inform review and policy, not replace counsel's judgement.

    When evaluating any control of this kind, ask whether it can record the user, repository and commit tied to each assistant output, whether it enforces before code reaches the repository, what its documented detection limits are, and whether its evidence is tamper-resistant and exportable for counsel and auditors.

    Post-ship response sequence

    Scope

    Affected files, commits, releases and channels

    Establish origin

    Source, licence and generation context

    Assess with counsel

    Whether copyleft obligations apply

    Remediate

    Replace, rewrite, relicense or comply

    Retain evidence

    Decisions, timelines and verification

    Put policy in the path of your coding assistants

    Talk to an expert about enforcing policy on coding assistants at runtime, with code provenance and audit-ready evidence for every decision.

    Talk to an Expert