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
You’re seeing the act-before-plan anti-pattern. Make the agent output a structured plan first, get that plan validated, and only then let it touch files.
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.
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.'
The unbounded-autonomy option with limiting API calls addresses 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.
The skipping-validation option with 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.
The context-drift option with increasing context window size 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.