You Can Finally Pin the Blame on AI-Written Code: Key Takeaways from the Agent Trace Spec
Contents
Agent Trace is an open-source spec that turns "who / which AI wrote this code" into structured data you can record and query. This post covers the spec's goals, contributor types, and Trace Record structure. It's worth a look for developers and for teams that care about traceability and compliance, since it'll make future code reviews and audits easier. The spec is open and tool-agnostic; if tools like Cursor and Claude Code all support writing to it, it'll be a big help for audits.
As more and more code gets written by agents like Cursor and Claude Code, one question is going to matter more and more: Was this code written by a human or by AI? And which model was used?
Agent Trace, an open protocol recently published by Cursor, was built for exactly this. It's an open spec (currently at the RFC stage) whose goal is to let "AI contributions" be recorded in version control just like human authors.
What Is Agent Trace?
Agent Trace is an open-source spec for tracking "who wrote this code," especially attribution between AI and human contributions.
The spec defines a tool-agnostic format so that any compatible tool can read and write this attribution data.
Why Do We Need Agent Trace?
The motivation is simple: agents are writing more and more code, and people need to know which parts are AI-generated and which were written by humans. And it's not just about knowing "was it AI or not"; you also want to be able to link back to the model used, and even the conversation behind it.
Agent Trace defines the format for "attribution data." Any spec-compliant tool can read and write it, so you're not locked into a single vendor.
What the Spec Aims to Achieve
- Interoperability: Any compatible tool can read and write attribution data
- Granularity: Supports attribution down to the "file" and "line" level
- Extensibility: Vendors can add their own metadata without breaking compatibility
- Readable by both humans and agents: You can understand it without special tools
What It Deliberately Leaves Out
Agent Trace doesn't deal with code "ownership" or copyright. It doesn't track training data sources, doesn't judge whether AI output is good or bad, and doesn't dictate what UI to use. It's purely a data format and a concept.
Contributor Types
Every code change can be tagged with its source:
| Type | Description |
|---|---|
human | Written by a human |
ai | Generated by AI |
mixed | A human edited AI output, or AI edited human code |
unknown | Can't be determined |
You can also include a model_id (for example anthropic/claude-opus-4-5-20251101), following the naming conventions of models.dev.
What Does a Trace Record Look Like?
A trace includes: version, ID, timestamp, version control info (git / jj / hg / svn), tool name and version, and a "file list."
Under each file there's a list of "conversations," and each conversation has:
- URL: Links back to the conversation that produced this code
- Contributor type
- Line range:
start_line,end_line
When needed, you can also add a content_hash, so the same contribution can still be matched up even after the code gets moved around.
Conclusion
Agent Trace turns "who / which AI wrote this code" into structured data you can record and query, and the format is open and tool-agnostic. For teams that care about traceability and compliance, it's worth getting familiar with now.
- Spec: https://agent-trace.dev/
- License: CC BY 4.0
If tools like Cursor and Claude Code all end up supporting writing Agent Trace data, you'll be able to see "who changed this part and which model they used" right during code review or compliance audits. That'll be a big help for team collaboration and auditing.
References
Keywords
Agent Trace, AI code attribution, Cursor, Claude Code, open-source spec, RFC, code tracing, structured data, version control, dev collaboration
Latest articles
CoinMarketCap Launches AI Agent Skills: Let Claude Code Check Crypto Prices, Generate Reports, and Do Research Directly
2026-03-04Claude Code v2.1.59 ~ v2.1.63 Update Roundup: HTTP Hooks, a Big Memory Cleanup, and Shared Worktree Settings
2026-03-04Claude Code v2.1.52 ~ v2.1.59 Update Roundup: Auto Memory, a Wider Remote Control Rollout, and Stability Fixes
2026-02-26[Caijing Haojiao Podcast Notes] 2026-02-24 Software Stock Crash! Why Are There More and More AI Victim Stocks?
2026-02-24AMD and Meta Sign a 6GW GPU Megadeal: Breaking Down the $60 Billion AI Chip Agreement
2026-02-24