DEV Community

jxrdancrane
jxrdancrane

Posted on

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

I kept running into the same problem building AI agents: they'd take real-world actions: sending emails, creating tickets, deploying code, without asking first.

The agent doesn't know the difference between a test environment and production. It doesn't know that "send follow-up email to all leads" means 3,000 emails. It just executes.
So I built Queuelo - a dead simple approval layer you drop in front of any agent action.

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, 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 so you can 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 gets the answer
Team support — invite teammates, assign approver roles, decisions scoped to your org

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": "..."}

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

Or use callback_url to get notified automatically

Why this matters

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

Low risk, reversible actions? Auto-approve them. High risk, irreversible actions? Human in the loop, every time.
Queuelo gives you that control without rebuilding your agent.

Free to start — queuelo.com

Top comments (0)