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
approvedstatus 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
generateObjectfor 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.
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
- 1Discovery2–4 wks
List action types that may never auto-execute; map approver roles in Entra ID or Okta.
- 2Pilot6–8 wks
Queue 100% of writes for two weeks; measure decision latency and override reasons.
- 3Scaleongoing
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.