<guardian> protocol tag in the last
user message to specify system prompt, criteria, and scoring schema. This
differs from other intrinsics, which rely on the instruction field in
io.yaml.
Functions
FUNC policy_guardrails
context is compliant with the given policy_text.
:param context: Chat context containing the conversation to evaluate.
:param backend: Backend instance that supports LoRA adapters.
:param policy_text: Policy against with compliance is to be checked
:return: Compliance as a “Yes/No/Ambiguous” label (Yes = compliant).
FUNC guardian_check
target_role in context meets the given criteria.
Args:
context: Chat context containing the conversation to evaluate.backend: Backend instance that supports LoRA adapters.criteria: Description of the criteria to check against. Can be a key from :data:CRITERIA_BANK(e.g."harm") or a custom criteria string.target_role: Role whose last message is being evaluated ("user"or"assistant").
- Risk score as a float between 0.0 (no risk) and 1.0 (risk detected).