Overview
How might we design sandbox preview so people can trust and act on AI output?
When this pattern fits
- Essential for agentic automation, bulk admin tools, and cross-app workflows where users need to trust a manifest of effects before granting execution rights.
When to skip or lighten it
- Read-only assistants with no side effects to preview.
- Trivial single-line edits where a full sandbox is slower than an inline diff.
- When the sandbox cannot faithfully mirror production permissions, false previews are worse than none.
States
State model coming soon
Key UX elements
Key UX elements coming soon
Anti-patterns to avoid
Previews that omit irreversible effects present in the real plan.
Execute buttons that skip sandbox after the first approval forever.
Sandboxes that mutate production data “just a little.”
Walls of logs with no human-readable summary of blast radius.
How products use it
| Product | Implementation |
|---|---|
| Terraform plan | Infrastructure dry-run listing creates/updates/destroys before apply. |
| CI dry runs | Pipeline simulation or plan jobs before merging agent changes. |
| Email merge previews | Sample personalized messages before bulk send. |
| Agent plan-then-act modes | Visible plan and file diffs prior to apply in coding agents. |
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 "Sandbox Preview" AI interface design pattern.
Pattern Definition:Frequently asked questions
What is sandbox preview for AI agents?
Sandbox preview is a dry-run of the agent’s plan that shows intended side effects (diffs, recipients, resources) before anything irreversible runs in production.
How does it differ from suggest / confirm / execute?
Suggest/confirm/execute is the autonomy policy. Sandbox preview is the artifact users review during confirm, what would happen if they approve.
What should a preview always include?
Targets, actions, reversible vs irreversible flags, and estimated cost or blast radius. Link to the exact payload when possible.
Is a diff enough?
For code, often yes. For email, purchases, or infra, show the semantic receipt (who/what/how much) not only raw blobs.