From Plan to Action: How Well Do Agents Follow the Plan?

Shuyang Liu, Saman Dehghan, Jatin Ganhotra, Martin Hirzel, Reyhaneh JabbarvandarXiv 2026 · DOI

TL;DR

While AI agents are routinely given structured, step-by-step plans in their system prompts, they frequently deviate from them due to training biases and context window pressure. This paper introduces the first systematic framework to measure agent plan compliance, demonstrating that while following a plan correlates with task success, bad plans actively destabilize agents, and periodic reminders are crucial for keeping long-horizon trajectories on track.

What Problem Does This Paper Address?

When building LLM-based agents for complex tasks like software engineering, developers typically hardcode an advisory workflow into the system prompt (e.g., "First navigate the codebase, then reproduce the bug, patch it, and finally validate your fix"). However, because these plans are not strictly enforced, the agent's actual behavior is driven by a local reason-act-observe loop. As the context window fills up with error messages and code snippets, the original plan is easily forgotten.

Until now, it was impossible to know whether an agent succeeded through genuine strategic reasoning or through shortcuts like benchmark overfitting and data contamination. This paper addresses this gap by formalizing and measuring plan compliance—evaluating whether agents actually do what they are told, when they are told to do it.

Methods

The authors developed a process-centric analysis pipeline using two structural abstractions:

  • Graphectory: Maps linear agent trajectories into an enriched graph structure of actions and chronological execution orders.
  • Langutory: Translates these raw actions into an abstract language sequence based on a plan alphabet: Navigation (N), Reproduction (R), Patch (P), Validation (V), and General.
Figure 1: Illustrative examples of agent trajectories and their corresponding Graphectory and Langutory representations. Plan: L★(Φ) = N R P V .

Using these mappings, they introduce a novel Plan Compliance (PC) metric scored across three dimensions:

  1. Plan Phase Compliance (PPC): Did the agent execute all the required phases?
  2. Plan Order Compliance (POC): Did the agent execute the phases in the correct relative order?
  3. Plan Phase Fidelity (PPF): Did the agent avoid executing spurious, out-of-plan actions?

The overall PC score is calculated as the geometric mean of these three sub-metrics. The authors evaluated the SWE-agent scaffold across four state-of-the-art LLMs (GPT-5 mini, DeepSeek-V3, DeepSeek-R1, and Devstral-small) under eight distinct plan variations (e.g., removing phases, reordering steps, adding extra tasks, or injecting periodic reminders).

Datasets

The evaluation was conducted on two major software engineering benchmarks:

  • SWE-bench Verified: A subset of 497 real-world GitHub issues curated to ensure reliable human evaluation and minimize evaluation noise.
  • SWE-bench Pro: A more challenging dataset consisting of 266 Python instances explicitly designed to minimize LLM training data contamination through strict licensing constraints.

Key Insights and Ideas

  • Agents Fall Back on Internalized Workflows: When the plan is completely removed, agents don't act randomly. Instead, they default to workflows internalized during their instruction tuning. For instance, without a prompt, DeepSeek models immediately drop reproduction and validation phases entirely, defaulting to a strict "Navigate and Patch" approach.
  • A Bad Plan is Worse Than No Plan: Providing an incomplete or poorly structured plan degrades agent performance significantly more than providing no plan at all. Subpar plans disrupt the agent's internal reasoning loop and frequently trigger tool-calling format errors.
  • Context Window Amnesia is Real: As an agent's trajectory grows, the initial system prompt loses its salience. The authors discovered that periodic plan reminders (re-injecting the plan every 5 steps) successfully mitigate plan drift and consistently boost task success rates.
  • Agents Prioritize Efficiency Over Blind Obedience: When intentionally given a suboptimal plan order (e.g., patching code before navigating or reproducing the bug), capable models will actively override the prompt instructions to follow a more logical internal problem-solving strategy.

Key Results

  • Compliance Correlates with Success: Across almost all models, plan compliance scores were significantly higher on resolved benchmark instances than on unresolved ones.
  • Model-Specific Behaviors: Devstral-small achieved near-perfect phase and order compliance (PPC/POC ~ 0.99) but lower fidelity (PPF ~ 0.80) because it frequently ran uninstructed regression tests. Conversely, DeepSeek-R1 struggled with compliance, often getting stuck in tool-calling failure loops.
Plan compliance metrics across different LLMs on resolved vs. unresolved tasks.
  • The Harder the Task, the Lower the Compliance: On the more rigorous SWE-bench Pro benchmark, overall plan compliance dropped by an average of 13%. The agents spent the majority of their token budget trapped in repetitive navigation and patching loops, rarely making it to the validation phase.

Limitations and Future Work

While the framework is conceptually generalizable to any domain (like scientific discovery agents), this study focused exclusively on software engineering and program repair.

The authors conclude that current prompt-engineering methods are hitting a ceiling. Rather than hardcoding rigid, task-specific workflows into system prompts, future research should focus on post-training paradigms that explicitly teach LLMs how to follow, monitor, and adaptively refine structured plans during long-horizon execution.

Summary updated

Abstract

Agents are commonly instructed to follow a task-specific plan for guidance. However, it is unknown to what extent agents actually follow instructed plans. Without such an analysis, determining the extent agents comply with a given plan, it is impossible to assess whether a solution was reached through correct strategic reasoning or through other means, e.g., data contamination or overfitting to a benchmark. This paper presents the first extensive, systematic analysis of plan compliance in programming agents, examining 21,120 trajectories from SWE-agent across four LLMs on SWE-bench Verified and SWE-bench Pro under eight plan variations. Without an explicit plan, agents fall back on internalized workflows during training, which are often incomplete, overfit, or inconsistently applied. Providing the standard plan improves issue resolution, and we observe that periodic plan reminders can mitigate plan violations and improve task success. A subpar plan hurts performance even more than no plan at all. Surprisingly, inserting additional task-relevant phases in the early stage can degrade performance, particularly when these phases do not align with the model's internal problem-solving strategy. These findings call for fine-tuning paradigms that teach models to follow instructed plans, rather than encoding task-specific plans in them, so that they reason and act adaptively, rather than memorizing workflows.
BibTeX
@misc{liu2026from,
  author = {Shuyang Liu and Saman Dehghan and Jatin Ganhotra and Martin Hirzel and Reyhaneh Jabbarvand},
  title = {{From Plan to Action: How Well Do Agents Follow the Plan?}},
  year = {2026},
  eprint = {2604.12147},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.12147},
}

Loading related content...

Figure