Skip to main content

Overview

The Approvals API enables human oversight of AI agent actions. When an agent attempts a sensitive operation, it creates an approval request that humans review via the web console or API before the action executes.

Core workflow

  1. SDK creates request: Agent calls @guarded_action with requires_human_approval=True
  2. Request submitted: SDK posts to /api/v1/approvals
  3. Human reviews: Approver sees request in web console or via API
  4. Decision made: Approve, reject, or request more info
  5. SDK polls: Agent receives decision via polling endpoint
  6. Action executes: If approved, action proceeds; if rejected, raises error

Endpoints

Create approval request (SDK)

Request body:
Response:

List approval requests

Query parameters:
  • status (optional): Filter by status
    • pending, approved, rejected, expired, cancelled, info_requested
  • priority (optional): Filter by priority
    • critical, high, medium, low
  • risk_level (optional): Filter by risk level
    • critical, high, medium, low, minimal
  • agent_id (optional): Filter by agent
  • include_expired (optional): Include expired approvals (default: false)
  • skip (optional): Pagination offset
  • limit (optional): Page size (max: 1000)
Example:

Get pending approvals

Convenience endpoint for pending approvals only:
Response:

Get approval details

Returns full approval details including decision history.

Approve action

Request body:
Response:

Reject action

Request body:

Request more information

Request body:
Status changes to info_requested. SDK must respond with additional context.

Respond to info request (SDK)

Request body:
Status returns to pending for approver to review again.

Poll approval status (SDK)

SDK polls this endpoint to check if decision has been made: Response:

Cancel approval (SDK)

SDK can cancel pending approvals if circumstances change:

Check if action requires approval

Pre-flight check to determine if an action would require approval: Request body:
Response:

Health check

Returns 200 when the approval subsystem (ingest, decision broadcast, escalation) is healthy. Use as an uptime probe.

Approval statistics

Returns aggregate approval metrics:

Priority levels

Risk levels

Approval statuses

Timeout behavior

When an approval expires:
  • Status changes to expired
  • SDK receives TimeoutError
  • Action is not executed
  • Intervention is created with type APPROVAL_REQUIRED, outcome BLOCKED

Real-time updates

Approvals support WebSocket real-time updates:

Web console workflow

Approvers use the web console to:
  1. Navigate to Approvals page
  2. See pending approvals with expiration countdown
  3. Click “Review” to see full details:
    • Action description and context
    • Risk and priority levels
    • Estimated cost
    • Input parameters
    • Agent information
  4. Take action:
    • Approve with optional notes
    • Reject with reason
    • Request Info to ask agent for more context
  5. View decision history in “Decision History” tab

Best practices

Set appropriate timeouts: Critical actions should have short timeouts (5-10 min), routine actions can have longer timeouts (1-24 hours).
Use priority and risk levels: Help approvers triage - critical/high priority items should notify immediately (email, Slack, etc.).
Provide detailed descriptions: Include enough context so approvers can make informed decisions without requesting more info.
Handle expired approvals: SDKs must handle TimeoutError gracefully - don’t assume approvals will be granted within timeout.
Monitor approval rates: Low approval rates (< 70%) may indicate agents attempting inappropriate actions - review agent logic.

Example: Full workflow

See also