Skip to content
AI Skill Index
Autonomous agentsIntermediate

What to check before letting an agent touch your codebase

The failure modes are predictable. Most of the damage comes from three of them.

Editorial·2 min read·
Sign in to save

Coding agents are useful. They are also capable of a category of mistake that a human collaborator does not make, and the mitigations are cheap.

Everything is revertible, or it does not run

Work in a branch. Commit before you start. This is obvious and routinely skipped because the change looked small.

The specific danger is not a bad edit — you would see that in a diff. It is the agent that edits eleven files to make one thing work, and you review the file you were thinking about.

Read the diff, not the summary

An agent's summary of its own work is a description of what it intended. Occasionally those differ, and the summary is always the more reassuring of the two.

Read the diff. If it is too large to read, that is the finding: the change should have been smaller.

Three things to look for specifically

Tests weakened rather than code fixed. An agent asked to make tests pass has two options and the wrong one is easier. Look for assertions loosened, cases deleted, skip added. This is the single most damaging pattern because it removes the thing that would have caught the next problem.

Error handling added that swallows. A try/catch around the failing call makes the error go away in the most literal and least useful sense. An empty catch block is a bug with a comment on it.

Scope creep. You asked for one thing; the diff also renames variables, reformats a file and upgrades a dependency. Each may be fine. Together they make the change unreviewable, and unreviewable changes are how the actual defect gets through.

Secrets and network

Check what the agent can read. A .env in the working directory is readable by anything with file access, and a model provider's retention policy is not the place to discover your production credentials.

Check what it can reach. An agent that can install packages can execute arbitrary code from a registry — that is what a postinstall script is.

The honest test

Would you merge this from a competent contributor you had never met, based on the diff alone?

If yes, merge it. If you find yourself thinking "the agent probably knew what it was doing", that is not a review — and "probably" is doing more work in that sentence than it can hold.

ShareXLinkedIn

Cookies

We use only the cookies this site needs to work. Optional analytics helps us see which content is worth writing more of — nothing loads until you say yes.

Read the privacy policy