AI coding agents: writing, reviewing and shipping code
04
Key concepts
8 min read · Chapter 4 of 10
01
Entity and identity
What is the unit of record, and how do we know it is the same one?
An agent's change has three possible actors: the developer who asked, the agent's own app identity, and whoever set up the automation that started it. GitHub records its agent as the commit author, with the requester as co-author and a link to the session log; an automation's pull request is credited to whoever created the automation. Locally, agents mostly run as the developer, with the developer's tokens, so the audit log can't tell "the developer typed it" from "the agent did it with the developer's token". Payment-card rules now ask for the agent to have its own credentials (see How the rules work).
The law adds an author. Under US copyright only a human can be one: the US Copyright Office said in January 2025 that prompts alone don't make you an author, and the Supreme Court declined to hear Thaler's appeal on March 2, 2026. The Linux kernel lets agents add an "Assisted-by:" tag and forbids them from signing off a change, so a human stays responsible.
A plan tier is an identity too. The same tool trains on your code or not depending on the account: GitHub Copilot's Free, Pro and Pro+ plans have used interaction data for training by default since April 24, 2026 unless the user opts out, while Business and Enterprise are excluded. A developer signing in with a personal account on company code is the classic leak.
02
State and lifecycle
What states exist, and what moves an entity between them?
Several state machines run at once.
- Task: queued, running, waiting for input, pull request open, changes requested, merged or abandoned. On GitHub, moving a draft to "ready for review" is a human step the agent can't take.
- Pull request: opened, CI running, reviewed, merged or closed. Agent pull requests stall waiting for review and get abandoned, so I'd count abandoned ones as waste.
- Session: capped by the clock (59 minutes on Copilot), which forces work that can resume.
- Billing: trial, active, paused at a limit, overage on, downgraded. When GitHub credits run out and overage is off, Copilot pauses until the next cycle. Anthropic's and OpenAI's individual plans add rolling five-hour and weekly windows on top.
03
System of record and ledger
Who owns the truth, and how do systems reconcile?
| Fact | System of record |
|---|---|
| What changed, who approved it, which checks passed | The repo host: commits, pull requests, reviews, checks |
| What the agent did and why | The session log: in the vendor's cloud (Copilot links each commit to one) or on the laptop (Claude Code keeps plaintext transcripts for 30 days by default) |
| What it cost | The invoice, the vendor's usage dashboard and your own telemetry, which rarely agree |
| Usage billed through a cloud (Bedrock, Vertex, Foundry) | The cloud bill; the agent vendor's analytics don't see it |
Git history and pull request records are what auditors test for change management. The session log is another ledger, one that may hold code and secrets, so who keeps it and for how long matters for audits and retention. Cursor's Origin is an agent vendor trying to own the main ledger itself.
04
Rules and policy
What logic decides outcomes, and who can change it?
An agent's rules live in three places, and only two of them enforce anything.
| Layer | Examples | Enforced by |
|---|---|---|
| Instruction files | AGENTS.md, CLAUDE.md, Cursor rules, Bugbot's own file | The model's reading of them, so advisory |
| Harness permissions | Permission modes, allowlists, firewalls, sandboxes, tool lists per automation | Code in the agent product |
| Repo-host policy | Branch protection, rulesets, required checks, code owners | The system of record |
Cursor's Bugbot reads its configuration from the base branch, so a pull request can't change how Bugbot reviews it. That's the pattern I'd copy for any gate: keep it out of reach of the change under review.
Company policy sits above them: approved tools and plan tiers, which data may enter a prompt, dependency rules, reviewer independence, the line between prototype and production, and spending limits (GitHub sets budgets down to the user; Kiro keeps overage off by default for enterprises).
05
Effective dating
Which version of the rule applied at that moment?
Dates I'd keep on a calendar as of October 2026:
| Change | Effective | Status (Oct 2026) |
|---|---|---|
| npm revokes all classic publishing tokens | December 9, 2025 | In force |
| Codex moves to token-based credits | April 2, 2026 (all Enterprise from April 23) | In force |
| Copilot individual plans train on interaction data by default | April 24, 2026 | In force, opt-out |
| Amazon Q Developer closes to new signups | May 15, 2026 | In force |
| Copilot AI Credits replace premium requests | June 1, 2026 | In force; annual plans keep the old model until renewal |
| EU Cyber Resilience Act vulnerability and incident reporting | September 11, 2026 | In force |
| Ninth Circuit rejects the DMCA output claim in Doe v. GitHub | September 16, 2026 | Licence claims still pending |
| GPT-5.5 retires from Codex | October 14, 2026 | Upcoming |
| OpenAI's models leave Cursor (as reported) | November 12, 2026 | Upcoming |
| EU Product Liability Directive covers software | December 9, 2026 | Upcoming |
| Amazon Q Developer IDE plugins lose support | April 30, 2027 | Upcoming |
| EU Cyber Resilience Act main obligations | December 11, 2027 | Upcoming |
Configuration is dated too: Cursor's cloud agents get their secrets at start, and an MCP tool definition can change after you approved it. And promotions end on dates that users read as price rises: GitHub's extra credits stopped on September 1, 2026.
06
Interfaces and standards
What format and protocol do counterparties speak?
Git and the pull request are the universal hand-off, and GitHub Actions is the closest thing to a standard CI interface (Cursor's Origin runs Actions workflows). AGENTS.md, a plain file of instructions for agents stewarded by the Agentic AI Foundation under the Linux Foundation, says more than 60,000 open-source projects use it, and Codex, Jules, Gemini CLI, Copilot, Cursor and Devin all read it; Claude Code reads its own CLAUDE.md, and AGENTS.md if present. MCP, the protocol agents use to reach tools, is covered in AI agents: orchestration platforms.
| Need | What exists (Oct 2026) | Gap |
|---|---|---|
| Marking AI-written changes | "Assisted-by:" (Linux kernel), "Co-authored-by:" trailers (vendor practice) | No cross-vendor standard |
| Production context for agents | OpenTelemetry traces (Bluebox is built on it), MCP servers from Sentry and others | Each observability vendor claims the loop |
| Supply chain | Trusted publishing with OIDC (short-lived tokens instead of stored ones), SLSA provenance, SBOMs, minimum release age in package managers | Agents pick dependencies faster than people check them |
07
Networks and counterparties
Who sits between us and the outcome, and what do they want?
| Party | What they control | What they earn |
|---|---|---|
| Agent vendor | The harness, the routing, the session log | Seats, credits, a margin on tokens |
| Model lab | Quality, prices, rate limits, retirements, supply | Tokens, subscriptions, its own agent |
| Repo host and CI | The pull request, approvals, required checks | Seats, CI minutes, security add-ons |
| Package registries | Which code can be installed | Usually nothing directly |
| Review and security vendors | Comments, checks, findings | Per developer or pull request author |
| Observability vendors | What to fix next | Ingest and seats |
| Cloud | Compute, marketplace billing, its own IDE | Resold tokens, commitments drawn down |
One company can sit in many of these roles. Microsoft owns GitHub, Copilot, Advanced Security, npm and Azure, writes the indemnity, trains its own coding model and offers both OpenAI's and Anthropic's models in Copilot. Google sells Gemini Code Assist, Antigravity and Jules, and owns Wiz and Mandiant. Amazon sells Kiro, runs AWS and invests in Anthropic. Every scanner or bot in CI is also one more token holder: a poisoned scanner, Trivy, became the way into other companies' pipelines in March 2026 (see Cloud security (CNAPP)).
08
Regulatory layering
Jurisdiction × activity × entity type: is it a license or a certification?
Agents leave the change-management rules as they were and change who counts as the author.
| Layer | US | EU and elsewhere |
|---|---|---|
| Change control | PCI DSS 6.2.3 and 6.2.3.1 for card systems (contractual, through the card brands); SOC 2 CC8.1 (an attestation) | EU DORA's technical standard on ICT change management, Article 17, for financial firms |
| Banking supervision | OCC Bulletin 2026-13 (April 2026) on model risk excludes generative and agentic AI | Singapore's MAS draft AI guidelines cover autonomous agents |
| Product security | No general rule | Cyber Resilience Act reporting since September 11, 2026; Product Liability Directive from December 9, 2026 |
| AI law | State laws mostly about consequential decisions, not code | AI Act: no high-risk duties for coding tools by default; general-purpose model duties sit with the labs |
For a regulated platform the answer is the same in both places: the reviewer and the approver must be people other than the author, the change record has to show who did what, and the manufacturer answers for the product whoever wrote the code.
09
Exceptions and reversals
What goes wrong, and how is it undone?
Bad change merged
- Who starts it
- The team, after an alert
- Clock
- Minutes to days
- The way back
- Git revert; feature flag off
Data deleted by an agent
- Who starts it
- The agent, with real credentials
- Clock
- Immediate
- The way back
- Backups outside the blast radius, if they exist
Secret leaked in a commit
- Who starts it
- The agent or the developer
- Clock
- Immediate
- The way back
- Rotate it; history keeps it
Malicious package published
- Who starts it
- An attacker with a stolen token
- Clock
- Hours
- The way back
- Deprecate the version; downstream lockfiles keep it until changed
Model supply cut
- Who starts it
- The lab
- Clock
- Under a week (Windsurf, 2025) to about 75 days (Cursor, as reported)
- The way back
- Another model, or your own key with the lab (Windsurf's users kept Claude that way)
Price or limit change
- Who starts it
- The vendor
- Clock
- Weeks; promotions just end
- The way back
- Caps, routing, another vendor
Training default changed by a policy update
- Who starts it
- The vendor
- Clock
- The policy's start date
- The way back
- Opt out again; data already used can't be taken back out of a model, as far as I know
10
Liability allocation
When it fails, who pays?
| Failure | Who absorbs it | Mechanism |
|---|---|---|
| Copyright claim on an unmodified suggestion, on a paid plan with the filter on | The vendor | IP indemnity, usually outside the liability cap |
| Copyright claim on modified or combined code, or a patent claim | The customer | Indemnity exclusions |
| Agent deletes data or breaks production | The customer | Caps of about 12 months of fees; lost data and consequential damages excluded |
| Secret leaked from an agent's commit | The customer | No vendor term found |
| Runaway usage bill | The customer on usage pricing | Overage on by default unless an admin turns it off |
| Model withdrawn mid-contract | The app vendor, then its customers | Change-of-control clauses; no indemnity found |
Vendor terms push the operational risk down. Cursor's individual terms make the user "solely responsible" for suggestions it runs automatically and cap its liability at the greater of six months' fees or $100; its enterprise agreement, Anthropic's commercial terms and AWS's customer agreement cap at 12 months of fees, with IP indemnities outside the cap. GitHub's indemnity covers unmodified suggestions with the public-code filter on, and almost no shipped code is unmodified, so it covers the snippet more than the product.
When an agent did real damage, the platforms paid in goodwill: Replit promised a refund and added a default split between development and production databases. Insurers are moving the other way, with generative-AI exclusions entering general liability forms in 2026 (more in AI agents: orchestration platforms).