AI Agent Design Patterns

Published

It’s still early days for building user applications with AI but we are starting to see things progress as the industry progresses from LLM workflow to AI agents.

Here I’m cataloging different UI and UX patterns that I find to be useful.

Checkpoints

Examples: Replit, Cursor Best for: applications that make multipled changes all at once in response to the user like writing code, editing a document, or updating a SQL query

When working on a shared artifact with an AI agent, the user is building or iterating on existing output from an AI agent. As the user prompts for changes, these are effectively destructive edits and, if this were typical software, the user would expect a way to undo these edits.

With AI agents, “undo” is more ambiguous. Does that mean undo the last change the agent made? What if there were many edits made all at once?

Checkpoints provide a more explicit way to rollback changes. Explicit because the unit of work is the response from a prompt, not an individual change.

Approvals

Examples: Goose, Claude Code Best for: applications with broad based control and hard to undo side-effects like controlling a web browser or accessing the command line of the user’s computer.

Approvals are important when the user grants access to a powerful environment from which the agent takes action on their behalf. For example, an agent that has full access to the user’s computer should probably ask before deleting anything as the consequences can be severe.

The AI agent detects the sensitive action (usually a tool call or MCP call) and prompts the user for an approval before proceeding.

Escalations

Examples: ??? Best for: autonomous agents that perform actions on behalf of a user where reliability, accuracy, or completion are the highest priority

When an autonomous agent runs into an exception, the best thing to do might be to escalate to a human to take over rather than proceed. For example, an agent responding to a support inquiry might decide it’s unable to answer the customers question and escalate to a human agent.

The AI agent needs to detect the exception (from the example, checking logprobs of the response or an LLM as judge scores the response below an acceptable threshold) and then have a mechanism to escalate to another system.