An agent in development: what to delegate and who answers
Delegate tasks whose correctness is cheap to check: renames, test drafts, log analysis and mechanical migrations. Keep architecture, permissions and security, real data and the final decision to merge. The engineer who accepts a change answers for it, so an agent's report is not proof: check the diff and CI in a clean environment.
Agentic development · The cycle
The agent wrote "everything passed". In production it did not. Who answers?
Friday evening. An agent got the task "add a field to the API response", returned a report "done, tests passed" and opened a pull request. The engineer skimmed the description, saw a green badge and merged. On Monday it turned out that the agent had run only unit tests, the integration ones, which CI runs only in the nightly build, were failing, and it had also changed the date format on the way. This article covers what to hand to an agent, how much freedom to give it and why responsibility does not move with the task.
How tool calling and MCP work is covered in the AI topic. Here the subject is working with an agent during development and testing. Claude Code, Cursor and Codex are only examples: the approach is the same, the tool details change fast.
How it works and why. A coding agent is a model in a loop: it gets a goal, picks an action (read a file, run a command, edit code), sees the result and decides what comes next. The loop stops when the model believes the goal is reached or it hits a limit. Two properties follow that shape all work with it. First, "believes it is reached" is the model's opinion, not a fact, so its report has to be checked independently. Second, every action rests on what the model saw in its context, and it saw only part of the system.
The loop of a coding agent
What to delegate. The main criterion is the price of checking the result. If correctness is visible from a green test or a short diff, the task can be handed over. If to be sure it is right you must understand the matter as deeply as if you had done it yourself, there is no saving.
- Good to hand over: renaming a field in dozens of files with tests, drafts of test cases and boundary data, diagnosing a failure from a log, mechanical migrations, a first review pass, a pull request description.
- Keep for yourself: what to build and why, architectural trade-offs, changes to access rights and security, work with real data, the final "can merge".
Autonomy levels. From "proposes, the human applies" through "every action after confirmation" and "acts alone within permissions" to "works in the background and opens a pull request". The higher the autonomy, the tighter the limits must be (a separate branch, an isolated environment, minimal rights) and the stronger the automatic check. The level is raised only for a kind of task where verification is already set up and cheap.
Example: why a report is not proof. The Friday report looked like this (shortened): "Added the currency field, ran the tests, everything passed". Reading it as proof means believing that the same tests ran as in CI. Checking with your own hands takes minutes:
# what exactly changed: number of files and the task limits
git diff --stat origin/main...HEAD
# the same commands as in CI, on a clean clone
git clone . /tmp/check && cd /tmp/check
npm ci && npm run lint && npm test && npm run test:integration
The first command would have shown nine changed files instead of two. The second would have proved that the integration tests are red. The agent's report contained neither detail because the agent never asked. Conclusion: proof is CI in a clean environment plus your own look at the diff.
Two tasks for an agent
Rename a field in 40 files
The result is visible from the compile, the tests and a short diff. The cost of checking is low.
Change the token lifetime
Correctness depends on security requirements that are not in the code. Checking needs understanding, not a run.
Limits and alternatives. An agent does not take responsibility: whoever accepted the change answers for it. This is not distrust, it is a question of who signs for the result. The alternative to full autonomy is not "do not use it" but narrowing the task to a size that can be checked. Some tasks are cheap to verify only after extra preparation: write a test that states the expectation, and the agent's result becomes verifiable.
Common mistakes.
- Treating the agent's report as proof: the report says what the model did and what it believed, not what is true in a clean environment.
- Giving a broad task ("improve the module"): the result cannot be checked against a criterion and the diff is too big to read carefully.
- Raising autonomy before verification is in place: mistakes pile up silently.
- Handing the agent decisions about security and data: the cost of a mistake is high and it is hard to see from the code.
Check yourself
An agent opened a pull request and wrote "all tests passed". What do you check first and why is that report not enough?
Answer
You check what changed (the diff and its size relative to the task) and whether CI is green in a clean environment. The report describes what the model ran in its own session: with other variables, cached dependencies or only part of the tests.
Two tasks: rename a field in 60 files and decide whether to keep the session in a cookie or in a token. Which one goes to the agent and by what criterion?
Answer
The rename: its result is visible from the compile and the tests, the cost of checking is low. Choosing a session model is a security decision with trade-offs that are not in the code; the agent may propose options, but a human decides.