Skip to main content
An interruption is a successful suspension of an agent run, not an execution error. A paused result carries Interrupts, identifying the calls waiting for approval or input. Persist conversation history so the next invocation can recover those pending calls.

Require approval

For a typed function tool, pass hastekit.WithNeedsApproval(true). For a custom tool, set BaseTool.RequiresApproval. For MCP tools, use mcpclient.WithApprovalRequiredTools. The agent asks for approval before executing the action. Unrelated calls that do not require approval may already have completed. Rejecting a pending call does not undo those actions.

Resume from Go

This function resumes every interrupt in paused with an approval. In an application, build the resolutions from actual user decisions rather than approving automatically:
Use InterruptActionReject for rejection. For forms, include the submitted values in InterruptResolution.Content, following the interrupt’s schema. Match the exact call ID and the original namespace/thread. Inspect the resumed result again: it can pause for another decision.

Custom interruptions

A custom tool can return an interruption and serialized StateUpdates describing how to continue. On re-entry, inspect ToolCall.ShouldResume, State, and ResumeMessages. Do not repeat the already-completed side effect when processing a resolution. Agent-as-tool, MCP elicitation, and workflow-as-tool integrations use this continuation mechanism. workflow.Pause belongs to workflow nodes; it is not the return protocol for a general agent tool.

UI and persistence

The embedded AG-UI client renders approval/form interruptions and submits resolutions. Your HTTP layer must authenticate the user and authorize access to the resolved namespace. A paused local agent can resume after restart when its conversation state is persisted and the same tools remain available. This does not make arbitrary code executing before the pause crash-safe. Use a durable runtime and idempotent external operations when retries or worker failures must be handled.