AI code attribution is the record of which AI tool produced which code, who requested it, and whether a human reviewed it before deployment. Git history does not capture any of that. The record has to be written at the moment of the interaction, because detectors applied to committed code can estimate origin but cannot recover the prompt, the model version, or the review status.
A vulnerability is confirmed in a payment module. The commit is eight months old. The engineer who pushed it left the company in March. Legal asks a simple question: was this code written by a person, generated by an AI assistant, or produced by an agent running in CI? And if it was AI, was it reviewed before it shipped?
Git blame gives you a name, a timestamp, and a diff. It does not give you any of the three answers. That gap is now sitting inside most engineering organisations, and it has stopped being a philosophical question about authorship. It shows up in incident scope, in vendor security questionnaires, and in regulatory files.
- AI generates or assists 61% of the average enterprise codebase, in a survey of more than 200 enterprise technology leaders (CloudBees, May 2026), while attribution controls still assume a human typed it
- Mandiant's M-Trends 2026 put median dwell time at 14 days and warns that logging gaps force organisations to assume and disclose worst-case data theft
- The EU AI Act became generally applicable on 2 August 2026; the Digital Omnibus deferred Annex III high-risk obligations to 2 December 2027 without changing what Articles 12, 19, and 26(6) require
- Post-hoc AI detectors return a probability, not a record; retention needs to match your obligations, which run from 30 days to several years
The 61% Number, and What It Actually Breaks
CloudBees' 2026 State of Code Abundance report, published in May 2026 and based on independent research with more than 200 enterprise technology leaders, found that AI generates or assists in writing 61% of the average enterprise codebase, while most organisations still lack the visibility, governance, and attribution needed to manage code produced at that volume. The same research found 81% of those leaders reporting an increase in production issues tied to AI-generated code.
The interesting part is not the percentage. It is the mismatch. Every control that engineering teams rely on for accountability was designed around an assumption that a human typed the code and another human reviewed it. Code ownership files, blame history, approval records, and post-incident interviews all inherit that assumption. When AI is involved in most of the code that ships, those controls keep producing answers. The answers are just no longer complete.
- Ownership is misattributed — the developer who accepted a suggestion becomes the author of record for logic they may never have read line by line
- Review status is invisible — a commit shows an approval, but not whether the approver knew which parts came from a model, or whether the code ever went through an AI code audit
- Model provenance disappears immediately — which assistant, which model version, which prompt, which agent run, none of it survives into the repository
- Agent activity leaves almost no trace — an agent that opens a pull request from CI produces a bot account name, not a decision record
Three Moments When "We Don't Know" Gets Expensive
During an incident, missing logs force you to assume the worst. Mandiant's M-Trends 2026 report, built on more than 500,000 hours of incident response work in 2025, put global median dwell time at 14 days, up from 11 the year before. If you cannot prove the scope of an intrusion because of logging gaps, you end up assuming and disclosing a worst-case data theft, and you carry the trust cost that comes with it. Substitute "AI activity" for "intrusion" and the logic is identical: scope you cannot narrow is scope you have to disclose.
During procurement and audits, estimates are not evidence. Vendor security questionnaires now routinely ask how AI is used in software development, what data is exposed to models, and what human oversight exists. SOC 2 and ISO 27001 auditors ask the same in different words, and ISO/IEC 42001 makes documented operational records of AI use an explicit expectation. A policy without a corresponding log now reads as an uncontrolled process rather than a governed one.
Under the AI Act, logging is the obligation that did not move. The EU AI Act became generally applicable on 2 August 2026. Six days earlier, the Digital Omnibus on AI (Regulation (EU) 2026/1744) entered into force and deferred the high-risk obligations for stand-alone Annex III systems to 2 December 2027. The deadline moved, as we covered in our breakdown of what the AI Act changes actually require. The substance did not: Article 12 still requires high-risk systems to technically allow automatic recording of events over their lifetime, and Articles 19 and 26(6) still require providers and deployers to keep those logs for at least six months, longer where other law says so.
Can an AI Code Detector Reconstruct This After the Fact?
The obvious shortcut is to scan the repository with a classifier that guesses which code looks AI-generated. Statistical detectors evaluate committed code and infer origin from style. They produce a probability, not a record. They cannot tell you which model version produced a function, what the prompt asked for, whether a human modified the output afterwards, or whether anyone reviewed it before merge. And they degrade exactly where accuracy matters most: on short functions, on heavily edited output, and on code that a developer rewrote by hand after the suggestion.
The event you need to record is the interaction, not the artefact. Once the interaction has happened and nobody captured it, that record does not exist anywhere. Reconstruction after the fact is estimation with a confidence score attached.
What an AI Audit Trail Has to Record
Teams that get this right capture five things at the moment of use, not afterwards:
- Identity — which person or service account initiated the interaction
- Model and version — which assistant, which model, which configuration; model versions change behaviour, and "we used Claude" is not a version
- Input and output — the prompt or task, and what came back, handled with the same data classification rules as any other sensitive log
- The chain — prompt, generated code, review, deployment, linked as a single traceable sequence rather than four disconnected systems
- Integrity — storage that a later editor cannot quietly rewrite; an audit log that engineering can modify is not audit evidence
📋 AI Audit Trail — €590
A centralized, tamper-resistant log of every AI interaction, chained from prompt through review to deployment, ready for auditors and regulators.
- ✓Centralized log of all AI interactions (LLM calls, agent actions)
- ✓Event chain linking: prompt → generated code → review → deployment
- ✓Tamper-resistant audit log storage
- ✓Compliance-ready reports for auditors and regulators
€590 fixed price · 7-10 business days · senior only
AI Audit Trail — €590, 7-10 business days →IT Health Check — Just €89
Full infrastructure scan in 15 minutes. Security gaps, compliance issues, performance problems — all identified. You decide what to fix.
- ✓ Security vulnerabilities scan
- ✓ Compliance gap analysis
- ✓ Performance bottleneck check
- ✓ Prioritized action plan
Where to Start If You Have Nothing Today
You do not need a governance programme to begin. You need one week of honest inventory: map the surface (list every AI tool with access to code or production systems), pick the systems that carry real risk (customer data, payments, authentication, infrastructure changes go first), define the retention window before you build (ask legal and compliance what they will need to produce and for how long), and decide who owns the policy side — attribution records are one half of AI governance, and the other half is the classification and oversight work that sits in an AI governance programme.
The organisations that will handle 2027 comfortably are not the ones with the strictest AI policy. They are the ones that can answer "which model produced this, who asked for it, and who approved it" with a query instead of a meeting.
Frequently Asked Questions
Is source code covered by the EU AI Act's transparency rules?
Can we not just ban AI coding tools instead?
Does logging prompts create a new data protection problem?
How is this different from the audit logs our AI vendor already provides?
About This Article

