Coding agent

Also known as: AI coding agent

On this page 7

A coding agent is an artificial intelligence system that completes software engineering tasks autonomously by reading a codebase, planning changes, editing files, running commands and tests, and iterating on the results until the task is done or it needs human input. Among AI agents, it is the specialized type whose environment is a repository, a terminal and a toolchain.

An AI coding agent differs from an autocomplete assistant in one decisive way: it acts and observes. Instead of proposing a single snippet for a developer to paste, it executes a loop of actions, reads the compiler output or test failures, and adjusts its next step. That feedback loop is what allows it to fix bugs, implement features or migrate code across many files.

How a coding agent works

A coding agent runs an agent loop around a large language model. On each turn, the model receives the task, the conversation so far and the results of earlier actions, then chooses either a tool call or a final answer. The surrounding software, called the agent harness, executes the tool call and returns the output to the model.

The quality of a coding agent depends as much on its tools and harness as on the model. The table below shows the typical tool set and what each tool gives the agent.

ToolPurposeTypical risk
File read and searchLocate definitions, usages and configurationReading secrets into context
File editApply targeted changes or create filesBreaking unrelated code
Shell command executionBuild, lint, install, run scriptsDestructive or networked commands
Test runnerVerify behavior after each changeTests that pass for wrong reasons
Version controlDiff, branch, commit, open pull requestsUnreviewed changes reaching main
Web or documentation lookupCheck library APIs and error messagesPrompt injection from pages
Typical tools available to a coding agent

Because a real repository rarely fits in the context window, the agent explores selectively: it searches for symbols, opens only relevant files and summarizes what it learned. Long sessions rely on context compaction, which condenses earlier turns so that the agent keeps its plan without exceeding the token limit.

Levels of autonomy in coding agents

Coding agents operate at different levels of autonomy, and the level determines both productivity and risk. The same underlying model can run as an interactive pair programmer or as a background worker that opens pull requests on its own.

ModeHuman roleTypical taskMain safeguard
Interactive in the editorApproves each actionRefactor a modulePer-step confirmation
Terminal agent with permissionsApproves risky actions onlyFix a failing test suitePermission rules and allowlists
Background agentReviews the finished pull requestImplement a ticketIsolated sandbox and code review
Orchestrated subagentsSets goals and reviews outputLarge migration across servicesTask decomposition and checkpoints
Operating modes of coding agents

Higher autonomy shifts the human from human-in-the-loop to human-on-the-loop: the developer stops approving individual edits and instead reviews outcomes. This only works when the agent runs in an agent sandbox with limited credentials, so that a mistaken command cannot damage production systems.

The term coding agent is often used loosely, so it helps to separate it from neighboring categories. The distinguishing feature is closed-loop execution with tools, not the presence of a language model.

Tool categoryActs on filesRuns codeIterates on feedback
Code completionNo, suggests inline textNoNo
AI coding assistant chatSometimes, with user approvalRarelyOnly through the user
Coding agentYesYesYes, autonomously
Computer-use agentThrough a graphical interfaceIndirectlyYes, from screenshots
Static analysis toolNoNo, analyzes sourceNo
How a coding agent differs from related tools

A coding agent may itself use a code execution tool, call servers through MCP, the Model Context Protocol, or delegate subtasks to subagents. These are building blocks; the coding agent is the complete system that turns a task description into verified code changes.

Getting reliable results from a coding agent

Reliable results come from giving the agent a way to check its own work. An agent that can run tests, type checkers and linters corrects many of its mistakes before a human sees them; an agent without feedback produces plausible code that may not even compile.

  • State the goal and the acceptance criteria, for example which tests must pass and which files must not change.
  • Provide project conventions in a repository instruction file, including build commands and code style.
  • Keep tasks scoped: one feature or one bug per session yields smaller, reviewable diffs.
  • Grant least-privilege permissions, with network access and deployment credentials disabled by default.
  • Review every diff as you would a colleague’s pull request, focusing on logic and security rather than style.

Agent evaluation benchmarks measure the share of real repository issues an agent resolves with passing tests. Scores have risen quickly, but they depend heavily on the harness, the time budget and the benchmark’s composition, so benchmark results transfer poorly to a specific codebase. A short internal trial on representative tickets is the more useful signal.

Risks and limitations of coding agents

Coding agents fail in ways that differ from human developers, and knowing those patterns makes review faster. The most serious risks involve security and silent incorrectness rather than obvious crashes.

FailureWhy it happensMitigation
Tests edited to passAgent optimizes for the visible signalProtect test files, review test diffs
Invented API or packageModel recalls a nonexistent interfaceRun the build, pin dependencies
Destructive shell commandOverly broad cleanup stepSandbox, deny lists, approvals
Prompt injection from repository contentInstructions hidden in files or issuesTreat content as data, limit tools
Drift on long tasksLost context after compactionCheckpoints and written plans
Common coding agent failures and mitigations

Ownership remains with people. The developer who merges the change is accountable for it, and licensing, security review and architectural decisions still require human judgment that an agent cannot supply.

The simple explanation

A coding agent is software that can do programming work on its own, not just give advice. You describe a task, and it opens the project, makes changes, runs the program to see whether it works, and fixes what breaks.

Compare it with a helpful colleague who has access to your computer: you give the instructions, and they try, test and retry until the job is done. You still check the result before it goes live, because the agent can be confidently wrong.

How it is used in practice

A platform team at a logistics company must upgrade a web framework across 40 internal services before the old version loses security support. Doing it by hand would take weeks of repetitive edits, so the team runs a coding agent in an isolated sandbox for each service, with instructions to update dependencies, fix breaking changes and keep the full test suite green.

For each service, the agent reads the migration notes, edits imports and configuration, runs the tests, and repeats until they pass, then opens a pull request with a summary. Engineers review the diffs, reject a few that changed test assertions, and fix two services by hand. Most of the migration ships within a few days, and engineers spend their time on review and the difficult cases rather than on mechanical edits.