SDK reference · Node SDK

prov.trace.guardTool

prov.trace.guardTool in Node SDK. Assess action and run fn only on allow; on challenge wait for the person (waitForApproval) or return the pending assessment; when Provenance can't answer, pay, send and delete never run, write is blocked and read runs unchecked (onUnavailable changes the last two), and an unchecked run is posted later as unassessed.

Signature

prov.trace.guardTool<R>(action: TraceActionInput, fn: () => R | Promise<R>, opts?: GuardToolOptions): Promise<GuardToolResult<R>>

Parameters

actionTraceActionInputRequired
fn() => R | Promise<R>Required
optsGuardToolOptions

Returns

Promise<GuardToolResult<R>>

HTTP operation

Runs locally, with no request to the API.

Was this page helpful? Send us feedback

LLM? Read llms.txt.