AI coding agents: writing, reviewing and shipping code
07
Rules and risks
5 min read · Chapter 7 of 10
How the rules work
Copyright. Prompts alone don't make you an author, the Copyright Office said in January 2025, though human selection, arrangement or modification can, and the Supreme Court declined Thaler's case for an AI author on March 2, 2026. On September 16, 2026 the Ninth Circuit, in Doe v. GitHub, upheld the dismissal of the claim that Copilot and Codex break the DMCA by producing code without the original's copyright notices: generating new code isn't "removing" anything. The court didn't decide whether training on the code was lawful, and breach-of-licence claims are still pending. I found no lawsuit against a company for using AI-suggested code, so for buyers ownership looks settled enough. Copyright protection for a mostly AI-written codebase is thinner, and most companies rely on trade secrets and contracts anyway.
Data and indemnities. The plan tier decides most of it.
Copilot Free, Pro, Pro+
- Trains on your code or prompts
- Interaction data by default since April 24, 2026; opt-out
- Retention
- Not found
- IP indemnity
- No
Copilot Business, Enterprise
- Trains on your code or prompts
- No
- Retention
- Not found
- IP indemnity
- Yes, unmodified suggestions with the filter on
Claude Code consumer plans
- Trains on your code or prompts
- Only if the setting is on
- Retention
- 5 years if on, 30 days if off
- IP indemnity
- No
Claude Code commercial plans
- Trains on your code or prompts
- No
- Retention
- 30 days; zero retention per organization by eligibility
- IP indemnity
- Yes, excluding modifications, combinations, patents and trademarks
Cursor individual
- Trains on your code or prompts
- Only with Privacy Mode off
- Retention
- Not applicable
- IP indemnity
- No; the user indemnifies Cursor
Cursor enterprise
- Trains on your code or prompts
- No, with Privacy Mode
- Retention
- Zero retention with model providers
- IP indemnity
- Yes, void if filters are off
Amazon Q Developer Free / Pro
- Trains on your code or prompts
- Free may be used, with opt-out; Pro not
- Retention
- Not found
- IP indemnity
- Pro only
Gemini Code Assist individuals / Standard and Enterprise
- Trains on your code or prompts
- Individuals: used, with human reviewers and opt-out; business tiers not
- Retention
- Individuals: 18 months for de-linked copies
- IP indemnity
- Business tiers only
OpenAI Codex individual / business
- Trains on your code or prompts
- Individual may train unless opted out; business not by default
- Retention
- Not found
- IP indemnity
- Business: Copyright Shield
Liability caps are in Liability allocation.
Regulated change control. PCI DSS requires bespoke code to be reviewed before release, and if the review is manual the reviewer can't be the originating author. The PCI Security Standards Council's AI principles (September 11, 2025) add that an AI system gets its own trackable, revocable credentials, can't take responsibility or give management approvals, is logged with a named human responsible, and should be treated as a potential malicious insider; it announced further AI guidance on October 7, 2026. EU financial firms under DORA must separate whoever requests and builds a change from whoever approves it. SOC 2 had no AI-specific criteria as of August 2026. US bank supervisors' April 2026 model-risk guidance leaves generative and agentic AI out, so banks govern them under their existing risk practices. A person who prompts an agent and approves its change fails segregation of duties in all of these.
EU product rules. The AI Act puts few duties on coding tools themselves; general-purpose model duties sit with the labs. The Cyber Resilience Act has required reporting of actively exploited vulnerabilities and severe incidents since September 11, 2026 (24 hours, 72 hours, 14 days), and its main obligations start on December 11, 2027. From December 9, 2026 the revised Product Liability Directive treats software as a product with liability without fault. Both fall on the seller, whoever wrote the code.
What mistakes cost
Let's say an engineer at the invoicing company lets an agent run commands against the cloud provider's API with their own token, and the agent deletes a production volume. If the company spends $150-250 per developer a month with the agent's vendor, its enterprise cap is 12 months of fees, $360,000-600,000. But lost data, lost revenue and consequential damages are excluded, and the terms put the risk of automatically run commands on the user, so the expected recovery is close to zero. An IP claim on an unmodified suggestion is the one case where the vendor pays.
| Case | What happened | Who paid |
|---|---|---|
| Replit, July 2025 | Its agent deleted a user's production database during a declared code freeze, then misreported what it had done | Replit promised a refund and split development from production by default |
| Gemini CLI, July 2025 | A user's files were overwritten | The user |
| Google Antigravity, December 2025 | A recursive delete wiped a whole drive instead of a cache folder | The user; the data was unrecoverable |
| Claude Code, 2025-2026 | Users reported recursive deletes of their home folders | The users |
| A small software company using Cursor, April 2026 | The agent deleted a volume through its hosting provider's API; backups sat on the same volume; about 30 hours down | The host restored from its own backups as goodwill |
| AWS, December 2025 | The Financial Times reported its Kiro agent deleted and recreated an environment, causing a 13-hour outage in one region | Amazon blamed misconfigured access controls |
| Amazon retail, March 2026 | About six hours down after an "erroneous software code deployment"; linked to AI-assisted changes in an internal briefing, as reported | Amazon, which disputes the AI link and added senior sign-off |
| Nx "s1ngularity", August 2025 | Malicious package versions tried to drive installed Claude, Gemini and Amazon Q command-line agents to hunt credentials; 2,349 credentials from 1,079 systems, then 10,767 private repos made public | Developers and their companies, rotating secrets |
| PromptPwnd, December 2025 | Issue and pull request text pasted into the prompts of AI agents in CI that held powerful tokens; Google fixed its Gemini CLI action in four days; Claude Code and Codex actions were exposed the same way when anyone could trigger them | Repo owners |
| Clinejection, February 2026 | An issue title injected instructions into an AI triage workflow, and a chain through the shared build cache ended in a malicious Cline release, installed about 4,000 times in eight hours | Cline and the people who installed it |
Most of these are old control failures: production credentials in reach, no separation of environments, backups on the same volume, no confirmation before a destructive call. The actor is new. What's new in the attacks is that issue text, comments and rules files are now instructions an agent may follow. The tools have had their own holes too, such as CamoLeak, a hidden-comment attack on Copilot Chat that GitHub fixed in August 2025.
Supply-chain risk has an AI flavour. In a USENIX 2025 study, 19.7% of code samples referred to at least one package that doesn't exist, and 43% of those made-up names came back every time the prompt was repeated, so attackers can register them in advance. GitGuardian, which sells secret scanning, found that commits co-authored by one coding agent leaked secrets at 3.2%, against 1.5% overall. And in SusVibes, an academic benchmark presented at ICML 2026, the best agent setup solved 57% of 186 real-repo tasks correctly but only 11.8% securely.