Interface ApprovalDecision

The resolved decision returned by HitlConfig.handler.

interface ApprovalDecision {
    approved: boolean;
    reason?: string;
    modifications?: {
        toolArgs?: unknown;
        output?: string;
        instructions?: string;
    };
}

Properties

approved: boolean

Whether the action was approved.

reason?: string

Optional human-provided rationale for the decision.

modifications?: {
    toolArgs?: unknown;
    output?: string;
    instructions?: string;
}

Optional changes the approver asks for, read only when approved is true: output on a beforeReturn approval and instructions on a beforeAgent approval. toolArgs is never applied.

Type declaration

  • Optional toolArgs?: unknown

    Not applied. The beforeTool approval gate approves or refuses the arguments onBeforeToolExecution left, and it refuses an approval that carries toolArgs (anything but undefined or null), so the call is skipped rather than run with the arguments the approver meant to replace. Rewrite arguments in that hook, which runs first.

  • Optional output?: string

    Replaces the final text, on a beforeReturn approval. The replacement goes through the agency's output guardrails and the post-approval check first, and one the check blocks is refused as a blocked final text is. It does not clear a strategy text the check blocks: the check reads that text beside the replacement, since stream() has streamed it before the approval is asked for and the call records of sequential, graph and review-loop still hold it, so a replacement that sanitizes it is refused too. With the agency's output schema, parsed is read from the replacement; one that does not match the schema is returned with parsed undefined, and generate() does not run the strategy again. A replacement equal to the strategy's text (the text handed back unedited) counts as an approval without modifications: under generate() a text that does not match is retried, and the approval is asked for the new one; stream() runs no validation retry. Without the schema, a replacement that changes the text leaves parsed undefined.

  • Optional instructions?: string

    Added to the input of the agent a beforeAgent approval lets run, under every strategy. The post-approval check reads that input with them.