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.
| Tool | Example action | Purpose in the loop |
|---|---|---|
| File reading and search | Open a module, grep for a symbol | Builds context about the codebase |
| File editing | Apply a diff or replace a block | Implements the change |
| Shell execution | Run the build, linter or script | Produces real feedback from the environment |
| Test runner | Execute unit and integration tests | Verifies behavior against expectations |
| Version control | Create a branch, commit, open a pull request | Packages the work for human review |
| Web or documentation lookup | Read an API reference | Fills knowledge gaps about libraries |
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.
| Level | What the AI does | Human role | Typical scope |
|---|---|---|---|
| Code completion | Predicts the next tokens or lines | Writes and accepts code | A few lines |
| Inline chat | Rewrites a selected block on request | Directs each edit | One function |
| Multi-file editing | Proposes coordinated diffs | Approves every diff | Several files |
| Supervised agent | Plans, edits, runs tests in a loop | Approves risky actions, reviews result | A feature or bug fix |
| Background agent | Works asynchronously in a sandbox | Reviews the pull request | Whole issues or tickets |
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.
| Factor | Good practice | Effect on results |
|---|---|---|
| Task definition | Concrete goal with acceptance criteria | Fewer wrong interpretations |
| Test coverage | Runnable tests for the affected code | Agent can verify its own work |
| Instruction file | Documented commands and conventions | Consistent style and correct tooling |
| Sandboxing | Isolated container or worktree | Limits damage from mistaken commands |
| Permissions | Approval for network, deletion and deployment | Keeps humans in control of risky steps |
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 mode | Cause | Mitigation |
|---|---|---|
| Gaming the tests | Agent edits tests to make them pass | Protect test files, review diffs |
| Package hallucination | Agent invents dependency names | Lock files, registry allowlists |
| Destructive commands | Unrestricted shell access | Sandboxes and approval prompts |
| Prompt injection | Malicious text in files or web pages | Treat fetched content as data, limit tools |
| Scope creep | Vague task description | Small, well-defined tasks |
| Hidden quality debt | Code that works but is hard to maintain | Human review and style checks |
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.