Skip to content
This repository was archived by the owner on May 26, 2026. It is now read-only.
This repository was archived by the owner on May 26, 2026. It is now read-only.

Feature: Tiered tool approval with admin channel routing, timeout handling, and async owner queue #671

@ezra-letta

Description

@ezra-letta

Summary

Proposal for a tiered tool approval system with channel-based routing, configurable timeouts, and async queuing. Addresses the current binary permission model (everything auto-approved OR everything blocks) which is insufficient for multi-user, multi-timezone deployments.

NOTE: This is an initial design sketch, not a production-ready spec. The security model described here needs review by someone with deeper expertise in agent safety and access control. Community input welcome.

Problem

  1. bypassPermissions gives every tool unrestricted access -- unsafe for shared environments
  2. Without bypass, any unapproved tool call deadlocks the entire agent session (CONFLICT loop, see Security: slash commands accessible to all group chat users, leaking server IPs and allowing model switching #666 recovery logs)
  3. Heartbeats/background tasks have no human to approve, causing silent deadlocks
  4. No way to route approval requests to specific channels or users
  5. No timeout -- stuck approvals block indefinitely
  6. No async queue -- if the owner is offline, sensitive operations can't be parked for later review

Proposed Design: Three-Tier Approval

Tier 1 -- Auto-approve (no delay)

  • Read-only tools: Read, Glob, Grep, web_search, conversation_search
  • Heartbeat and background task tool calls
  • Any tool on an explicit autoApproveTools list in config

Tier 2 -- Team-approve (any admin)

  • Tools on a teamApproveTools list
  • Approval request sent to configured admin channel(s) with inline buttons (Telegram InlineKeyboardMarkup, Discord buttons, etc.)
  • Any user in the admin channel's allowlist can approve/deny
  • Configurable timeout (default 30-60s): on timeout, agent receives approval_timeout response and continues its turn gracefully -- tells the user "I can't run that tool right now" instead of deadlocking
  • Failed approval does NOT poison subsequent messages

Tier 3 -- Owner-only (async queue)

  • Sensitive tools: Bash, Write, Edit, or any tool on an ownerOnlyTools list
  • Only the designated owner can approve
  • If owner is offline: request is queued, not failed. Agent acknowledges "waiting for owner approval" and continues handling other work
  • Owner sees backlog on return: each queued item shows full tool name, arguments, agent reasoning, and timestamp
  • Stale approvals auto-expire after configurable window (e.g. 4 hours) with status visible to agent
  • No blind "approve all": each queued approval requires individual review with full context

Example config

agents:
  - name: MyAgent
    approval:
      owner: "telegram:12345"           # owner user ID
      adminChannels:
        - "telegram:-100999"            # admin group chat
        - "discord:123456789"           # admin Discord channel
      adminUsers: ["telegram:12345", "telegram:67890"]
      timeout: 60                        # seconds, Tier 2
      ownerQueueExpiry: 14400           # seconds (4hr), Tier 3
      tiers:
        auto: [Read, Glob, Grep, web_search, conversation_search, manage_todo]
        team: [fetch_webpage]
        owner: [Bash, Write, Edit, Task]
      heartbeatBypass: true             # all heartbeat tool calls = Tier 1

Important Caveats

Bash is inherently Tier 3. There is no reliable way to classify individual Bash commands as "destructive" vs "safe" at the tool level. rm is obvious, but curl can exfiltrate data, mv can break systems, echo > can overwrite files. The model's judgment about what constitutes a destructive command is NOT a security boundary. If you need safe read-only shell access, use Read/Glob/Grep -- they exist as separate tools for this reason.

This design needs expert review. The tiered model is a starting point, not a hardened security spec. Specific areas needing deeper analysis:

  • Can a prompt-injected agent circumvent tier restrictions by using tool A to invoke tool B?
  • How do tool chains work? (Agent calls Tier 1 tool that triggers Tier 3 side effect)
  • Rate limiting on approval requests to prevent spam
  • Audit logging for all approval decisions

Related


This feature request was collaboratively developed by two humans and two agents during a penetration testing session.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions