Agentic coding

Also known as: agentic software engineering

On this page 7

Agentic coding, also called agentic software engineering, is a style of software development in which a language model acts as an autonomous agent that reads a codebase, plans changes, edits multiple files, runs commands and tests, and iterates on the results until a goal is met. In AI for coding, it marks the step beyond autocomplete and chat: the model does not only suggest code, it executes a loop of actions inside a real development environment.

The developer’s role shifts from typing every line to specifying tasks, setting boundaries and reviewing outcomes. Agentic coding tools run in terminals, AI-native IDEs or cloud sandboxes, and they are now a central topic in artificial intelligence research on reliability, evaluation and safe tool use.

How the agentic coding loop works

An agentic coding system wraps a large language model in a control loop of observation, reasoning and action. At each step, the model receives the task, the conversation so far and the output of previous tools, then decides on the next action, such as reading a file or running the test suite.

The table below shows the typical tools an agent calls and what each contributes to the loop.

ToolExample actionPurpose in the loop
File reading and searchOpen a module, grep for a symbolBuilds context about the codebase
File editingApply a diff or replace a blockImplements the change
Shell executionRun the build, linter or scriptProduces real feedback from the environment
Test runnerExecute unit and integration testsVerifies behavior against expectations
Version controlCreate a branch, commit, open a pull requestPackages the work for human review
Web or documentation lookupRead an API referenceFills knowledge gaps about libraries
Typical tools available to a coding agent

The decisive ingredient is feedback from execution. A compiler error, a failing test or a stack trace gives the agent objective evidence, so it can correct its own mistakes in the next iteration instead of relying on a single prediction. This self-debugging behavior separates agents from one-shot code generation.

Levels of autonomy in AI-assisted development

AI coding assistance spans a spectrum of autonomy, and agentic coding occupies its upper end. Placing tools on this spectrum helps teams decide how much oversight each one requires.

LevelWhat the AI doesHuman roleTypical scope
Code completionPredicts the next tokens or linesWrites and accepts codeA few lines
Inline chatRewrites a selected block on requestDirects each editOne function
Multi-file editingProposes coordinated diffsApproves every diffSeveral files
Supervised agentPlans, edits, runs tests in a loopApproves risky actions, reviews resultA feature or bug fix
Background agentWorks asynchronously in a sandboxReviews the pull requestWhole issues or tickets
From completion to autonomous agents

Agentic coding is related to vibe coding, but the two are not identical. Vibe coding describes accepting generated code with little inspection, while professional agentic coding keeps tests, code review and version control as the guarantee of quality.

Context, instructions and environment design

The quality of agentic coding depends less on the model alone than on the context and environment it receives. Agents cannot read an entire large repository at once, so they rely on codebase indexing, repository maps and targeted search to locate relevant code.

Teams increasingly add project instruction files, such as AGENTS.md or project rules files, that describe build commands, coding conventions and forbidden actions. Clear specifications, as promoted by spec-driven development, reduce ambiguity, and a fast, deterministic test suite gives the agent reliable signals about success.

FactorGood practiceEffect on results
Task definitionConcrete goal with acceptance criteriaFewer wrong interpretations
Test coverageRunnable tests for the affected codeAgent can verify its own work
Instruction fileDocumented commands and conventionsConsistent style and correct tooling
SandboxingIsolated container or worktreeLimits damage from mistaken commands
PermissionsApproval for network, deletion and deploymentKeeps humans in control of risky steps
Factors that determine agent success

Measuring coding agents

Coding agents are evaluated on realistic, executable tasks rather than on text similarity. SWE-bench and its curated variants ask an agent to resolve real GitHub issues so that hidden tests pass, while Terminal-Bench measures competence in command-line tasks and LiveCodeBench limits contamination with fresh problems.

Benchmark scores have risen quickly, but they do not transfer directly to production. Real repositories contain undocumented conventions, flaky tests and unclear requirements, so teams should run internal pilots on their own backlog and track metrics such as merge rate, review time and defects found after release.

Risks, limitations and safe practice

Agentic coding multiplies both productivity and the impact of errors, because an agent can change many files and execute commands without a human reading every step. Experienced teams therefore design guardrails before granting autonomy.

Failure modeCauseMitigation
Gaming the testsAgent edits tests to make them passProtect test files, review diffs
Package hallucinationAgent invents dependency namesLock files, registry allowlists
Destructive commandsUnrestricted shell accessSandboxes and approval prompts
Prompt injectionMalicious text in files or web pagesTreat fetched content as data, limit tools
Scope creepVague task descriptionSmall, well-defined tasks
Hidden quality debtCode that works but is hard to maintainHuman review and style checks
Common failure modes and mitigations

Cost and latency also matter: a long agent session may consume millions of tokens across dozens of iterations. The most reliable pattern remains small, verifiable tasks with mandatory human review before any change reaches the main branch.

The simple explanation

Agentic coding means giving an AI a programming task and letting it work through the steps itself. It does not only suggest a line of code. It reads the project, makes changes, runs the program and checks whether everything works.

Think of a junior developer with a very fast keyboard. You explain the job. The assistant tries something, sees the error, and tries again. When it is done, a person still checks the work before it goes live.

The main benefit is saved time on routine work. The main risk is that mistakes can spread quickly if nobody reviews them.

How it is used in practice

A backend team at a mid-sized online retailer needs to upgrade a web framework by one major version across a service with about 80,000 lines of code. A developer writes a short task description, points the coding agent to the migration guide and the project instruction file, and runs it in an isolated container with network access disabled.

Over roughly two hours, the agent updates dependencies, rewrites deprecated calls in 140 files and runs the test suite after each batch, fixing 37 failing tests along the way. It stops twice to ask for approval before modifying database migration files. The developer then reviews the resulting pull request, rejects one questionable workaround and merges the rest. The migration, estimated at two weeks of manual effort, is completed in two days, including human review and staging tests.