Skip to main content

Interface: ApprovalDecision

Defined in: packages/agentos/src/api/types.ts:800

The resolved decision returned by HitlConfig.handler.

Properties​

approved​

approved: boolean

Defined in: packages/agentos/src/api/types.ts:802

Whether the action was approved.


modifications?​

optional modifications: object

Defined in: packages/agentos/src/api/types.ts:810

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.

instructions?​

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.

output?​

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.

toolArgs?​

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.


reason?​

optional reason: string

Defined in: packages/agentos/src/api/types.ts:804

Optional human-provided rationale for the decision.