PluginsApproval Workflow

Approval Workflow

@agorio/plugin-approval-workflow inserts a human approval gate before high-value checkouts. When a checkout exceeds the configured threshold, the plugin halts the run in onBeforeToolCall and waits for an out-of-band approval decision.

import { approvalWorkflow } from '@agorio/plugin-approval-workflow';
 
const agent = new ShoppingAgent({
  llm,
  plugins: [
    approvalWorkflow({ threshold: 100000 }), // gate checkouts over this amount
  ],
});

Session-resume support

Approval is inherently asynchronous — a person may approve hours later, after the process has exited. This plugin implements both getState?() and hydrate?(state), so a pending approval survives a process restart when paired with session storage. On resume, the agent picks up exactly where it paused.

It’s MIT-licensed and published as @agorio/plugin-approval-workflow.