Admin Console

Approval Queue

Configure human-in-the-loop approval workflows for high-risk AI actions.

Overview

The approval queue enables human oversight for sensitive AI actions, allowing designated approvers to review and approve or reject requests before execution.

12

PENDING

458

APPROVED

23

REJECTED

5

EXPIRED

Configuring Approval Workflows

Define which actions require approval in your policies:

yaml
# policy.yaml
policies:
  - name: approve-high-value-transactions
    description: Require approval for transactions over $1000
    trigger: action
    action: APPROVAL
    conditions:
      - type: action_type
        value: "financial_transaction"
      - type: amount_greater_than
        value: 1000
    approval_config:
      approvers:
        - "finance-team@company.com"
        - "manager@company.com"
      required_approvals: 1  # How many approvers needed
      timeout_hours: 24
      on_timeout: "reject"  # or "auto_approve"

  - name: approve-external-communications
    description: Require approval for external emails
    trigger: action
    action: APPROVAL
    conditions:
      - type: action_type
        value: "send_email"
      - type: recipient_external
        value: true
    approval_config:
      approvers: ["communications@company.com"]
      required_approvals: 1
      timeout_hours: 4

Handling Approval Requests

When an action requires approval, implement the waiting logic:

python
from tork_governance import TorkClient

client = TorkClient()

# Check policy (may return approval requirement)
result = client.policy.check(
    agent_id="agent-123",
    action_type="financial_transaction",
    metadata={"amount": 5000, "currency": "USD"}
)

if result.action == "APPROVAL":
    # Action requires human approval
    approval_id = result.approval_request_id
    print(f"Approval required: {approval_id}")

    # Option 1: Poll for decision
    while True:
        status = client.approvals.get_status(approval_id)
        if status.decided:
            if status.approved:
                # Proceed with action
                execute_transaction()
            else:
                print(f"Rejected: {status.rejection_reason}")
            break
        time.sleep(30)

    # Option 2: Use webhooks for async notification
    # Configure webhook at https://dashboard.tork.network

Approving via API

Approvers can approve or reject requests programmatically:

python
# List pending approvals
pending = client.approvals.list(status="pending")

for request in pending:
    print(f"Request: {request.id}")
    print(f"  Agent: {request.agent_id}")
    print(f"  Action: {request.action_type}")
    print(f"  Requested: {request.created_at}")

# Approve a request
client.approvals.approve(
    approval_id="apr_123",
    approver_id="user@company.com",
    comment="Approved after verification"
)

# Reject a request
client.approvals.reject(
    approval_id="apr_456",
    approver_id="user@company.com",
    reason="Amount exceeds quarterly limit"
)

Webhook Notifications

Receive notifications when approvals are decided:

json
{
  "event": "approval.decided",
  "approval_id": "apr_123",
  "timestamp": "2024-01-15T10:30:00Z",
  "data": {
    "decision": "approved",
    "approver": "manager@company.com",
    "comment": "Approved for Q1 budget",
    "agent_id": "agent-123",
    "action_type": "financial_transaction",
    "metadata": {
      "amount": 5000,
      "currency": "USD"
    }
  }
}

Integration: Connect approvals to Slack or email for real-time notifications. See Slack & Discord Integration.

Documentation

Learn to integrate TORK

Upgrade Plan

Current: free

Support

Get help from our team