Mark DeLeap King · markdeleapking.com/writing/leading-ai-agents/ · linkedin.com/in/markdeleap
AI and engineering
A field guide to leading AI agents like an engineering team
Most teams meet AI agents as faster autocomplete, then wonder why quality and cost drift. Treat the agents like a new team. Give them clear roles and written briefs, review their work every time, and set limits on what they do alone. I've drawn this from how I run engineering at CloudVerg and from leading human teams before that.
Treat it as management: a planner and workers
When an engineering organization starts using AI agents, the first instinct is to pick a tool and give it to everyone. That treats the agent as a faster keyboard. Then someone merges code nobody read, a bill shows up that nobody planned for, and two people have asked an agent to change the same file.
Leaders have met all of these with people: unclear goals, no review, expensive people doing cheap work, no agreement on who may do what. The fixes carry over. I run CloudVerg this way. It's founder-led, and the engineering team is a set of AI agents that I direct the way I directed human teams.
I give the work two layers. The planner reads the request, reads enough of the code and data to decide, writes the briefs, makes the edits that take judgement and reviews everything that comes back. Workers do the bulk: sweeps across files, mechanical edits, test runs and deploy steps.
I name a few kinds of worker, so that picking the kind is the routing. I use four.
- A scout does read-only lookups and checks, and can't change anything.
- A runner runs tests, builds and deploy steps, and makes mechanical edits whose shape is already decided.
- A builder implements a feature or fix from a written brief, tests included.
- An expert gets the pieces that need judgement: money paths, security, migrations, hard bugs and independent review.
The planner is the expensive seat and the workers are cheaper. That only pays off when the planner knows exactly what's required and says so. With a vague brief the worker guesses, and a wrong cheap guess costs more than a careful instruction would have.
If your own engineers are the ones using agents, each of them becomes a planner for their workers. Delegation is the skill the team is building, and most engineers have never been asked to practice it.
What a brief must contain
A worker has no memory of your last conversation and no sense of what you care about. It knows what the brief says. I spend more of my time on the brief than on the code review that follows it.
Every handoff I write answers six questions.
- The goal, and why it matters, in a sentence or two. The why lets a worker make small choices correctly without asking.
- The exact files or area. Name the paths, so the worker doesn't search and pick the wrong place.
- The rules that apply: coding conventions, things never to touch, load limits, anything the owner has decided.
- What's already ruled out. If an approach failed, say so, or you'll pay for it twice.
- What done looks like. A passing test, a page that returns the right content, a diff under a certain size. It has to be checkable.
- What to return. A short report covering what changed, how it was checked and what's unfinished or uncertain.
One more line goes at the bottom. Workers never decide scope, and anything ambiguous comes back to the planner. That one rule heads off most of the surprise changes that make people distrust agents.
Review before anything counts as done
Agents sound equally confident when they're right and when they're wrong. A report that says all tests pass is a claim. I read it the way I read a status update from a new hire I like and haven't calibrated yet: warmly, and with a look at the work.
Looking can mean reading the diff, reading the test output, requesting the page in production or checking a screenshot. Pick the cheapest check that would catch the failure you're worried about. For a copy edit that's a glance. For a money path it's an independent reviewer plus a test written to fail on the old behavior.
When a worker misses, change the brief first. Add the missing rule or constraint. Move the task to a stronger model only if the brief was already clear and the work was still wrong.
Don't count on people remembering to review. Branch protection, required checks and a deploy path that runs the tests do the job better than reminders.
Route work by model size and effort
Cost and quality both improve once you stop using one model for everything. Lookups, greps and status checks go to the smallest model. Routine builds, tests and content from a clear spec go to a mid-size one, and so do multi-file features from a written plan, with more effort set. Only the pieces that need judgement go to the strongest model: design, money, security, migrations and hard root causes.
Effort is a second dial. Most tasks run at a low or medium setting. I raise it for design, for anything touching payments or authentication, and for the bug a cheaper pass already missed. Each increase is a decision I make on purpose.
Write the routing table down and, where your tooling allows, build it into named worker types so nobody has to remember it. A table that lives only in the lead's head stops being followed by week three.
Load is part of routing too. Builds, full type checks, deploys and browser sweeps run one at a time per machine, at low priority, with targeted tests. An agent can start ten things at once, and a machine or a database can't absorb that.
What agents may never do alone
An agent that can fill in a form can also fill in the wrong form. Decide in writing, before the first incident, what stays with a person.
- Typing passwords, card or bank numbers, government identifiers or live API keys.
- One-time codes and CAPTCHAs. The agent stops and hands the screen over.
- Payments, refunds, transfers and anything else that moves money.
- Creating new accounts with third parties.
- Anything a customer, a regulator or the public will read, such as messages sent on someone's behalf, published pages and legal wording.
- Changing its own permissions, safety hooks or approval settings.
- Deleting data without a backup or a way back.
Inside written approvals, agents can carry work all the way to a verified deploy. Outside them, the work waits.
The same idea shows up in CloudVerg's product design. PersonalAgent, an AI agent that works in its own sandboxed browser, stops when a site asks for a sign-in, a texted code or a captcha and hands the screen to the person watching. If nobody takes over, it saves its place and parks the task.
Measure it
Adoption stories are easy to tell and hard to check. Pick four numbers before you begin, record a baseline and look at them every month.
- Rework rate is the share of changes that need a follow-up fix or a revert within a short window. If agents are fast but this climbs, you're borrowing from next month.
- Change-fail rate is the share of deploys that cause a failure in production. It's one of the DORA delivery measures and applies unchanged.
- Cost per change is model spend plus the human review time behind a merged change. Include the review time or the number will flatter you.
- Time to verified deploy runs from the start of work to a change that's live and confirmed live. Stop the clock when it's confirmed.
Read them together. Faster with the same change-fail rate and a falling cost per change is a win. Faster with rising rework is a warning, however good it feels.
A 30/60/90 plan for a human team
Days 1 to 30: set the ground
- Write the quality bar and the never-alone list, a page each.
- Pick a couple of low-risk areas such as test writing, dependency updates, documentation or log triage.
- Baseline the four measures from your existing history.
- Teach the brief. In one session, each engineer writes a brief for a ticket from the backlog and a colleague critiques it.
Days 31 to 60: widen with guard rails
- Move to feature work in areas with good tests, and require the report format from the brief section.
- Introduce routing, either named worker types or a written table, with expert review for money and security.
- Set spending limits per team before usage grows.
- Hold a short weekly review of failures and fix the brief or the rule they exposed.
Days 61 to 90: make it the normal way
- Compare the four measures with the baseline and show the team the numbers, good and bad.
- Retire what isn't paying for itself and keep what is.
- Name an owner for the operating model, since someone has to keep the rules current as models change.
- Plan the next quarter. The areas that stayed manual because the tests were thin are where better tests will let agents take on more.
How it goes wrong
- Work starts without a clear goal, and the agent produces something plausible and wrong. The brief fixes that.
- A report says done and nobody looks. Put review into the path to production.
- Expensive models do cheap work, or cheap models do hard work. Route by task and effort.
- Two sessions deploy over each other. One written deploy path and one owner per area prevent it, and the release rules in my small-releases essay came out of exactly this kind of mistake.
- Spend creeps up unseen. Set limits before launch and send every call through a gateway.
- The team stops reading code because the agent usually gets it right. Keep reviewing, and keep a few engineers writing the hard parts by hand so the skill stays alive.
Leading agents is ordinary management. The difference is that this team is fast and sometimes confidently wrong, so the review matters more. Start this quarter with two pages, the brief checklist and the never-alone list. The rest can wait until both are in use.