How to work with AI coding agents
Practices for building software with AI coding agents, each backed by evidence. Trials are ideas worth testing that the evidence doesn't back yet.
By topic
Specification
Why
- Tests written by people make agent code correct more often.
- Agents follow context-file rules, and every rule adds cost.
Adopt Proven. Use it by default.
Avoid Shown to fail or cost more for no gain.
Testing
Why
- Agents told to work test-first skip the failing test or write tests that can't fail.
- Tests from the same source as the code pass wrong code.
Adopt Proven. Use it by default.
Avoid Shown to fail or cost more for no gain.
Looping
Why
- Passing tests don't make an agent's change ready to merge.
- Long-running agent loops break work that was already finished.
Adopt Proven. Use it by default.
Avoid Shown to fail or cost more for no gain.
Reviewing
Why
- Agents produce changes faster than teams can review and release them.
- Review time and incidents rise as AI use grows.
Adopt Proven. Use it by default.
Avoid Shown to fail or cost more for no gain.
Delivery
Why
- Small batches help, and delivery gets less stable as AI use grows.
- AI produces more software, not more value.
Adopt Proven. Use it by default.
Avoid Shown to fail or cost more for no gain.
Security
Why
- An agent with private data, untrusted input and a way to send data out gets exploited.
- People using AI write less secure code and trust it more.
Adopt Proven. Use it by default.
- Enforce access and approvals outside the model
- Remove one leg of the lethal trifecta
- Verify a package's publisher and registration date
- Give security-sensitive changes a human review
- Keep people hands-on
- Grant agents the fewest tools and the minimum scopes
- Deny secrets to agents and force the sandbox
- Allowlist MCP servers and enforce access at the tool layer
- Enforce scope on every read path of shared agent memory
- Inventory, sign and pin models and packages
- Treat agent output as untrusted input
- Partition retrieval stores and make retrieval permission-aware
- Set rate limits, quotas, timeouts and iteration caps
- Sign a data processing agreement before tools see company data
Measuring
Why
- People feel faster with AI even when timing shows them slower.
- Activity numbers like PR counts rise while delivery outcomes fall.
Adopt Proven. Use it by default.
Avoid Shown to fail or cost more for no gain.
Understanding
Why
- Nobody can be accountable for code they don't understand.
- Shared agent memory leaks, goes stale and hides contradictions.
Adopt Proven. Use it by default.
Avoid Shown to fail or cost more for no gain.
Teamwork
Why
- Juniors ask the model instead of colleagues, so the know-how people pass on by working together thins out.
- Review load lands on a few senior engineers as agent PRs multiply.
Adopt Proven. Use it by default.
Avoid Shown to fail or cost more for no gain.