Skip to content

The Drift Log · Provenance, licensing and the paper trail

Tracing Agent Generated Functions Back to Source Licenses

1 September 2026 · 3 min read · 726 words · established

A wax seal resting on a page of hash digests

AI assistants vendor copyleft algorithms directly into files, bypassing manifest-based SBOMs and introducing silent compliance debt.

An engineer opens a pull request containing forty lines of clean, un-annotated bitwise operations. It implements an efficient ring buffer or a lock-free queue. The tests pass, the benchmarks look exceptional, and the diff says the author is an agent.

Reviewers look for logic bugs, off-by-one errors, and memory leaks. Finding none, they approve the pull request.

The code now lives in your default branch. Two quarters later, an audit or a static analysis tool flags that those forty lines are an exact token-for-token reproduction of a GPL-3.0 or AGPL-3.0 implementation from a public repository. The prompt did not ask for copyleft code, but the model reproduced it anyway.

The immediate liability is not the prompt. The liability is that you are now distributing copyleft logic without fulfilling the reciprocal license terms, and your git log shows no record of where it came from.

The Gap in Standard License Audits

Most teams treat license compliance as a package-level concern. They scan top-level manifests, run dependency checkers in CI, and generate an SBOM (Software Bill of Materials) that lists declared third-party crates, npm packages, or Go modules.

That approach assumes all un-manifested code was written by an employee with a keyboard.

Agents break this assumption. When an assistant writes a function directly into an existing file, it behaves like vendored code without the vendor directory. It bypasses the package manager entirely. No license file accompanies the snippet, no manifest entry is created, and your SBOM remains completely blind to its presence.

If you vendor a third-party library manually, you take on operational debt, a problem detailed in our guide on why vendoring code without a paper trail is unsecured debt. When an agent vendors an algorithm inline without citing its origin, that debt is silent. You lose software provenance at the exact moment of creation.

┌─────────────────┐       ┌──────────────────┐       ┌────────────────┐
│  Agent Emits    │ ───>  │ Standard SBOM    │ ───>  │ Unattributed   │
│  GPL Algorithm  │       │ Scans Manifests  │       │ Copyleft Code  │
└─────────────────┘       └──────────────────┘       └────────────────┘
                                  │
                          (Blind to Snippets)

Signatures Over Prompts

Checking prompt logs does not solve the problem. A prompt asking for "an optimized Aho-Corasick implementation in Go" contains no copyright markers. The risk is determined entirely by the output artifact's similarity to existing public corpora.

To maintain licensing boundaries, verification must happen against origin signatures before the function lands in your tree.

  1. Token n-gram matching: Extract structural tokens (ignoring local identifier renames) and match against indexed open-source corpora.
  2. AST fingerprinting: Compare the abstract syntax tree of algorithmic blocks against known copyleft signatures.
  3. Lineage gating: Treat any machine-generated block exceeding a minimal complexity threshold as an external import until its provenance is cleared.

This is genuinely hard to do at the PR level without introducing developer friction. Exact matches are easy to flag, but minor stylistic mutations introduced by an agent can fool naive hash comparisons while preserving the protectable expression of the original author.

If an agent cannot provide a verifiable origin chain for an algorithm, the engineering team must treat that block as unverified third-party IP.

How SHPBL Enforces Lineage

At SHPBL, we do not allow runtime model generation to invent unverified logic inside customer systems. Our corpus is model-independent: no AI model runs inside our software, and no component's behaviour depends on a model's output at runtime.

Every automated write must pass our Build Intent gate. When an agent requests a capability, the proposal is registered, and its licensing invariants are resolved explicitly in deterministic code before a terminal state is returned.

Agent Request ──> [ Build Intent Gate ] ──> Licensing Resolved ──> Deterministic Artifact

The underlying catalog consists of verified, owned code sealed by published archive checksums on our root of trust. If you want to see how your current codebase handles unverified dependencies and latent licensing obligations, you can run a free repository evaluation to audit your exposure.

What to Do on Monday

Do not wait for legal to mandate an audit. Put basic guardrails around agent PRs immediately:

  • Configure snippet scanning in CI: Ensure your static analysis pipeline scans raw diffs for copyleft signatures, not just package manifests.
  • Isolate algorithmic contributions: Require team members to flag when a commit contains non-trivial agent-generated algorithms.
  • Enforce provenance comments: If an agent reproduces an algorithm based on an existing permissive standard, record the reference implementation URL and license explicitly in the header.

If nobody can point to the origin license of a forty-line routine, write it from scratch or replace it with a tracked, deterministic component. Clean logic is only cheap until you have to defend its lineage.

This post supports the longer argument in Vendoring Code Without a Paper Trail Is Unsecured Debt.

Keep reading

Next in the log

The Strategic Master Library · written and reviewed under the house's own epistemic rules: nothing claimed that we cannot show.