Line-level provenance
also: line-level attribution · per-line provenance
Line-level provenance is a record of the origin of each individual line of code — which author, AI agent, model, and prompt produced it. Unlike commit-level history, it resolves authorship at the granularity of a single line, so a mixed human-and-AI file can be attributed line by line.
Why line-level provenance matters now
When a human wrote every line, commit-level history was enough — git blame pointed to a person who could explain their reasoning. AI coding agents broke that assumption. A single commit can mix lines written by a developer, by Claude Code, by Cursor, and by Copilot, all under one human committer. Commit-level attribution collapses that mixture into one name and loses the detail that matters during review and audit.
As AI authorship rises, teams increasingly need to answer a finer question than "who committed this?" — they need "which agent wrote this specific line, with what context, and was that recorded?" Line-level provenance is the data structure that answers it.
Line-level provenance vs. git blame
git blame attributes each line to the last commit that touched it, and therefore to the human or bot identity on that commit. It cannot tell you that a line was generated by an AI agent, which model produced it, or what prompt and context drove it. Line-level provenance adds that layer: it preserves the agent, model, and intent behind each line alongside the normal git history.
- git blame answers: which commit and committer last changed this line.
- Line-level provenance answers: which agent or human originally authored this line, with which model, under what prompt and context.
- The two are complementary — provenance sits next to blame, it does not replace it.
How line-level provenance is captured
AgentDiff captures provenance at the moment of authorship. Each supported agent fires a hook when it edits a file; AgentDiff records the agent, model, and the line ranges it changed to a local session log. On commit, it reconciles that session against the actual diff using line-range overlap, signs the resulting record with an ed25519 key your organization controls, and appends it to a git ref beside your code.
$ git commit -m 'feat: add billing webhook'→ claude-code → apps/github-app/src/billing.ts (+88 -12)→ cursor → scripts/prepare-ledger.py (+38 -4)✓ signed · appended to refs/agentdiff/meta
Because the record lives in git rather than a vendor database, provenance travels with the repository across remotes, forks, and exports — and no source code leaves your infrastructure.
Frequently asked questions
What is the difference between line-level provenance and code provenance?+
Code provenance is the general concept of recording where code came from. Line-level provenance is the most granular form of it — resolving origin per line rather than per file or per commit, which is necessary when a single file mixes human and multiple AI authors.
Can you get line-level provenance from git alone?+
No. git records commits and committers, so git blame can only attribute a line to the last commit that touched it. It has no concept of which AI agent generated a line. Line-level provenance requires capturing the agent and model at authorship time and storing it alongside git history.
Does line-level provenance expose my source code?+
It does not have to. AgentDiff records only metadata — agent, model, file paths, and line ranges — signed and stored in your own git remote. No file contents or full prompts are transmitted.
See line-level provenance on a real repo.
AgentDiff records which agent wrote which line, signs it, and keeps it in your git history. Open the live dashboard or book a walkthrough.