Skip to main content

Human-in-the-Loop Approval

Some actions are too risky to block outright, but too risky to approve automatically. Auditail's require_approval rule action pauses execution and routes the request to a human for sign-off.

Coming in Full SDK

The require_approval flow requires the full Auditail backend. Join the beta to get early access.

In the preview SDK, require_approval rules behave like block rules.


How It Works​

Agent Action
↓
aegis.guard() → rule with action: 'require_approval' fires
↓
Auditail sends a Slack / email notification to your team
↓
Human clicks Approve or Deny
↓
aegis.guard() resolves with approved: true / false
↓
Agent proceeds or aborts

Setup​

import { Auditail, GuardrailRule } from 'auditail-sdk';

const requireApprovalForLargeTransfers: GuardrailRule = {
name: 'large-transfer-approval',
description: 'Transfers over $10,000 require human approval.',
condition: (opts) => {
const amount = opts.payload?.amount as number | undefined;
return (amount ?? 0) > 10_000;
},
action: 'require_approval', // pauses — doesn't outright block
};

aegis.addRule(requireApprovalForLargeTransfers);

The Approval Notification (full SDK)​

When a require_approval rule fires, your team receives a notification with:

  • What action was attempted
  • Which agent attempted it
  • The full payload (with any sensitive fields masked per your config)
  • Approve / Deny buttons

The notification is sent to your configured channels: Slack, email, PagerDuty, or webhook.


Timeout Behavior​

If no human responds within the configured timeout (default: 30 minutes), the action is automatically denied. This is configurable per rule.


Audit Trail​

Whether approved or denied by a human, the full approval chain is logged:

{
"auditId": "aeg_1a2b3c_x9z4k7",
"action": "transfer_funds",
"approved": true,
"approvalChain": [
{
"reviewerId": "user_finance_lead",
"decision": "approved",
"timestamp": "2025-01-15T10:35:12Z",
"note": "Verified with client over phone."
}
]
}