WardrikPolicy. Decision
(wardrik_policy v0.1.0-rc.1)
Copy Markdown
What a policy decided about a call, and why. Returned by WardrikPolicy.explain/3.
:effect-:allow,:askor:deny.:message- the prompt or refusal.nilfor an allow.:rule- the rule that decided, when:causeis:ruleor:label.:policy- the name of the policy that decided, if it has one.:cause- what decided. See below.:measurements- what a judge's model call used.
The :cause is one of:
:rule- a rule named the call.:no_rule- no rule covered the whole call, sodefaultdecided.:judge- the policy's judge decided.:budget- a model call reached the policy's budget.:label- a rule allowed a gated call, but the run had read labelled content.
Summary
Functions
Returns the strictest decision. A deny beats an ask, and an ask beats an allow.
Ranks an effect: 0 for :deny, 1 for :ask, 2 for :allow.
Types
Functions
Returns the strictest decision. A deny beats an ask, and an ask beats an allow.
On a tie, a decision from a rule or judge beats one from a default. An empty list allows. The result carries the summed measurements of all of them.
@spec strictness(:allow | :ask | :deny) :: 0..2
Ranks an effect: 0 for :deny, 1 for :ask, 2 for :allow.