An agent deployed to a production repository begins making file changes immediately upon receiving a user prompt, without first outputting a plan. What anti-pattern does this represent, and what is the best mitigation?
Select an answer to reveal the explanation.
Short Explanation and Infographic
A surgeon who picks up the scalpel before reviewing the X-rays is going to have a bad day — and so will your codebase. Acting before planning is the most common agentic anti-pattern. The fix is to force the agent to produce a human-readable plan first, get that plan validated, then execute.
Full explanation below image
Full Explanation
The act-before-plan anti-pattern occurs when an agent begins executing actions before articulating and validating its intended approach. In agentic AI development, this is dangerous because early actions may be irreversible (deleting files, pushing commits, calling external APIs) and may not align with what the developer or team actually wanted.
Why B is correct: The correct mitigation is to configure a planning phase that is separate from the execution phase. The agent should output a structured plan — often as a markdown file, a PR description, or a GitHub check run comment — that can be reviewed before any action is taken. This is sometimes called 'plan-then-act' or 'inspect-before-execute.'
Why A is wrong: Limiting API calls addresses unbounded autonomy (a different anti-pattern) but does not address the root issue, which is that the agent acts before reasoning about its approach. An agent can still cause harm with a single, well-aimed but unvalidated action.
Why C is wrong: Input sanitization is a security concern related to prompt injection, not a mitigation for premature execution. Skipping validation is a related but distinct anti-pattern.
Why D is wrong: Context drift is about the agent losing track of its original goal over a long conversation. It is not what is described here and is not solved by increasing context window size alone.