Loading AgentsKit ecosystem navigation…
AgentsKit Chat
Components

Confirmation

Binary human gate for sensitive steps. Component key `confirmation`.

View canonical Markdown

Confirmation

confirmation is a confirm / cancel pair for a sensitive step that is not necessarily a full tool approval (see approval-request for tool side effects).

Live preview

Confirmation
Confirm / cancel pair for a destructive or sensitive step.
confirmation

Delete?

This cannot be undone.

Demos use docs host CSS. Package primitives are intentionally unstyled so your product theme owns the look.

When to use

  • Delete, overwrite, or irreversible product actions
  • When the model must stop until a human picks yes or no

Prefer something else when

  • Tool execution under policy → use durable Confirmation + approval-request as needed
  • Multi-option branches → choice-list

Props (schema)

FieldTypeNotes
titlestringHeading
messagestringBody explaining the risk
confirmLabelstringConfirm button
cancelLabelstringCancel button

Frame example

code
{
  "protocol": "agentskit.chat.component",
  "version": 1,
  "type": "render",
  "componentKey": "confirmation",
  "instanceId": "confirmation-fixture",
  "props": {
    "title": "Delete?",
    "message": "This cannot be undone.",
    "confirmLabel": "Delete",
    "cancelLabel": "Cancel"
  },
  "fallback": {
    "kind": "confirmation",
    "summary": "Confirm deletion."
  }
}

Events

EventValueMeaning
confirmnoneUser confirmed
cancelnoneUser cancelled

Host wiring

code
import { ConfirmationComponent, defineComponentManifest, defineChat } from '@agentskit/chat'
import { AgentChat } from '@agentskit/chat/react'

const definition = defineChat({
  id: 'app',
  components: defineComponentManifest([ConfirmationComponent]),
  chat: { adapter },
})

export function App() {
  return (
    <AgentChat
      definition={definition}
      onComponentInteract={(event) => {
        // branch on event; no value
        // { type: 'interact', componentKey: 'confirmation', instanceId, event: 'confirm' | 'cancel' }
      }}
    />
  )
}

For agents

FieldValue
componentKeyconfirmation
ExportConfirmationComponent
Protocolagentskit.chat.component v1
Envelopetype: "render" + instanceId + props + fallback
Eventsconfirm (none), cancel (none)
Host callbackonComponentInteract
Event shapetype always interact; event is confirm or cancel (no value)
FallbackAlways include fallback.kind + fallback.summary

Do not invent props or events outside the schema. Unknown keys and invalid props stay inert.

Shells

ShellNotes
React / Vue / Svelte / Solid / AngularSame frame; replaceable slots
React NativeAccessibility roles from the catalog definition
InkTerminal-safe fallback when interactive chrome is limited