What it is: Scope drift is the gradual expansion of an AI coding agent’s work beyond the task you asked for — adjacent refactors, surprise rewrites, “while-I’m-here” changes. One of the most common AI-coding-agent reliability failures. Fixed at the harness layer, not the model layer.
Who it is for: Developers who’ve asked for a contact form and got a 400-line PR back.
Best if: You want a short reference on what scope drift is and how to stop it.
Skip if: You only use AI for single-line edits where drift is impossible. Want one practical AI workflow every morning? Subscribe to our free daily newsletter.
What is Scope Drift (AI agents)?
Scope drift is what happens when you give an AI coding agent a bounded task and the agent gradually expands the work into adjacent areas you didn’t ask for. The classic shapes: you ask for a contact form, the agent also adds analytics tracking and refactors the routing layer. You ask for a bug fix, the agent “improves the testing infrastructure” on the way. The pattern is named in Anthropic’s, OpenAI’s, and Walking Labs’ harness-engineering documentation.
Why does Scope Drift (AI agents) matter?
Scope drift is one of the most common reliability failures and is almost entirely solvable at the harness layer. Switching to a smarter model doesn’t help. The cause is structural: open-ended prompts plus training-to-be-helpful plus no persistent anchor to return to. By message 20 in a session, the agent’s working memory is dominated by recent file reads, not the original goal. Addy Osmani: “Over many context windows, agents drift. The original goal gets summarized, then re-summarized, then loses fidelity.”
How does Scope Drift (AI agents) work?
Three forces drive drift. Helpful-by-default training: models are trained to be proactive — if they see something they could improve, they often will. Open-ended prompts: without an explicit list of what’s in scope, the agent’s working definition of “the task” expands to match whatever’s interesting in the surrounding code. No anchor: chat history alone loses the original goal by message ~20.
The fix is a feature list with an explicit out_of_scope array, plus the AGENTS.md instruction that the agent must refuse or escalate when asked for something not on the list. See our full guide for the implementation pattern.
Related terms
Learn more on Beginners in AI
Sources and further reading
- Anthropic — Effective harnesses for long-running agents
- Addy Osmani — Long-running agents
- Martin Fowler — Harness engineering
Last reviewed: May 2026. AI terminology evolves quickly — verify specifics on the official source pages above.
Get Smarter About AI Every Morning
Free daily newsletter — one term, one tool, one tip. Plain English.
Free forever. Unsubscribe anytime.
You may also like
- Feature Lists for AI Coding Agents
- Why AI Coding Agents Fail
- Harness Engineering for Beginners
- Feature list
- AGENTS.md
- Context rot
- AI Glossary
Two ways to go further
The AI Prompt Library
1,000+ ready-to-use prompts for Claude, ChatGPT, and Gemini. Stop staring at a blank box.
Get it for $39 →2-Hour Live AI Crash Course
A private, beginner-friendly session across Claude, ChatGPT, Gemini, and the wider landscape.
Book for $125 →