AI LabsbyThe Ops ToolboxOps Toolbox
All examples
Live demo

Human-in-the-Loop Approval Gates

Supervisors approve or reject CRM updates and refunds before anything runs.

AssistantsGovernanceHuman escalation
Jump to demo

You're the supervisor on a high-risk request — review what the assistant proposes, then approve or reject before anything runs.

Supervisor inbox

Approve or reject before any high-risk update runs.

Support supervisorHigh-risk action review
Live
Scenario: Enterprise credit dispute
Copilot · Proposed actionCreditHigh risk
Customer
C-1001 · Northwind Logistics
Invoice
8842
Credit
USD 500.00
Requester
Tier-1 agent · Maya K.
Case
CS-44921

Customer situation

Case studyArchitecture, governance, and how to adapt this pattern in a pilot

Business use case

Problem

Teams want copilot productivity but cannot grant autonomous writes to billing, CRM, or email on day one.

Who benefits

  • Support leadership, refunds and case updates only after supervisor sign-off
  • Risk & compliance, audit trail of proposed vs executed actions
  • Platform engineering, reusable approval contract across tools

Success metrics

  • 100% of high-risk action types routed to approval in pilot
  • Median supervisor decision time under agreed SLA (e.g. 15 minutes)
  • Zero production writes without approved status in logs

Solution

Model proposes action type, risk, and payload; pending items land in a supervisor queue. Approve or reject before any downstream integration would fire, in production, that gate sits in front of Salesforce, ServiceNow, or internal APIs.

Technical implementation

Stack

  • AI SDK generateObject for structured proposals
  • In-memory approval queue (demo); swap for Postgres + Entra roles in production

Architecture

Proposal and execution are separate; supervisors decide before any write runs.

How it runs
Drawing the flow…

Outcomes and learnings

  • Separate proposal from execution, easier to test and audit
  • Encode risky action types in schema enums, not prompt hope
  • Pair with streaming agent example for full copilot + queue story
Delivery playbookDiscovery → pilot → scale
  1. 1
    Discovery2–4 wks

    List action types that may never auto-execute; map approver roles in Entra ID or Okta.

  2. 2
    Pilot6–8 wks

    Queue 100% of writes for two weeks; measure decision latency and override reasons.

  3. 3
    Scaleongoing

    Persist approvals in SoR; wire Salesforce/ServiceNow only after approved status.

Where else this appliesApproval gates are how you earn write access later, refunds, CRM updates, ticket closes, and outbound email should never fire on model confidence alone.

Billing credits

Agent proposes credit amount; finance supervisor approves before ERP adjustment.

CRM case updates

Status changes and priority bumps queue until team lead confirms customer context.

Marketing sends

Draft campaigns require brand/legal approval before ESP dispatch.

IT access grants

Privileged role requests route to identity team with ticket linkage.

Keep proposal and execution in separate routes; persist queue state in your database and enforce Entra/Okta roles on approve endpoints.