← Back to Learn
approval-workflowstutorialagent-safetybest-practices

How to add human approval to AI agent actions

Authensor

Not every AI agent action should be fully autonomous. Some actions are too risky to allow without a human reviewing and approving them first. Authensor's approval workflow system lets you define which actions require approval and routes them to the right reviewers.

When to use approval workflows

Use escalation for actions where the cost of a mistake is high:

  • Financial transactions above a threshold
  • Outbound communications (emails, messages, API calls to third parties)
  • Data deletion or modification
  • Infrastructure changes (deployments, configuration updates)
  • Actions that affect other users or systems

Define escalation rules

In your policy, set the action to escalate for rules that require approval:

rules:
  - tool: "payment.send"
    action: escalate
    when:
      args.amount:
        gt: 100
    reason: "Payments over $100 require human approval"

  - tool: "email.send"
    action: escalate
    when:
      args.to:
        not:
          endsWith: "@yourcompany.com"
    reason: "External emails require approval"

Handle escalation in your agent

When the guard returns escalate, your agent should pause and wait:

const decision = guard('payment.send', { to: 'vendor@example.com', amount: 500 });

if (decision.action === 'escalate') {
  const approval = await requestApproval({
    requestId: decision.receipt.id,
    tool: 'payment.send',
    args: { to: 'vendor@example.com', amount: 500 },
    reason: decision.reason,
    reviewers: ['finance-team']
  });

  if (approval.granted) {
    await executeTool('payment.send', { to: 'vendor@example.com', amount: 500 });
  } else {
    agent.respond("Payment was denied by the finance team.");
  }
}

Approval channels

The control plane supports multiple approval delivery methods:

  • API polling: The agent polls the control plane for approval status
  • Webhook callback: The control plane calls your webhook when approved or denied
  • Slack integration: Sends approval requests to a Slack channel with approve/deny buttons
  • Email: Sends an email with a one-click approval link

Multi-party approval

For high-stakes actions, require multiple approvers:

- tool: "infrastructure.delete"
  action: escalate
  reason: "Infrastructure deletion requires two approvals"
  metadata:
    required_approvals: 2
    approver_roles: ["engineering-lead", "security"]

Timeouts

Set a timeout for approvals. If no human responds within the window, the action is automatically denied. This prevents the agent from hanging indefinitely:

metadata:
  approval_timeout_minutes: 30
  timeout_action: deny

Fail-closed timeouts are the safe default. An action that nobody reviewed should not proceed.

Keep learning

Explore more guides on AI agent safety, prompt injection, and building secure systems.

View All Guides