Loading AgentsKit ecosystem navigation…
AgentsKit Chat
Components

Approval request

Human-in-the-loop gate for side effects. Component key `approval-request`.

View canonical Markdown

Approval request

approval-request is an approve / deny UI for a proposed side effect. Pair with Action policy and durable Confirmation.

Live preview

Approval request
Approve / deny for a proposed side effect.
approval-request

Approve send?

Send the email.

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

When to use

  • Tools that must not run until a human approves
  • Email send, payments, destructive admin actions

Prefer something else when

  • Generic product confirm without tool policy → confirmation
  • Choice among many options → choice-list

Props (schema)

FieldTypeNotes
titlestringRequest title
descriptionstringWhat will happen if approved
approveLabelstringApprove control
denyLabelstringDeny control

Frame example

code
{
  "protocol": "agentskit.chat.component",
  "version": 1,
  "type": "render",
  "componentKey": "approval-request",
  "instanceId": "approval-request-fixture",
  "props": {
    "title": "Approve send?",
    "description": "Send the email.",
    "approveLabel": "Approve",
    "denyLabel": "Deny"
  },
  "fallback": {
    "kind": "approval-request",
    "summary": "Approval required."
  }
}

Events

EventValueMeaning
approvenoneUser approved
denynoneUser denied

Host wiring

This component is a UI intent channel. Pair it with Action policy and durable Confirmation when tools must not run without a human.

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

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

export function App() {
  return (
    <AgentChat
      definition={definition}
      onComponentInteract={(event) => {
        // Always type: 'interact' — branch on event.event
        if (event.componentKey !== 'approval-request') return
        if (event.event === 'approve') {
          // host side-effect or confirmation.approve(token, sessionId)
        }
        if (event.event === 'deny') {
          // confirmation.reject(...) or cancel the proposed action
        }
      }}
    />
  )
}

For agents

FieldValue
componentKeyapproval-request
ExportApprovalRequestComponent
Protocolagentskit.chat.component v1
Envelopetype: "render" + instanceId + props + fallback
Eventsapprove (none), deny (none)
Host callbackonComponentInteract
Event shapetype always interact; event is approve or deny (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