Learn/Governance · 6 min · updated 2026-08-03

Code provenance: tracing a line back to the session that wrote it

git blame names the person who ran the agent. Provenance for agent-written code needs the session, the model, the instruction and the reasoning, attached to the change and surviving refactors.

Provenance is the ability to take a line of code and recover how it came to exist. With human-written code, git blame plus a pull request is usually enough. With agent-written code the blame line names whoever ran the agent, the commit message was written by the model, and the conversation that contains the reasoning is gone.

What has to be captured

  • The session: one identifier covering the run that produced the change.
  • The agent and model, with version.
  • The instruction: the goal the session was given, in the words it was given.
  • The intent: what the session said it did, recorded before the commit.
  • The human: who ran it, and who reviewed it.

Capturing it is the easy half. The hard half is keeping it attached when the code moves.

Why line numbers lose it

Attach provenance to a line and it survives until someone reformats the file. Attach it to a symbol, keyed by the structural identity of the function rather than its position, and it survives moves, renames and reformatting, because the identity comes from a content hash of the node rather than from a location. That is the difference between provenance that decays over a quarter and provenance that lasts.

Two things people confuse

AttributionProvenance
QuestionWho or what wrote this?How did this come to exist?
AnswerA nameA chain: instruction, session, change, review
UseCredit and accountabilityUnderstanding and audit

Attribution alone tends to produce arguments about whether a commit trailer should name a model. Provenance answers the question people actually have six months later, which is why the code is like that.

In practice

Aura records the session, agent, goal and intent with each change, keyed by symbol, so selecting a function in the app shows the session that produced it and the reasoning behind it. The record is stored in the repository, so it clones with the code rather than living in a service you might stop paying for.

See also: making the record tamper-evident and checking the intent against the change.

Questions

What is code provenance?

The record of where a piece of code came from: which session produced it, on what instruction, under which model, and what it was checked against. For human code the author is usually enough. For agent code the author is the person who pressed enter.

How do you tell which AI agent wrote a line of code?

git blame gives you the person who committed it, which for agent work is whoever ran the session. Attributing it to the agent means recording session identity at commit time — nothing recoverable afterwards will tell you.

Why is git blame not enough for AI-generated code?

It answers who committed, not who wrote or why. One developer running four agents produces four sets of changes under one name, from four different instructions, with different amounts of review. Blame flattens all of that into a single identity.

What does provenance let you do that history does not?

Answer questions after the fact without archaeology: which changes came from unattended sessions, what instruction produced this function, which model wrote the part that broke. Those are ordinary compliance questions and history has no field for any of them.