How I added human-in-the-loop approval to my AI agent in 5 minutes

Published: (February 28, 2026 at 05:57 PM EST)
2 min read
Source: Dev.to

Source: Dev.to

How it works

Instead of your agent acting directly, it POSTs to Queuelo:

curl -X POST https://queuelo.com/api/actions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action_type": "send_email",
    "summary": "Send follow‑up to 3,000 leads",
    "risk_level": "high",
    "payload": { "template": "follow_up_v2", "count": 3000 },
    "callback_url": "https://your-agent.com/webhook"
  }'

Queuelo holds the action, emails you instantly, and you approve or reject from a dashboard. When you decide, it fires the callback and your agent proceeds.

What you get

  • Instant email notifications with the full payload so you know exactly what you’re approving.
  • Risk levels — low / medium / high / critical — to prioritize your review queue.
  • Full audit trail — every decision logged with who approved it, their role, and timestamp (immutable).
  • Callback webhooks — 3 retries with exponential backoff so your agent always receives the answer.
  • Team support — invite teammates, assign approver roles, and scope decisions to your organization.

The integration

Your agent submits an action and polls for the result.

Submit

curl -X POST https://queuelo.com/api/actions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"action_type": "deploy_code", "summary": "Deploy v2.1 to prod", "risk_level": "critical"}'

Returns immediately

{
  "id": "abc123",
  "status": "pending",
  "created_at": "..."
}

Check status later

curl https://queuelo.com/api/actions/abc123 \
  -H "Authorization: Bearer YOUR_API_KEY"

Or use callback_url

Provide a callback_url when submitting the action to get notified automatically when the decision is made.

Why this matters

AI agents are becoming more capable fast. The question isn’t whether they can act autonomously—it’s whether they should for every action.

  • Low‑risk, reversible actions can be auto‑approved.
  • High‑risk, irreversible actions require a human in the loop every time.

Queuelo gives you that control without rebuilding your agent.

Free to start — queuelo.com

0 views
Back to Blog

Related posts

Read more »

Google Gemini Writing Challenge

What I Built - Where Gemini fit in - Used Gemini’s multimodal capabilities to let users upload screenshots of notes, diagrams, or code snippets. - Gemini gener...