Why your AI agent fails before it has started

The problem isn't the model
Over the past few months I've watched a lot of teams bring AI agents into their workflows.
The pattern is always the same.
Task in. Result out. Result bad. Adjust the prompt. Again. Bad again. Frustration. "The model just isn't good enough."
The model is almost never the problem.
The problem is what happens before the first token.
What an agent needs
When you give an agent a task, in the background it does exactly what a new employee does on their first day.
It looks at what was asked.
It starts.
And at some point, in the middle of the work, it asks itself the question that decides everything: Am I done?
If you haven't given it an answer to that, it makes one up.
Sometimes it guesses right. Mostly not.
Definition of Done isn't developer jargon
Classic software development has the concept of the "Definition of Done". It's the criterion a task has to meet before it counts as complete.
Not "I did my best".
Not "it looks roughly like what was asked for".
Concrete. Measurable. Unambiguous.
I've noticed that this exact concept is the difference that decides whether an AI project works on the first run or needs ten iterations.
The agent doesn't use your Definition of Done as a nice bit of orientation.
It uses it as the yardstick.
Actively.
It checks itself against it. Corrects itself. Keeps adjusting the result until the conditions are met.
If you give it a precise definition, it works like a pro.
If you don't give it one, it works like someone you told "get it done somehow" before you walked off.
Acceptance Criteria: the second step most people skip
One level below the Definition of Done sit the Acceptance Criteria.
They don't stop at "when is it done". They answer "what does done look like, in concrete terms".
In practice this means you write down before you start:
What the result has to contain.
What it must not contain.
Which quality standards apply.
How the output should be structured.
That sounds like extra work.
It is extra work.
And it almost always pays off, because you take it on once instead of dodging it ten times and ending up with it anyway.
Why both big providers have understood this
OpenAI and Anthropic have built iterative feedback loops into their coding harnesses. That means the agent runs a task, evaluates the result, and corrects course when something is off.
That's no coincidence.
It's the answer to exactly the problem I described above.
The loop is the safety net.
But the safety net only works if the agent knows which standard it is measuring its result against.
A loop without a Definition of Done is an agent that circles forever and never lands.
What this means for your own work
The next time you send an agent off, take ten minutes.
Write down when the task is complete. Not vague. Concrete.
Write down which conditions the result has to meet. Not as a wish list. As criteria.
If you don't put in these ten minutes, you'll put them in later anyway. Spread across iterations, frustration and the feeling that the model somehow never delivers what you had in mind.
Most AI projects don't fail on the intelligence of the model.
They fail on an unclear brief.
That's not a technical challenge.
It's a communication challenge.
And that one is entirely in your hands.
FAQ
What is a Definition of Done for AI agents?
A Definition of Done is a concrete criterion that sets when a task is complete. It comes from software development, where it was used to draw clear lines around tasks. For AI agents it is the yardstick the agent uses to check and correct its own result.
What is the difference between Definition of Done and Acceptance Criteria?
The Definition of Done answers the question of when a task is finished. Acceptance Criteria go one step further and set what the finished result has to look like in concrete terms, meaning what has to be in it and what doesn't. Together they give an agent a clear frame instead of vague instructions.
Why does my AI agent deliver bad results even though the model is good?
Usually the cause isn't the model. It's a missing or unclear task description. If the agent has no clear rule for when a task is done, it has to guess and often makes wrong assumptions. A precise Definition of Done and clear Acceptance Criteria usually fix this without switching models.
What does an iterative feedback loop do in an AI agent?
An iterative feedback loop lets an agent carry out a task, rate the result itself and improve it when needed. That's how OpenAI and Anthropic do it in their coding harnesses. But the loop only works if the agent has a clear standard to measure its result against. Otherwise it corrects without a target.
How do I write Acceptance Criteria for an AI agent?
Before you start, you write down what the result has to contain, what it must not contain, which quality standards apply and how the output should be structured. You phrase these criteria in concrete terms, not as a wish list. That way the agent can actively check its result against them instead of guessing.