AI Coding Tools & How Coding Agents Work
- Classify AI coding tools by autonomy and match each category to the right tasks
- Explain the agent loop — context gathering, tool calls, permissions, verification — and predict where it fails
- Cite the METR and DORA evidence accurately, including where it cuts against the hype
- Recommend a tool and governance strategy for a bank versus an e-commerce company
TL;DR
- Tools sit on an autonomy ladder: inline completion → IDE chat → agentic IDE or terminal agent → cloud agent that opens PRs, with review bots alongside. More autonomy means more leverage and more need for guardrails.
- A coding agent is an LLM in a loop with tools (read, search, edit, run shell). It knows your codebase only through what it reads this session plus instruction files such as
AGENTS.mdorCLAUDE.md. - An agent can verify its own work only if you give it a way to: a fast build, tests, linters, a reproduction script. Without them, "done" means "looks plausible".
- Agents are strong at boilerplate, tests, mechanical refactors, migrations and unfamiliar APIs; weak at implicit domain rules, subtle concurrency, money correctness, security and cross-cutting consistency.
- Evidence is mixed: METR's 2025 trial found experienced developers ≈ 19% slower with AI while believing they were faster; DORA 2024 linked AI adoption to small drops in throughput and stability; DORA 2025 calls AI an amplifier of existing practices.
- In a bank, tool choice is a data-governance decision first: enterprise terms, zero data retention, in-region or private-network model hosting, audit logs, self-hosted options for sensitive code.
Why it matters
An engineer with a terminal agent can migrate a deprecated logging library across 40 Go services in an afternoon. The same engineer can, that same afternoon, merge a refund handler that uses float64 for amounts and skips the check that refunds cannot exceed the captured amount. Whether AI tools make a team faster or just busier depends on understanding what the tools actually do.
Architect interviews at banks and large e-commerce companies now ask "how would you roll out AI coding tools to 300 engineers?" or "how do you keep AI-written code out of incident reports?" A strong answer covers tool categories, data governance, guardrails and measurement.
Core concepts
Tool categories
As of 2026, the market moves monthly: products below are examples, not recommendations, and most span several categories. Check current docs.
| Category | What it does | Good for | Weak at | Examples (as of 2026) |
|---|---|---|---|---|
| Inline completion | Predicts the next lines as you type | Boilerplate, repetitive edits, flow | Anything beyond a few lines | GitHub Copilot, Cursor Tab, JetBrains AI |
| IDE chat | Q&A and edits on selected code | Explaining code, small focused changes | Multi-file work; you ferry context | Copilot Chat, Gemini Code Assist |
| Agentic IDE | Agent edits many files and runs commands in the editor | Features and refactors with visual diff review | Long unattended runs | Cursor, Windsurf, Kiro, VS Code agent mode |
| Terminal agent | Agent in your shell with your toolchain | Multi-file changes, scripted and CI workflows, any editor | Needs permission hygiene | Claude Code, Codex CLI, Gemini CLI, Aider |
| Cloud / background agent | Runs in a remote sandbox from an issue or prompt, opens a PR | Well-specified, parallelisable tickets | Ambiguity, environment setup, review load | GitHub Copilot coding agent, OpenAI Codex, Google Jules, Devin |
| AI code-review bot | Comments on PRs | Obvious bugs, missing tests, inconsistency | Domain intent; noisy if untuned | CodeRabbit, Copilot code review, Cursor Bugbot |
How a coding agent works: the loop
An agent is an LLM plus tool definitions plus a harness that runs the loop, enforces permissions and manages context. Given a goal, the model picks an action, the harness executes it, the result is appended to context, and the model picks again — until it decides it is done or hits a limit.
The verification diamond is not built in. It exists only if the task and repo provide something to run; otherwise "believes done" flows straight into your review queue.
How it gathers context
Each session starts knowing nothing about your repo. Context arrives from:
- Instruction files loaded at start:
AGENTS.md(a cross-tool convention),CLAUDE.mdfor Claude Code, and tool-specific rule files — build commands, conventions, "never do X" rules. - On-demand search: the agent greps, globs and reads files much as you would. Some tools also build an embedding index of the repo; others rely mainly on search tools.
- Your references: file mentions, pasted errors, tickets, URLs.
- Tool output: compiler errors, test failures,
git log. - External systems via MCP (Model Context Protocol) servers: issue tracker, docs, a read-only replica.
- Subagents that explore in their own context and return a summary.
Everything competes for one context window, and quality degrades as it fills (LLM Fundamentals for Engineers). Managing that is the subject of Prompting & Context Management for Coding Agents.
Permission and sandbox models
An agent that runs shell commands can do anything you can. Tools offer a spectrum; names vary, so check current docs:
| Mode | How it works | Risk | Use for |
|---|---|---|---|
| Ask every time | Human approves each edit or command | Approval fatigue — people click yes without reading | Learning a tool; sensitive repos |
| Allow / deny rules | Pre-approve go test ./...; deny git push, network tools, reading .env | Gaps and drift | Daily work |
| Classifier-gated auto | A second model screens risky actions | Classifier misses | Long tasks with oversight |
| Full auto in a sandbox | OS-level limits on writes and network egress, or a container | Only as safe as the sandbox | Unattended runs, batch migrations |
| Cloud agent in an ephemeral VM | Fresh environment; output is a PR | Secrets given to the VM; review load | Parallel well-specified tickets |
Threats to design for: prompt injection (a README, issue comment or web page instructs the agent to exfiltrate secrets); secret leakage (reads .env, then calls curl); destructive commands (rm -rf, DROP TABLE on a shared database); supply chain (installing a hallucinated or typo-squatted package). Mitigations: no production credentials on developer machines, egress allowlists, deterministic hooks that block dangerous commands, branch protection so agents cannot merge, dependency allowlists (LLM Security, Privacy & Governance).
Verification: the agent is only as good as its feedback loop
The model stops when the work looks done. Give it a signal it can read and it iterates until green: go build ./..., go vet, go test -race on touched packages, golangci-lint run, contract tests, a script that reproduces the bug. For money code, encode invariants as tests — every transfer's entries sum to zero; refunds never exceed captured minus prior refunds — so the agent can check them without you. Fast, targeted, deterministic checks are the biggest single lever on agent quality, and a typed language with a quick compiler, like Go, helps (Testing Strategy).
What agents are good and bad at
| Strong at | Why | Weak at | Why |
|---|---|---|---|
| Boilerplate: handlers, DTOs, mappers | Pattern-rich, easy to check | Implicit domain rules (refund caps, NAPAS cut-off times, promotion stacking) | Not written down, so not in context |
| Tests for existing code | Code is the spec; tests run | Subtle concurrency: races, lock ordering, cancellation | Plausible code; fails only under load |
| Mechanical refactors and migrations | Repetitive; compiler verifies | Money correctness: float64 amounts, rounding, VND with no minor unit, FX | Looks right; wrong by one đồng at scale |
| Unfamiliar libraries and APIs | Broad pretraining knowledge | Security: authz checks, IDOR, injection | A missing check is invisible in a diff |
| Explaining legacy code, scripts, docs | Reading and summarising is a strength | Consistency across a big codebase | Sees a slice; invents a fourth retry helper |
Rule of thumb: autonomy ∝ verifiability ÷ blast radius. Let agents run free on test scaffolding; keep a human in the loop for the ledger.
What the evidence says
Treat vendor claims with suspicion and know the independent studies:
- METR (July 2025), a randomized controlled trial: 16 experienced open-source developers, 246 real tasks in large repositories they knew well, early-2025 tools (mainly Cursor with Claude 3.5/3.7 Sonnet). With AI allowed, tasks took ≈ 19% longer. Developers had predicted a ≈ 24% speed-up and afterwards still believed they had been ≈ 20% faster. METR cautioned that this is a snapshot of one setting — experts in familiar, mature codebases — with fast-improving tools.
- DORA 2024 (Accelerate State of DevOps Report): an estimated 25% increase in AI adoption was associated with ≈ 1.5% lower delivery throughput and ≈ 7.2% lower delivery stability, alongside small estimated gains in documentation quality, code quality and review speed.
- DORA 2025 (State of AI-assisted Software Development): ≈ 90% of respondents use AI at work, and adoption is now associated with higher throughput but still with higher instability. The central framing: AI is an amplifier — it magnifies the strengths of well-run organisations and the dysfunctions of struggling ones. Its AI Capabilities Model names seven capabilities, among them a clear and communicated AI stance, healthy data ecosystems, AI-accessible internal data, strong version control practices and a quality internal platform.
Synthesis: perceived speed is not measured speed; faster generation raises batch size and review load; gains land where tests, small batches, review discipline and platforms already exist. Measure outcomes — lead time, change failure rate, rework — not lines generated.
Trade-offs
| Option | Strengths | Weaknesses | Choose when |
|---|---|---|---|
| Completion + chat only | Low risk, easy rollout, developer in control | Small gains on multi-file work | Regulated code; first rollout phase |
| Local terminal or IDE agent | High leverage; uses your real toolchain and tests | Permission hygiene; easy to over-trust | Daily feature and refactor work with fast tests |
| Cloud background agent | Parallel tickets, isolated sandbox, PR-based review | Environment setup, secrets in the VM, review bottleneck | Well-specified, low-blast-radius tickets |
| Review bot | Catches obvious issues on every PR | Noise; false confidence | Large teams, as a complement to human review |
| Self-hosted model + open-source agent | Code never leaves; air-gap possible | Lower quality; GPU and operations cost | Core banking code that cannot leave the network |
In practice
Choosing tools in a bank versus e-commerce
| Concern | Bank | E-commerce |
|---|---|---|
| Data terms | Enterprise agreement, no training on your code, zero or bounded retention, data-processing agreement | Enterprise terms still advised; more flexibility |
| Model hosting | Cloud-provider-hosted models in an approved region via private networking, or self-hosted open-weight models for sensitive repos; check residency rules | Vendor APIs usually acceptable |
| Identity and policy | SSO, centrally managed settings, allowlisted tools and MCP servers | SSO, team-level settings |
| Audit | Prompts, tool calls and commands logged and retained per policy | Usage analytics; lighter audit |
| Repos in scope | Internal tools and non-core services first; ledger, card and payment code last, with mandatory human review | Most repos; tighter controls on checkout and PCI-scoped code |
| Pace | Pilot → risk assessment → staged rollout with metrics | Faster experiments across teams |
Several terminal agents can use models served through cloud providers such as AWS Bedrock or Google Vertex AI instead of the vendor's own API — useful when the bank already has an approved cloud contract and region. Verify current support per tool.
A rollout plan an architect can defend
- Policy first: which data, repos and tools are allowed, and who approves exceptions. Publish it — DORA 2025 lists a clear AI stance as a capability.
- Repo readiness: fast tests, linters in CI, instruction files (Setting Up a Repo for AI Agents).
- Guardrails in CI, not in hope: required reviews, secret scanning, dependency checks, branch protection (Reviewing AI Code & CI Guardrails).
- Pilot with baselines: two teams, a quarter, lead time, change failure rate and review time before and after.
- Expand by risk tier, with a named human accountable for every merge.
Common pitfalls
- Measuring adoption instead of outcomes. "80% of engineers use it" while change failure rate climbs.
- Approval fatigue. Ask-every-time mode trains people to approve unread; use rules and sandboxes.
- No verification loop. The agent says "done", tests never ran, the bug surfaces in staging.
- Production credentials on laptops. An injected instruction in a ticket leads the agent to query production.
- Bigger PRs. 2,000-line agent diffs that nobody reviews properly; keep batches small.
- Trusting the summary. "All tests pass" when the failing package was skipped. Read the diff and the output.
- Untuned review bots. Noise trains reviewers to ignore every automated comment.
Interview angle
- "How would you introduce AI coding tools in our bank?" — data classification, procurement terms, hosting, repo readiness, CI guardrails, staged rollout, metrics.
- "Do these tools make engineers faster?" — cite METR and DORA accurately, then explain how you would measure locally. Overclaiming is a red flag; so is dismissing the tools.
- "What would you never let an agent do unsupervised?" — merge to main, touch production, change ledger or authz logic without review, add dependencies unchecked.
- Follow-ups: prompt injection via tickets, secrets, audit evidence for regulators, how review scales when code volume doubles.
Self-check
1. Describe the coding-agent loop and where the human sits in it.
The model receives the goal and instruction files, picks a tool call, the harness checks permissions and executes it, the result joins the context, and the model picks again until it believes it is done. Humans set goal and constraints, approve or pre-authorise actions, and review the final diff. Verification is a step only if the repo provides runnable checks.
2. Why does a fast test command improve agent results so much?
The model stops when output looks done. A runnable check turns that into a pass/fail signal it can iterate on, catching compile errors, broken behaviour and hallucinated APIs before you see the diff. Speed matters because slow suites burn time and context every iteration.
3. Summarise the METR 2025 result and its limits.
In a randomized trial, 16 experienced open-source developers took ≈ 19% longer on real tasks in their own mature repositories with AI allowed, while believing they were ≈ 20% faster. Limits: small sample, experts in familiar code, early-2025 tools; METR warned against generalising. The durable lesson: perceived speed differs from measured speed.
4. What does DORA mean by AI as an amplifier?
AI magnifies what exists: teams with good tests, small batches, version control discipline and solid platforms turn faster generation into delivery gains; teams without them get more instability and rework. The investment question shifts from "which tool" to "which capabilities".
5. Name three threats specific to shell-capable agents, with a mitigation each.
Prompt injection from files, tickets or web pages — treat external text as untrusted, restrict tools and egress. Secret exfiltration — deny reads of .env and credential stores, no production credentials locally. Destructive commands — deny rules, sandboxes, blocking hooks, no write access to shared databases.
6. A core-banking team wants a terminal agent but code may not go to an external vendor. Options?
Use a cloud-provider-hosted model in an approved region over private networking under the bank's existing cloud agreement, if compliance accepts it; or an open-weight model on internal GPUs behind an agent that supports custom endpoints, accepting lower quality. Either way: zero retention, audit logs, central policy, mandatory human review for ledger code.
Exercise
Run a controlled comparison on a real, non-sensitive Go service:
- Pick three tasks: table-driven tests for an untested package; rename a widely used type across the repo; fix a bug that needs domain knowledge.
- Do each with inline completion and with a terminal agent. Record wall-clock time, corrections needed, and whether
go test -race ./...andgolangci-lint runpassed at the first "done". - Redo the domain task after adding the rule to the instruction file plus a test encoding it.
- Write a one-page team recommendation: category per task type, required guardrails, pilot metrics.
Done when: you have the measurement table, a before/after on the domain task, and a recommendation citing at least one external study accurately.
Further reading
- METR, "Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivity" (2025).
- Google Cloud DORA, Accelerate State of DevOps Report 2024.
- Google Cloud DORA, State of AI-assisted Software Development (2025) and the DORA AI Capabilities Model report (2025).
- Anthropic, "Building effective agents" (engineering blog, 2024).
- Anthropic, Claude Code documentation: "How Claude Code works" and "Best practices" — check current docs.
- The
AGENTS.mdopen format (agents.md). - OWASP, Top 10 for Large Language Model Applications.
Related
- LLM Fundamentals for Engineers — why context fills and models hallucinate.
- Prompting & Context Management for Coding Agents — driving the loop well.
- Setting Up a Repo for AI Agents — instruction files, commands, hooks.
- Reviewing AI Code & CI Guardrails — the safety net under agent output.
- Big Tech Practices & Team Adoption — rolling out across teams.
- Agents, Tool Use & MCP — the same loop in production systems.
- Testing Strategy — the verification loop agents depend on.
Do the self-check first. Marking it complete schedules spaced reviews (1, 3, 7, 14, 30… days).