Public policy extension API.
This domain provides lightweight policy evaluation for tool governance and output budget limits with explicit violation actions.
Summary
Functions
Pure policy evaluation.
Types
@type action() :: ASM.Extensions.Policy.Violation.action()
Violation action taken when a policy rule is triggered.
@type t() :: %ASM.Extensions.Policy{ disallow_tools: MapSet.t(String.t()), max_output_tokens: non_neg_integer() | nil, on_budget_violation: action(), on_tool_violation: action() }
Functions
@spec evaluate(t(), ASM.Event.t(), map()) :: {:ok, map()} | {:violation, ASM.Extensions.Policy.Violation.t(), map()}
Pure policy evaluation.
Returns:
{:ok, next_ctx}when no rule is violated{:violation, violation, next_ctx}when a rule is violated
@spec new(keyword()) :: {:ok, t()} | {:error, ASM.Error.t()}