The outcome
Ensure a model cannot bypass approval for purchases, messages, deletions, deployments, or other material side effects.
CopilotKit is a open-source frontend framework for agentic chat, generative UI, shared state, and human-in-the-loop experiences. Building product-native agent interfaces with chat, custom components, shared application state, frontend tools, streaming, and deterministic human approval checkpoints. This guide narrows that broad capability into one repeatable outcome, with checkpoints that keep the source material and your judgment in the loop.
Before you begin
Set the boundary before the tool starts.
Choose one real task, identify who will use the result, and decide what evidence or test will make the result acceptable. Gather only the source material needed for that task. If the work contains confidential, personal, regulated, or client-owned information, confirm that the platform and account are approved before sharing it.
AI should make the work easier to inspect. If the workflow removes the source, the owner, or the review step, redesign the workflow.
Step by step
A workflow you can repeat.
- 01
Identify the exact action, approver, evidence, expiry, modification rights, rejection path, and idempotency key required for the decision.
- 02
Use a graph-enforced interrupt when approval is mandatory, reserving model-initiated human-in-the-loop tools for optional clarification or expert input.
- 03
Render the complete proposed action with destination, payload, cost, risks, and source evidence; never approve from an ambiguous summary.
- 04
Validate the resumed decision server-side, bind it to the user and pending action, reject stale or replayed responses, and execute the side effect once.
- 05
Test approval, rejection, editing, disconnect, timeout, duplicate resume, backend restart, partial success, audit logging, and safe recovery.
Working standard
What good use looks like.
- Use deterministic interrupts for mandatory gates.
- Bind approval to one exact action.
- Make execution idempotent.
A polished interface does not make an agent action safe. Treat all client input and model tool arguments as untrusted, authenticate users server-side, authorize every resource and side effect, minimize shared state, keep provider keys off the client, use graph-enforced interrupts for mandatory approvals, make resumable actions idempotent, protect against cross-user thread leakage, and trace and test cancellation, retries, and partial failure.
Official references
Check the current product documentation.
Features, plan limits, availability, and data controls change. These official pages are the starting points used for this collection.