rulvar API reference / @rulvar/rulvar / evaluatePermission
Function: evaluatePermission()
ts
function evaluatePermission(
chain,
tool,
input,
ctx?): Promise<PermissionVerdict>;Defined in: packages/core/dist/index.d.ts
Evaluates the chain for one dispatch, or OFFLINE against a hypothetical call by tool name (the dry-run API: nothing executes; shells and tests read the verdict, the deciding layer, and the matched rule). Hooks run in deterministic registration order; { modifiedInput } substitutes the input and continues; the first decisive verdict wins. The returned input is what execute receives and what the approval identity hashes (post hook modification). Advisory domain-rule matches ride every verdict for the audit payload.
Parameters
| Parameter | Type |
|---|---|
chain | CompiledPermissionChain |
tool | | string | Pick<ToolDef<SchemaSpec<unknown>>, "risk" | "name" | "needsApproval"> |
input | unknown |
ctx? | ToolContext |
Returns
Promise<PermissionVerdict>