Working With AI Coding Agents in 2026
Derar SattoufUpdated AI engineering

AI coding agents are no longer just autocomplete with a louder name. The shift is from "help me write this function" to "take this issue, inspect the repo, make a change, run the checks and come back with a pull request." Several vendors now ship agents you can assign work to from an issue tracker, a terminal, an IDE or a chat window, and many run in the cloud while you do something else.
That changes how you should work. Blind delegation doesn't hold up; structured delegation does. That means clear briefs, isolated environments, reviewable diffs, automated verification, and firm limits around credentials and production systems. Products in this space change monthly, so check tool-specific details against current vendor documentation.
Treat the agent as a fast, tireless junior-to-mid contributor with uneven judgement and no ownership. You supply scope, context and verification, and you own the result. The best tasks are narrow, testable and backed by repo conventions. The worst are ambiguous, security-critical or architecture-wide.
Agent-ready repositories have documented setup, fast deterministic checks (test, lint, typecheck), small scripts with clear names, and examples of the patterns you want repeated. Review matters more, not less, so inspect scope, tests, dependencies and security instead of only asking whether the diff looks plausible. Run agents in isolated environments with least-privilege credentials, and never give them production access. Measure outcomes (merge rate, review rounds, reverts, defects) instead of counting pull requests.
Kinds of coding agents
The category comes in a few shapes. Names and features change quickly, so treat the examples as illustrations and check what's current.
| Shape | How you use it | Typical examples (verify current status) | Best for |
|---|---|---|---|
| Inline assistant | Completions and chat inside the editor | IDE assistants | Small edits, explanations |
| Terminal agent | You give a task in the shell; it edits files and runs commands locally | CLI coding agents | Interactive, supervised changes |
| Cloud or async agent | Assign an issue; it works in a remote sandbox and opens a pull request | Hosted coding agents integrated with Git platforms | Well-specified, parallelisable tasks |
| Review and triage agents | Comment on pull requests, summarise failures | Code-review bots | Second opinions, first-pass triage |
| Specialised agents | Focused on a quality area such as accessibility or migrations | Purpose-built agents | Mechanical, rule-driven work |
GitHub describes its Copilot coding agent as working from assigned issues and producing pull requests, and has built specialised agents such as an accessibility agent. OpenAI documents agent building blocks in its Responses API and Agents SDK updates, and Anthropic, Google and others offer their own terminal and cloud agents. The common pattern is an LLM in a loop with tools (read files, edit files, run commands, search, open pull requests), running in a sandbox.
How to think about an agent
An agent is closest to an async contributor with a few predictable traits:
- Strong short-term memory over whatever you put in its context, and fast exploration across files.
- Uneven judgement. It may make an excellent architectural call, then miss an obvious product constraint.
- No ownership unless your process creates it. It will not remember the incident that explains why a weird guard clause exists.
- A tendency to satisfy the visible task, even when an invisible constraint (security, performance, a promise to a customer) matters more.
- It mirrors your repository. Inconsistent examples produce inconsistent output.
So don't ask whether the agent can code. Ask whether you can define the work so the output is easy to inspect, test and reject. That's where the productivity comes from.
What to delegate
Good tasks:
- Small bug fixes with a clear reproduction.
- Adding tests for existing behaviour (then check the tests actually test something).
- Mechanical migrations: API renames, framework upgrades following a documented pattern.
- Documentation updates tied to code changes.
- Refactors where the target shape already exists elsewhere in the repo.
- Rule-based quality fixes (accessibility, lint, formatting, type errors).
- Exploration and explanation: "where is X handled, and what would change if we did Y?"
Riskier tasks need heavy human steering: ambiguous product decisions, authentication, authorisation, payments and cryptography, database migrations without rollback plans, performance work without benchmarks, large rewrites across ownership boundaries, and UX-heavy work where taste dominates.
A useful rule: the more a task depends on hidden context, the more human steering it needs. Another: if you can't explain "done" in a few bullet points, the task isn't ready to hand off.
Writing agent briefs
A good brief reads like a small engineering ticket, not a clever prompt.
## Goal
Add server-side validation to the profile update endpoint.
## Scope
- Change only the profile API route and its tests.
- Reuse the existing validation helper if possible.
- Do not change the database schema or add dependencies.
## Acceptance criteria
- Missing displayName returns 400 with the standard error shape.
- displayName longer than 80 characters returns 400.
- Existing successful updates still pass.
- Tests cover each case.
## Verification
- Run the affected test file and the typecheck script.
## Out of scope
- UI changes, other endpoints, formatting-only edits elsewhere.
## Notes
- Follow the error response shape in src/server/errors.ts.The scope and out-of-scope sections stop wandering and make the diff easy to review. Acceptance criteria double as the reviewer's checklist and as test cases. Verification tells the agent how to prove its own work. For bigger changes, go spec-first: write a short spec, then derive tasks and tests from it.
Make your repository agent-ready
Agents perform far better when the repo has a clear map. Many tools read a root instruction file such as AGENTS.md (an emerging cross-tool convention; some tools use their own file names such as CLAUDE.md, so check your tool). Keep it short, accurate and actionable.
# AGENTS.md
## Commands
- Install: pnpm install
- Unit tests: pnpm test:unit (run a single file with: pnpm vitest run path/to/file)
- Typecheck: pnpm typecheck
- Lint: pnpm lint
- Never run: pnpm db:reset, anything that touches production
## Conventions
- TypeScript strict. No `any`. Prefer named exports.
- API errors use the shape in src/server/errors.ts.
- New UI components go in src/components/ with a co-located test.
## Boundaries
- Do not edit generated files in src/generated/.
- Do not add dependencies without asking.
- Auth, billing and migrations need human review: mention them in the PR description.
## Pull requests
- Small, focused diffs. Describe what changed, how it was verified, and known gaps.Other things that make a repo agent-friendly (and humans happier too):
- A
READMEwith setup that actually works from a clean checkout, and aCONTRIBUTINGguide. - Fast, deterministic checks: a one-command unit test, linter and typecheck that finish in seconds to minutes. Slow or flaky tests make agent loops expensive and misleading.
- Named scripts (
test:unit,test:e2e,typecheck,lint) instead of tribal knowledge. - Strong types and schemas at boundaries so errors surface at compile time.
- Good examples of each pattern, and no outdated ones. Stale instructions are worse than none.
- A reproducible dev environment (Dev Container or similar).
Deciding what the agent sees, and when, gets its own treatment in context engineering for coding agents.
Sandboxing and permissions
An agent that can run commands is running code on your behalf, and it will read text from untrusted places (issues, web pages, dependencies). Plan for mistakes and for manipulation.
- Run the agent in a container, VM or ephemeral cloud environment, not on a machine holding production credentials.
- Give it least-privilege credentials: a token that can push to a feature branch, not to the default branch. No cloud admin keys, no production database URLs.
- Restrict outbound network access where possible, or route it through an allowlist. This blunts data-exfiltration attempts.
- Allow-list safe commands (tests, linters) and require approval for destructive ones (
rm -rf,git push --force, package publishing, database tools). - Send agent branches through the same required reviews and checks as everyone's, plus CODEOWNERS for sensitive areas.
- Keep secrets out of the repository and out of the agent's environment unless it needs them. Rotate them if they're exposed.
- Treat inputs as untrusted. An issue body or a web page can contain instructions aimed at the agent. See secure AI-generated code review.
A CI gate for agent-authored branches might look like this. Adjust names to your platform:
name: agent-pr-checks
on:
pull_request:
branches: [main]
permissions:
contents: read
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm lint
- run: pnpm typecheck
- run: pnpm test:unit
sensitive-paths:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Flag changes to sensitive paths
run: |
git fetch origin main
if git diff --name-only origin/main...HEAD | grep -E '^(infra/|migrations/|src/auth/|\.github/)'; then
echo "::warning::Sensitive paths changed. Requires owner review."
fiPin third-party actions to commit SHAs where you can.
Reviewing agent output
Reviewing agent code means more than reading the diff. Inspect the trail:
| Question | Why it matters |
|---|---|
| Did it touch files outside the requested scope? | Scope creep hides risk |
| Did it invent APIs, config keys or functions? | Plausible but non-existent code |
| Did it delete or weaken tests to make them pass? | A classic way to "turn CI green" |
| Did it add dependencies where a local helper existed? | Supply-chain and bloat risk |
| Is behaviour more generic than needed? | Over-engineering |
| Are error paths, timeouts, auth and input validation handled? | Agents favour the happy path |
| Did it update docs, types and changelogs? | Drift |
| Did it run the right checks, and what was the output? | Verify; do not trust the summary |
| Does the PR description match the actual diff? | Summaries can be wrong |
Agents are excellent at producing plausible work, and your job is to separate plausible from correct. A few habits help:
- Ask the agent to explain each touched file and to list assumptions and unknowns.
- Run the code and the tests yourself, at least for non-trivial changes.
- Prefer many small pull requests over one huge one, so review stays sharp.
- Add a second automated reviewer for coverage, but remember it can be wrong too.
- For design-level changes, review the plan before the code: ask for a short plan, correct it, then let the agent proceed.
A team workflow
For a small team:
- A human writes a narrow issue with acceptance criteria.
- The agent works in an isolated branch or ephemeral environment.
- The agent opens a pull request describing the change, the checks it ran and known caveats.
- CI runs automatically.
- A human reviews the diff and requests focused follow-ups.
- A human merges only when tests and product intent are both satisfied.
For larger teams, add:
- CODEOWNERS on sensitive areas.
- Required security checks on dependency changes.
- Separate approval for auth, payments, infrastructure and data migrations.
- Audit logs for tool usage and permissions.
- Sandbox and network limits.
- A shared library of approved briefs and
AGENTS.mdpatterns.
Working with agents interactively
Not all work should be fire-and-forget. For exploratory or tricky changes, use an interactive terminal or IDE agent:
- Start with a plan. Ask for a short plan and the files it expects to touch, and correct it before any edits.
- Keep sessions task-scoped. One task per conversation. Clear or start fresh between tasks, because long histories accumulate noise and old assumptions.
- Give it the feedback loop: let it run the tests and read failures.
- Commit often. Small commits make it easy to revert a bad step. Use branches or worktrees to run several agents in parallel without collisions.
- Interrupt early. If it is heading the wrong way, stop and redirect rather than letting it build on a bad foundation.
- Match the model to the job: bigger models for design and debugging, smaller, cheaper ones for mechanical edits.
Designing agent-sized tasks
Learning to cut work into agent-sized pieces is the most valuable practical skill. A good agent-sized task has:
- One primary behaviour change.
- A small number of files likely to be touched.
- A clear definition of done and a command that checks it.
- Existing patterns in the repo to copy.
- A reviewer who knows the area.
Poor tasks: "Improve the dashboard." "Make auth better." "Refactor the API." "Clean up the codebase." They hide product choices, architectural risk and review complexity.
Better versions:
- "Add empty-state copy to the dashboard activity feed."
- "Require email verification before password reset, with tests."
- "Extract duplicate pagination logic from these three API routes into one helper."
- "Replace this deprecated helper in the billing module only."
A worked decomposition: "Add CSV export to the orders page" becomes (1) add a server endpoint returning CSV for the current filters, with tests; (2) add the button and wire it to the endpoint; (3) add streaming for large exports; (4) document it. Each is reviewable alone.
Testing and evaluation
- Ask for tests that fail first: have the agent write a failing test that reproduces the bug, then fix it. That proves the test means something.
- Watch for tautological tests that assert what the code does rather than what it should do.
- Mutation or coverage checks can reveal tests that don't constrain behaviour.
- Behaviour-level tests (integration or end-to-end for key flows) catch intent mismatches that unit tests miss.
- If you use agents for a recurring job (for example dependency upgrades), keep a handful of past tasks with known-good outcomes and re-run them when you change prompts, models or tooling.
Measuring the workflow
Useful metrics are the share of agent pull requests merged after review (merge rate), average review rounds per pull request, CI failure rate on agent branches, revert rate and defects found after merge, time from assignment to a review-ready pull request, reviewer time spent per agent pull request, attempts to change sensitive files, and cost per merged change (model usage plus compute).
Don't try to maximise the number of agent pull requests. Aim for more useful, verified changes without more review fatigue or production risk. If reviewers are drowning, tighten task scope or slow intake.
Cost and productivity expectations
Agent runs cost model tokens and compute, and long loops can be surprisingly expensive when tests are slow or the agent thrashes. Control cost by scoping tasks, keeping tests fast, caching prompts where the tool supports it, and setting step or budget limits.
Be realistic about productivity. Agents save the most time on well-specified, mechanical, high-volume work, and can cost time on ambiguous work because of review and rework. Measure in your own codebase before making claims.
What senior developers should focus on
Agents make some mechanical work cheaper. They do not remove the need for engineering taste. Senior developers should spend more time choosing the right problem boundaries, designing interfaces that are hard to misuse, writing tests that capture business behaviour, and simplifying architecture so humans and agents can navigate it. They should also improve observability and rollback, review with security and maintainability in mind, and teach the team to write good briefs.
The payoff moves upward: less typing, more judgement. Juniors still need to build fundamentals; use agents as tutors and reviewers, not replacements for understanding.
Failure modes and fixes
| Failure | Typical cause | Fix |
|---|---|---|
| Changes too much | Vague scope | Tighten scope, list out-of-scope items, ask for explanations of every touched file |
| Tests pass, intent broken | Weak acceptance criteria | Add behaviour-level tests and explicit criteria |
| Invents a dependency or API | Hallucination under uncertainty | Add dependency rules to AGENTS.md, point to docs, require sources |
| Cannot run the project | Poor setup docs, missing env | Fix setup scripts and docs (helps humans too) |
| Repeats a bad local pattern | Inconsistent repo examples | Clean up examples, point to the good one |
| Loops or thrashes | Flaky or slow tests, unclear goal | Fix tests, add step limits, restart with a sharper brief |
| Deletes or weakens tests | Optimising for green CI | Forbid in instructions, review test diffs explicitly |
| Leaks or mishandles secrets | Over-broad environment | Minimal env, secret scanning, rotate on exposure |
| Long sessions degrade | Context noise and stale assumptions | Start a fresh session per task, summarise state |
| Review fatigue | Too many large PRs | Smaller tasks, throttle intake, add automated pre-checks |
Where teams go wrong
Teams delegate vague work and expect good results, skip review because CI is green, and have no fast tests, so the agent can't verify anything. They hand out broad credentials to make setup easier and let instruction files rot, though wrong rules are worse than none. Pull requests get huge, nobody can review them properly, and success is measured by output volume instead of verified outcomes. Others use agents on security-critical code without extra human scrutiny, ignore licensing and provenance questions for generated code (check your organisation's policy), or never teach the team the new skills: briefs, review of agent output and sandbox hygiene.
When to skip the agent
- The task is ambiguous, and the real work is deciding what to build. Do the product thinking first.
- The change is security-critical and you can't invest extra review.
- You can't provide a safe environment or any automated verification.
- The area is tiny and urgent. Doing it yourself may be faster than writing a brief.
- You're learning a concept. Struggling through it yourself builds understanding an agent would shortcut (use the agent to explain instead).
- The code is under strict regulatory or confidentiality constraints and your tool's data handling doesn't meet them. Check vendor terms.
Quick answers
Will coding agents replace developers? They change the mix of work. Typing and boilerplate shrink; specification, review, system design and operations grow. Accountability stays with people.
Cloud agent or terminal agent? Use terminal or IDE agents for interactive, exploratory work you supervise. Use cloud agents for well-specified tasks you can run in parallel and review later.
Is AGENTS.md required?
No, but a short, accurate instruction file noticeably improves results. Check which file names your tools read. Keep it as short as possible (commands, conventions, boundaries) and link out to longer documentation the agent can open when needed.
What about intellectual property and licensing? Follow your organisation's policy, review generated code like any third-party contribution, and keep records of tools used on sensitive work.