rulvar API reference / @rulvar/core / evaluatePermission
Function: evaluatePermission()
ts
function evaluatePermission(
chain,
tool,
input,
ctx?): Promise<PermissionVerdict>;Defined in: packages/core/src/runtime/permission-chain.ts:236
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>, "name" | "risk" | "needsApproval"> |
input | unknown |
ctx? | ToolContext |
Returns
Promise<PermissionVerdict>