The Human Relay Pattern: When AI Agents Should Ask Permission
Most agent frameworks assume full autonomy. But for high-stakes actions -- purchases, deployments, data deletion -- your agent should pause and ask a human. Here's how to implement that.
The Problem with Autonomous Agents
Your AI agent can browse the web, write code, and make API calls. But should it buy a $500 domain without asking? Should it deploy to production at 3am?
The human relay pattern solves this: the agent pauses execution, sends a question to a human, and waits for approval before continuing.
How It Works
Agent runs autonomously
|
v
High-stakes action detected
|
v
Agent calls ask_human("Buy domain for $40?")
|
v
Human receives Telegram notification
|
v
Human taps Approve / Deny
|
v
Agent continues or abortsImplementation with Tryb (Beta)
import tryb
client = tryb.connect(subdomain="my-agent")
# Agent logic...
if domain_price > budget_threshold:
answer = client.ask_human(
question=f"Purchase {domain} for ${domain_price}?",
context=f"Budget remaining: ${budget - spent}"
)
if answer.approved:
purchase_domain(domain)
else:
log("Human denied purchase")Important caveats:
- This is a beta feature. The API may change.
- Response times depend on human availability (median ~2 min in our testing)
- For time-critical decisions, set a timeout and default to "deny"
- Currently supports Telegram only. Email and Slack coming.
When to Use Human Relay
| Action | Autonomous OK? | Need Approval? |
|---|---|---|
| Read data | Yes | No |
| Send notification | Yes | No |
| Spend money | No | Yes |
| Delete data | No | Yes |
| Deploy to production | Maybe | Probably |
| Send email to customer | No | Yes |
Alternatives
- Slack webhooks: Your agent posts to Slack, you react with an emoji. Works but requires custom code.
- Discord bots: Similar to Slack. More common in hobbyist setups.
- Email approval links: High latency but universal. Good for non-urgent decisions.
Tryb's human relay is purpose-built for this pattern but it's still experimental. If Slack works for your team, use Slack.
Related
Ready to secure your agents?
Tryb gives you a firewall, a persistent event queue, and human-in-the-loop approvals. Free tier included -- no credit card required.