ASM.Extensions.Policy.Violation (ASM v0.9.2)

Copy Markdown View Source

Normalized policy-violation descriptor with explicit action semantics.

Summary

Types

Violation action.

Policy direction where the rule was evaluated.

t()

Types

action()

@type action() :: :warn | :request_approval | :cancel

Violation action.

direction()

@type direction() :: :input | :output

Policy direction where the rule was evaluated.

t()

@type t() :: %ASM.Extensions.Policy.Violation{
  action: action(),
  direction: direction(),
  message: String.t(),
  metadata: map(),
  rule: atom() | String.t()
}

Functions

new(rule, action, message, opts \\ [])

@spec new(atom() | String.t(), action(), String.t(), keyword()) :: t()

to_error(violation, source_event)

@spec to_error(t(), ASM.Event.t()) :: ASM.Error.t()

to_guardrail_trigger(violation)

@spec to_guardrail_trigger(t()) :: ASM.Control.GuardrailTrigger.t()