Interface ApprovalRequest

A pending approval request raised by the HITL subsystem. Passed to HitlConfig.handler and emitted on the approvalRequested callback.

interface ApprovalRequest {
    id: string;
    type: "tool" | "agent" | "emergent" | "output" | "strategy-override";
    agent: string;
    action: string;
    description: string;
    details: Record<string, unknown>;
    context: {
        agentCalls: AgentCallRecord[];
        totalTokens: number;
        totalCostUSD: number;
        elapsedMs: number;
    };
}

Properties

id: string

Unique identifier for this approval request.

type: "tool" | "agent" | "emergent" | "output" | "strategy-override"

What kind of action is awaiting approval.

  • "tool" — a tool invocation.
  • "agent" — an agent invocation.
  • "emergent" — synthesis of a new runtime agent.
  • "output" — the final answer before returning to the caller.
  • "strategy-override" — the orchestrator wants to change the execution strategy.
agent: string

Name of the agent that triggered the approval request.

action: string

Short action label (e.g. tool or agent name).

description: string

Human-readable description of what is being approved.

details: Record<string, unknown>

Structured details about the pending action (tool args, agent config, etc.).

context: {
    agentCalls: AgentCallRecord[];
    totalTokens: number;
    totalCostUSD: number;
    elapsedMs: number;
}

Snapshot of run context at the time the request was raised.

Type declaration

  • agentCalls: AgentCallRecord[]

    All agent call records completed so far in this run.

  • totalTokens: number

    Cumulative token count up to this point.

  • totalCostUSD: number

    Cumulative cost in USD up to this point.

  • elapsedMs: number

    Wall-clock milliseconds elapsed since the run started.