Raxol.Agent.Authorization.Verdict (Raxol Agent v2.6.0)

Copy Markdown View Source

The outcome a single authorization policy returns when it evaluates.

One of three actions (the ALLOW/ASK/DENY trichotomy from omnigent's PolicyEngine), each optionally carrying writes -- label updates the policy wants applied:

  • :allow -- permit; writes are applied immediately.
  • :ask -- require human approval; writes are held in escrow and applied only once approved. prompt is shown to the approver.
  • :deny -- refuse; reason explains why. Short-circuits the engine.

Summary

Functions

An allow verdict, optionally writing labels.

An ask verdict with an approver prompt, optionally escrowing labels.

A deny verdict with a reason.

Types

action()

@type action() :: :allow | :ask | :deny

t()

@type t() :: %Raxol.Agent.Authorization.Verdict{
  action: action(),
  prompt: binary() | nil,
  reason: term(),
  writes: map()
}

Functions

allow(writes \\ %{})

@spec allow(map()) :: t()

An allow verdict, optionally writing labels.

ask(prompt, writes \\ %{})

@spec ask(binary(), map()) :: t()

An ask verdict with an approver prompt, optionally escrowing labels.

deny(reason)

@spec deny(term()) :: t()

A deny verdict with a reason.