Overview
How might we design self-correction so people can trust and act on AI output?
When this pattern fits
- Essential for autonomous AI agents, coding assistants, and automated workflow tools where self-recovery from errors improves reliability and user trust.
When to skip or lighten it
- One-shot answers where retries would surprise the user with extra cost.
- Domains where automatic retries can amplify damage (notify and stop instead).
- Creative tasks where “wrong” is subjective and user taste should drive edits.
States
State model coming soon
Key UX elements
Key UX elements coming soon
Anti-patterns to avoid
Endless retry loops with no budget or user cancel.
Corrections that hide the original failure evidence.
Claiming success after a partial fix that still fails checks.
Burning tokens on retries without showing cost impact.
How products use it
| Product | Implementation |
|---|---|
| Cursor | Agent retries after command failures with updated plans. |
| GitHub Copilot | Iterative fix suggestions when prior code fails. |
| AutoGPT-style agents | Loop on errors with revised steps in the task log. |
| LangChain agents | Tool error handling and re-planning in traces. |
Implementation
Copy this prompt to generate a production-ready implementation in Cursor, Claude Code, Lovable, or any AI coding agent.
Generate a production-ready implementation of the "Self-Correction" AI interface design pattern.
Pattern Definition:Frequently asked questions
What is self-correction in agent UX?
Self-correction is when the agent notices a failure or inconsistency and attempts a fix, while showing the error and the revised step to the user.
How is it different from a repair contract?
Self-correction is initiated by the agent. A repair contract is initiated by the user with explicit keep/change constraints.
How many retries are safe?
Cap retries with a budget and escalate to the user after repeated failure. Show the count and stop reason.
What should the UI show during correction?
The failed step, the hypothesized cause, and the next attempt. Collapsed traces are fine if expand reveals detail.