AgentSea.Guardrail behaviour (agentsea_guardrails v0.1.0)

Copy Markdown

A check applied to text entering or leaving an agent. Each guardrail either passes (:ok), rewrites the content ({:transform, new} — e.g. redaction), or blocks it ({:block, reason}). AgentSea.Guardrails chains them.

Built-ins: MaxLength, Blocklist, PIIRedactor, and the provider-backed LLMGuard.

Summary

Types

outcome()

@type outcome() :: :ok | {:transform, String.t()} | {:block, reason :: term()}

Callbacks

check(content, opts)

@callback check(content :: String.t(), opts :: keyword()) :: outcome()

name()

@callback name() :: String.t()