Platform FeaturesHuman-in-the-Loop

Human-in-the-Loop

Pause agent execution and wait for human approval before any dangerous action proceeds.

How it works

1

Agent sends event via SDK

The event is evaluated by the Rules Engine.

2

Rule matches → require_approval fires

The platform creates an approval request.

3

Notification sent

Email + Slack notification to the assigned reviewer.

4

Admin reviews in Dashboard → Approvals

Full context: event, metadata, risk score, agent info.

5

Admin approves or rejects

Decision recorded with timestamp and reason.

6

Agent receives response

SDK polling resolves with the decision.

Timeout Behavior

OptionBehaviorRecommended for
auto_block (default)Action blocked automaticallyFinancial, delete, export
auto_approveAction proceeds with warningLow-risk actions only
escalateForwarded to next roleEnterprise critical

Default timeout: 30 minutes. Reminder sent 5 minutes before expiry.

Escalation Chains

Business/Enterprise plans support multi-level escalation:

  1. L1: developer@company.com (15 min)
  2. L2: techlead@company.com (15 min)
  3. L3: cto@company.com (30 min)
  4. AUTO-BLOCK if no response
class=class="tk-str">"tk-cmt">// Handle approval required
const result = await ai.action(class="tk-str">'process_payment', {
  resource: class="tk-str">'stripe',
  amount: 42000,
  currency: class="tk-str">'EUR',
  severity: class="tk-str">'high',
})

if (result.status === class="tk-str">'blocked') {
  throw new Error(class="tk-str">'Payment blocked by governance rule')
}

if (result.status === class="tk-str">'pending_approval') {
  console.log(class="tk-str">'Waiting for human approval...')
  const decision = await ai.waitForApproval(
    result.approvalId,
    2000,   class=class="tk-str">"tk-cmt">// poll every 2s
    300000  class=class="tk-str">"tk-cmt">// timeout 5min
  )

  if (decision.status === class="tk-str">'approved') {
    console.log(class="tk-str">'Approved by:', decision.reason)
    await processPayment(...)
  } else {
    console.log(class="tk-str">'Denied:', decision.reason)
    class=class="tk-str">"tk-cmt">// abort
  }
}