A year ago, an AI coding agent was a fast autocomplete with opinions. Today it can read a codebase, run the build, fix its own type errors, and ship a feature across a dozen files. I use agents every day, at work and on client projects, and they write a real share of the code that goes out.
But the failures haven't gone away. They've moved. The agent rarely writes code that doesn't compile anymore. What it does instead is write clean, confident, well-tested code that solves a slightly different problem from the one you had in your head. Almost every time I trace one of those back, the cause is the same: my instructions left a gap, and the agent filled it with a guess.
Agents don't stop at gaps. They guess.
A human contractor who hits an unclear requirement usually asks. An agent usually doesn't. It's built to make progress, so when your prompt doesn't say something, it picks the most plausible default and keeps going. The guess is often reasonable. Sometimes it's even what you wanted. The problem is that you can't tell which parts were your decisions and which were its assumptions, because the output looks equally confident either way.
That's why ambiguity is so expensive with agents. A vague prompt to a person costs you a clarifying question. A vague prompt to an agent costs you a review of 400 lines, hunting for the one place it decided something you never would have.
Anything you don't write down, the agent decides for you.
What a gap looks like
Take a prompt that sounds perfectly clear: Add a cart and checkout to the store. Count the decisions hiding inside it:
- Which payment provider? Is there already an SDK in the project, or should it add one?
- Where does the cart live: local storage, a database table, the provider's hosted checkout?
- Are taxes and shipping calculated, flat, or ignored for now?
- What happens when the payment webhook fires twice? (It will.)
- Should it touch the existing product pages, or only add new ones?
- What counts as done: it compiles, the tests pass, or a real test purchase goes through?
Every one of those has a "most plausible default", and the agent will pick one for each. Some of its picks will be fine. One of them will be the bug you find in production.
Write the plan first
The fix isn't a cleverer prompt. It's a plan: a short, written document that answers those questions before any code exists. It doesn't need to be long. It needs to be specific. These are the parts I always include:
1. The goal, and the non-goals
One or two sentences on what should be true when this is done. Then, just as important, what is out of scope. Agents are eager. If you ask for a copy change, they'll happily "improve" the component, the tests, and the styles while they're in there. Saying "only change this file" or "do not touch the schema" saves you from reviewing work you never asked for.
2. The files, and the change in each
A file-by-file list: what gets created, what gets edited, and roughly how. This is where you catch bad ideas cheaply. Reading "edit the checkout route to also send the email" in a plan takes five seconds to reject. Finding it in a diff takes much longer.
3. The data shapes, verified
Agents are very good at inventing field names that look right. order.customer.email feels correct until the real payload says buyer_email_address. Point the agent at the actual type definitions, schema, or API docs, and tell it to read them before writing code that depends on them. If you're not sure of a shape yourself, the plan should say so, and say how it will be checked.
4. The edge cases you already know about
You know your system's sharp corners: the webhook that retries, the user with no last name, the product that's out of stock. The agent doesn't, unless you say so. Write them down. Each one you list is one fewer it has to guess at.
5. How we'll know it works
Define done in a way that can be checked. "The build and typecheck pass, and a test order in the sandbox creates a label" is a finish line. "Make it work" is an invitation to stop as soon as nothing is red.
Vague versus specific
Here's the same request written two ways. The first is what most of us type:
Add shipping labels to orders.
The second takes five more minutes to write and saves an afternoon:
Goal: when a paid-order webhook arrives from the payment provider, create a shipping label with our shipping API and email the customer their tracking number. Out of scope: product pages, cart UI, database schema. Files: - api/webhooks/order-paid.ts (new): verify the signature, ignore duplicate event IDs, call createLabel(). - lib/shipping.ts (edit): add createLabel(order). Read the shipping API's docs for the exact request and response fields before writing it. Do not guess field names. Edge cases: webhooks can arrive twice or out of order. Orders without a shipping address should log and skip, not throw. Done when: typecheck passes, and one sandbox order produces exactly one label and one email, even if the webhook is replayed.
Nothing in the second version is clever. It just leaves the agent nothing important to assume.
Make the agent show its assumptions
You won't catch every gap yourself, so ask the agent to help find them. Before it writes anything substantial, have it return three things: the change plan, the list of assumptions it's making about data shapes and external services, and how it will verify each one. Then read that list. It's the fastest review you'll ever do, because you're checking decisions, not code.
I keep this as a standing rule in my agent's instructions: for any change that touches more than a few files, plan first, list assumptions, and wait for my approval. It costs a minute per task. It has saved me hours.
Why this matters more as agents get better
It's tempting to think better models make planning less important. The opposite is true. A weak agent fails loudly: the build breaks and you notice. A strong agent fails quietly: everything works, it just works the way the agent assumed rather than the way you meant. The more capable the agent, the more it can build on top of a wrong assumption before anyone sees it.
The skill that's becoming valuable isn't typing code faster. It's being able to say exactly what you want, in writing, without leaving anything important open. That was always the hard part of software engineering. Agents just made it the part you can't hand off.
A checklist before you hit enter
- Did I say what's out of scope, not just what's in?
- Did I name the files, or at least the boundaries of the change?
- Are the data shapes from real types and docs, or from memory?
- Did I list the edge cases I already know about?
- Is "done" something that can actually be checked?
- Did I ask the agent to list its assumptions before it starts?
If any answer is no, the agent will answer it for you. Sometimes it'll guess right. A good plan means it doesn't have to guess.