Human-in-the-loop approval workflow template
When sipi.bot returns FLAGGED, you need a human to decide. This template gives you the workflow: the notification, the decision interface, and the feedback loop back to the agent.
Approval notification template
🚨 AGENT SPEND REQUIRES APPROVAL
Agent: {agent_name}
Amount: ${amount} USD
Merchant: {merchant}
Category: {category}
Reason flagged: {firewall_reason}
Transaction ID: {txn_id}
View and approve/deny: https://sipi.bot/dashboard/approvals/{txn_id}
This transaction will remain pending until approved or denied.
The agent is waiting for your decision.
The decision prompt
You are reviewing a FLAGGED agent transaction. Consider: 1. Is the amount reasonable for the stated purpose? 2. Is the merchant known and trusted? 3. Does this fit within the project's budget? 4. Is this the right time for this purchase? If APPROVED, the agent proceeds immediately. If DENIED, the agent is told not to retry.
Feedback loop to the agent
When the human approves: the agent receives "APPROVED: human reviewer {name} authorized this transaction. You may proceed." When denied: "DENIED: human reviewer {name} rejected this transaction. Do not retry. Reason: {reviewer_note}."
The agent reads this message as the tool result and continues or stops accordingly. No special agent code needed — the approval resolution is just another tool return value.
Frequently asked
Where do these notifications go?
sipi.bot's dashboard shows the pending approval queue. You can add Slack/email/Discord notification by subscribing to the approval webhook or polling /api/approvals. The template shows the message format; wire it to your notification channel of choice.
What if the human doesn't respond?
The transaction stays in FLAGGED state. The agent's spend tool returns a 'waiting for approval' message. You can set a timeout in your agent code to handle cases where the approver doesn't respond within your SLA.
Can I customize the approval criteria?
Yes. Edit the decision prompt to reflect your organization's specific approval criteria — dollar thresholds, vendor tiers, project codes. The template is a starting point.