# 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

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

## Parameters

- `action` (TraceActionInput)
- `fn` (() => R | Promise<R>)
- `opts` (GuardToolOptions, optional)

## Returns

`Promise<GuardToolResult<R>>`

Runs locally, with no request to the API.
