When should an AI agent replan?
An AI agent should replan when new information makes the current plan invalid, inefficient, blocked, or unsafe.
Replanning is useful when the next planned step is no longer the best way to reach the goal.
When a required step fails
Suppose the plan is:
- retrieve customer data
- generate report
- email report
If the customer-data tool is unavailable, repeating the same plan may not help.
The agent may need to:
- use an approved fallback source
- ask the user for missing data
- delay the dependent step
- stop safely
When an assumption turns out to be wrong
Plans are often based on assumptions.
For example:
Assumption: The requested product is in stock.
If the inventory check returns zero, the remaining plan should change.
The agent may now:
- search another warehouse
- find alternatives
- ask the user to choose
When the user changes a constraint
A user may change:
- budget
- deadline
- destination
- preferred option
- required output
If the new constraint affects future steps, the agent should update the remaining plan.
It should not continue following instructions that are no longer relevant.
When required information is missing
Suppose the next step needs a customer ID, but none is available.
The agent may need to insert a new step:
find customer → obtain customer_id → continue
Missing dependencies are a strong signal that the plan needs adjustment.
When permissions or approvals change
An action may turn out to require:
- additional permission
- human approval
- a different role
- tenant-specific authorization
The plan should be updated to include the required approval or choose a permitted alternative.
When a better valid path becomes available
Replanning is not only for failures.
Suppose the agent originally planned three API calls, but a newly available tool can safely retrieve the required information in one call.
If the alternative is permitted and reliable, the agent may simplify the remaining plan.
When the environment changes
External systems can change while an agent is working.
Examples include:
- a flight becomes unavailable
- a meeting slot is taken
- an API goes offline
- a file is updated
- inventory changes
- a job finishes earlier than expected
Longer-running tasks especially benefit from checking whether the plan still matches reality.
When the agent is making no progress
Repeatedly performing the same steps without moving toward the goal is a sign that replanning may be needed.
For example:
search → same result → search → same result → search
Instead of looping, the agent should consider:
- a different tool
- a different query
- asking the user
- stopping
When an intermediate result changes the next decision
Some plans intentionally contain decision points.
For example:
- check account status
- decide next action
If status = active:
- continue
If status = suspended:
- follow the suspension workflow
The observation determines which part of the plan should remain.
When the current path becomes unsafe
The agent should replan if continuing would violate:
- permissions
- policy
- budget
- safety rules
- approval requirements
For example, if an operation now requires human approval, the agent should insert that approval step instead of continuing automatically.
When should the agent not replan?
Not every failure needs a new plan.
If a temporary network timeout occurs and the same action is still correct, a bounded retry may be enough.
Replanning is more appropriate when the path itself needs to change.
A useful distinction is:
Retry: Same action, another attempt.
Replan: Different remaining path.
Replanning should preserve valid completed work
If earlier steps succeeded, the agent should keep those results unless they are no longer valid.
For example:
- customer identified — completed
- report generated — completed
- email delivery failed
The agent should normally replan around delivery rather than recreate the report.
Replanning should have limits
An agent should not replan forever.
Useful boundaries include:
- maximum replan count
- time budget
- cost budget
- retry limits
- escalation rules
- stopping conditions
If the agent cannot find a valid path after several attempts, it may need to ask the user or stop safely.
A practical decision rule
Before continuing with the next step, the agent can ask:
- Is the current goal still the same?
- Is the next step still valid?
- Are its dependencies satisfied?
- Are the required tools and permissions available?
- Has new information changed the best path?
- Is the plan still making progress?
If the answer to one of these questions indicates the plan is no longer suitable, replanning may be appropriate.
In short
An AI agent should replan when new observations, failures, changing constraints, missing dependencies, permission changes, or stalled progress make the current path unsuitable.
It should avoid replanning for every minor issue, preserve completed work whenever possible, and use bounded replanning so the agent can adapt without falling into endless planning loops.
Learning Sequence
AI Agents Curriculum
Explore Related Questions
Deepen your understanding across related AI Agents topics.