Prompt LibraryAgents
Agent Replanning & Error Recovery Prompt
Decide when an agent should replan vs. retry vs. escalate.
The prompt
An agent executed the following plan step and got this result. Decide the next action:
- RETRY (same step, same args) — only if the failure is transient and idempotent.
- REPLAN (rewrite remaining steps) — if the environment changed or assumptions broke.
- ESCALATE (ask a human) — if the step is irreversible or confidence is below threshold.
Output a JSON object: { action, reason, revised_steps (if replan), confidence_0_to_1 }.
Step attempted: {{step}}
Result / error: {{result}}
Remaining plan: {{remaining}}Replace the {{fields}} with your own context and tighten the rules to match your domain.
More Agents prompts
AI Agent Memory Policy Design Prompt
Decide what an agent should remember across sessions and for how long.
Agent Context Injection & Memory Loading Prompt
Decide what to load into context at each agent step.
Agent Prompt-vs-Tool Boundary Decider Prompt
Decide if a capability belongs in the prompt or a tool.



