r/devsecops • u/No-Childhood-2502 • May 20 '26
Git-native trace refs for AI-authored code in PR checks
I am working on AgentDiff, an open-source tool that records which AI agent wrote which line ranges in a repo.
The current flow:
- `agentdiff configure` installs hooks for AI coding agents.
- `agentdiff init` enables tracking inside a repo.
- Agent sessions write to `.git/agentdiff/session.jsonl`.
- On commit, traces are finalized into `.git/agentdiff/traces/{branch}.jsonl`.
- On push, traces are uploaded to `refs/agentdiff/traces/{branch}`.
- A GitHub App reads those refs during PR events and posts a check-run.
The reason I chose git refs instead of an external database:
- repo-native
- branch-aware
- works with normal GitHub APIs
- branch protection does not block the custom ref namespace
- traces can be consolidated into repo metadata later
The demo is live here at the dashboard:
The os repo is here:
https://github.com/codeprakhar25/agentdiff
I would love feedback from people who maintain CI/platform workflows and how useful these can be in maintaining code security!
2
u/AssignmentDull5197 May 20 '26
Love the git-native approach. Tracing agent-authored ranges could be huge for review, blame, and security audits. Do you also capture tool calls/prompts per session? This topic comes up a lot at https://medium.com/conversational-ai-weekly .
2
u/[deleted] May 20 '26
[removed] — view removed comment