Provenance Deficit: The Unwritten Audit Trail Inside AI-Assisted Codebases
Photo: DFID - UK Department for International Development, CC BY 2.0, via Wikimedia Commons
Few enterprise engineering organizations can now answer a question their legal department will eventually ask: which lines of code in this repository were written by a machine, and under what terms did it arrive? AI coding assistants have moved from sanctioned pilot to default tooling at many US enterprises in under three years, and the output has entered version control with the same informality as anything a developer typed by hand. The difference is that a human's keystrokes carry an implicit warranty of authorship. A model's output does not.
The gap is not primarily a legal problem, although it will become one. It is an administrative problem that has been allowed to compound while engineering teams optimized for measured velocity and procurement teams optimized for per-seat cost.
An Administrative Gap Before It Is a Legal One
The instinct is to route the question to counsel and wait for an opinion. That is the wrong first move. Most enterprises do not yet possess the underlying facts counsel would need: no inventory of which repositories contain generated or materially modified code, no record of which assistant and which model version was in use at a given commit, and no distinction between a completion accepted verbatim and a snippet subsequently rewritten by a human.
A legal opinion built on that foundation is a guess with a letterhead. Before the question reaches outside counsel, the organization needs a defensible factual record.
What the Tooling Actually Leaves Behind
The honest answer is: less than leadership assumes.
- Editor telemetry typically records acceptance rates and suggestion counts, but rarely retains the accepted text or its location.
- Commit metadata names a human author and nothing more. The machine is invisible in the permanent record.
- There is no lineage link between a generated block and the prompt, context window, or repository content that produced it.
- Dependencies suggested by a model - including package names that are invented or subtly misspelled - enter manifests with the appearance of ordinary developer choices.
Each of these is a small omission. Together they mean the repository is an artifact whose authorship record is materially incomplete, and the organization has no way to reconstruct it after the fact.
Building an Inventory That Survives Scrutiny
An inventory does not require instrumenting every keystroke. It requires four passes, run in sequence.
First, a repository census. Enumerate every repository, its owner, its data classification, and whether its output ships to customers, to regulators, or as distributed software. The last category matters most: code that leaves the building under a license carries the highest exposure.
Second, a tooling map. Establish which assistants are sanctioned, which are tolerated, and which are in use without approval. Shadow usage is the norm rather than the exception in most engineering organizations, and an inventory that assumes policy compliance will understate the problem substantially.
Third, a commit-level marker. Adopt a lightweight convention in commit trailers noting AI assistance, the tool family, and the reviewing engineer. This is not forensic-grade provenance, but it converts an unanswerable question into a searchable one, and it costs developers a few seconds per commit.
Fourth, a dependency rescan. Run software composition analysis across flagged repositories and compare against the pre-adoption baseline. Pay particular attention to packages with no meaningful download history or a publication date that coincides with your assistant rollout - hallucinated dependencies have become a recognized supply chain vector.
Controls That Do Not Stop Delivery
Provenance programs fail when they are framed as restrictions on engineers. The controls that hold are the ones embedded in the path of least resistance.
- Model allowlisting and configuration baselines. Specify approved tools, approved models, and required settings such as public-code filters and telemetry retention. A per-seat subscription is not a configuration standard.
- Prompt hygiene rules. Prohibit pasting proprietary source, customer data, or unreleased architecture into unsanctioned tools. This is a data handling policy, not an AI policy, and should be written as one.
- Named reviewer requirement. Any generated block merged into a protected branch requires an identified human reviewer with domain context. Reviewers who rubber-stamp completions are the control failure mode.
- License family blocklists. Configure automated gates that reject suggestions containing copyleft patterns where incompatible with distribution plans.
- Package admission control. Reject dependencies that are newly published, unmaintained, or inconsistent with the project's declared stack unless explicitly approved.
None of these add a meaningful step to a developer's day. All of them produce records the organization did not previously have.
What Legal and Security Need Before the Review
When the question does reach counsel and the security team, the useful briefings are specific. Legal will want to know whether any output resembles material registered with the U.S. Copyright Office, whether vendor indemnification applies and under what conditions, and whether the organization's own distribution obligations have been triggered. Most assistant vendors now offer intellectual property indemnities, but those indemnities typically carry conditions - filters enabled, approved models used, usage policies followed - and the conditions are where disputes live.
Security should be briefed separately on the pattern risks: generated code that reproduces well-known vulnerability classes, authentication logic that appears plausible but omits validation, and dependency suggestions that broaden the attack surface without appearing in a design review. A model trained on public code has learned public mistakes as thoroughly as public solutions.
A Ninety-Day Sequence
Days one through thirty: complete the census and tooling map, and publish the raw numbers to engineering leadership without editorial softening. Days thirty-one through sixty: deploy commit trailers, configure the approval gates, and run the dependency rescan. Days sixty-one through ninety: tabletop the review with legal and security using real repositories rather than hypotheticals, and document the residual gaps the organization has chosen to accept.
The objective is not a clean provenance record. Very few enterprises will achieve one, and the ones claiming to have done so usually have not looked closely. The objective is a factual record sufficient to answer the question when it is asked, in the language of the business rather than the language of the tool vendor.