How to Stop an AI Agent Going Off Track (Scope Creep for Agents)
To stop an AI agent going off track, separate ideas from execution: make it work one task to completion, and send every new idea it has to a parking section in the backlog instead of building it now. Agents drift because they are capable and eager, not careless - the fix is structure, not a sharper prompt. When the boundary between "capture this" and "build this" is written down, the agent stops improvising scope and starts finishing what it started.
Here is the clean-gap observation almost nobody names: scope creep is treated as a project-management problem for teams of people, but a single AI agent creeps scope worse than any team, because it is fast, tireless, and it genuinely notices the adjacent thing. You ask it to fix a login form and it starts refactoring the whole auth module, renaming variables, and drafting a migration - each step defensible, the pile as a whole a mess. The agent was not being sloppy. It was being helpful with no structure telling it where helpful ends.
Why do agents drift off task?
Agents drift because they are eager and capable at the same time: they see adjacent improvements the moment they are in the code, and nothing in a plain "do the task" instruction tells them to stop and park what they noticed. A human junior might spot the same three improvements and hold them in their head until standup. An agent has no standup and no natural pause - the instant it perceives a better nearby thing, acting on it is the path of least resistance, so it acts.
The capability is the trap. A weaker tool could not wander far because it could not do the adjacent work; a strong agent can, so a vague task becomes an open invitation to do everything it can see. The failure mode is not laziness or confusion - it is competence pointed at an undefined edge. That is why sharpening the prompt on the main task rarely helps: the drift does not come from misunderstanding the task, it comes from the agent finding a second, third, and fourth task and treating each as fair game. What is missing is a place to put those extra tasks that is not "start now."
Our fix is three mechanisms that make the boundary structural rather than a matter of the agent's judgment in the moment:
- One task at a time, taken to completion. The agent works a single item all the way to done before touching the next, and it is explicitly told never to leave five things half-finished. Completion is the unit, so an unfinished tangent is visibly wrong, not just a detour.
- New ideas get parked, not built. There is an "Ideas" section in the backlog file where anything the agent thinks of goes to be written down and left alone. A recorded idea is not a green light - parking it is the whole action, and building it is a separate, later decision that the backlog makes on purpose.
- Priorities are read at the start of every session. The agent reads its P0-P2 priority list first thing, so it always resumes on the top unblocked item rather than on whatever looks shiny that day. The starting point is chosen by the list, not by the most recent interesting thought.
Drift on ideas is fine and even valuable - you want the agent noticing things. Drift on execution is the enemy. The three mechanisms let the first happen freely while making the second structurally awkward. For the task-writing side of this, see how to write a task an AI agent cannot misunderstand.
Where do new ideas go instead of getting built?
New ideas go into a parking section in the backlog, to be prioritized later, not executed now. The backlog file has a dedicated "Ideas" heading, and the rule in the agent's instructions is blunt: when you think of something worth doing that is not the current task, write it there and keep going. The idea is preserved, the momentum on the current task is preserved, and nothing new gets built on impulse.
The reason this works is that it removes the false choice the agent otherwise faces. Without a parking spot, an agent that notices a good improvement has only two options - do it now or lose it - and a capable, helpful agent will nearly always choose to do it now. The parking section adds a third option that is cheaper than both: record it in one line and move on. Losing the idea is no longer a risk, so acting on it immediately is no longer justified.
Prioritization then happens deliberately, not in the heat of the moment. Parked ideas are reviewed when the current task is genuinely done, weighed against everything else in the backlog, and promoted to a real task only if they earn a priority slot. That is the difference between a system that captures everything and builds the right next thing, and an agent that builds whatever it thought of last. The backlog decides what gets built; the agent decides only what to write down.
FAQ
Should I interrupt a drifting agent?
Yes. Redirect it to the one task it was on and have it park the tangent as an idea in the backlog. A quick redirect now is far cheaper than a half-finished pile of adjacent changes you have to untangle later. The correction is not "stop being helpful" - it is "write that down and finish this." Interrupting early keeps the current task shippable and turns the stray idea into recorded backlog input instead of unfinished work.
How do I phrase task boundaries?
State three things: the single goal, the definition of done, and an explicit "do not do X; if you think of X, add it to the ideas list." Writing the boundary makes it real - an implied boundary is one the agent will not see and cannot honor. Naming the tempting adjacent work directly, and giving it a parking place in the same sentence, is what turns "please stay focused" into an instruction the agent can actually follow.
Is drift ever useful?
The ideas are often good; the execution timing is the problem. An agent noticing adjacent improvements is a feature, because those notes frequently become the best items in your backlog. What you do not want is the agent acting on them mid-task. Capture the idea, keep executing the current task, and let the backlog decide what gets built next. Useful drift is a well-fed ideas list, not a trail of half-done work.