Skip to content

rulvar API reference


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

ParameterType
chainCompiledPermissionChain
tool| string | Pick&lt;ToolDef&lt;SchemaSpec&gt;, "name" | "risk" | "needsApproval"&gt;
inputunknown
ctx?ToolContext

Returns

Promise&lt;PermissionVerdict&gt;