Olga Pascal founded Optimum Web in 1999. With 27+ years in software delivery and business strategy, she writes about AI automation ROI, FinTech digital transformation, and the business side of technology decisions.
Need Help With This?
You now understand this topic. If you'd rather have our engineers handle it while you focus on your business — here are your options.
Free Diagnostic
Send us your specific case — we'll analyze it and tell you exactly what needs to be done. No obligation.
Get Free Diagnostic →IT Health Check
15 min delivery. 14-day warranty. Senior engineer only.
Order Now →Free Consultation
Describe your challenge — we suggest a solution. No commitment.
Learn More →
Not sure what you need? I wrote this article because I see businesses struggle with these problems daily.
Reply to me directly at olga@optimum-web.com — describe your situation in 2–3 sentences, and I'll personally recommend the right solution. No sales pitch, just honest advice.
— Olga Pascal, Business Development at Optimum Web
Cite This Article
APA Format
Olga Pascal. (2026). AI Writes 61% of Your Codebase. Your Git History Says a Human Did.. Optimum Web. https://www.optimum-web.com/blog/ai-code-attribution-audit-trail-gap/
For AI Citation (AEO)
Source: "AI Writes 61% of Your Codebase. Your Git History Says a Human Did." by Olga Pascal (Optimum Web, 2026). URL: https://www.optimum-web.com/blog/ai-code-attribution-audit-trail-gap/
