Skip to content
Prompty

GuardrailResult

The result of a guardrail evaluation. Guardrails are safety checks that run at specific phases of the agent loop and can allow, deny, or rewrite content.

---
title: GuardrailResult
config:
  look: handDrawn
  theme: colorful
  class:
    hideEmptyMembersBox: true
---
classDiagram
    class GuardrailResult {
        +boolean allowed
        +string reason
        +unknown rewrite
    }
allowed: true
reason: Content is safe
Name Type Description
allowed boolean Whether the content passed the guardrail check
reason string Explanation of why the content was allowed or denied
rewrite unknown Optional rewritten content to replace the original

The following factory methods are declared via @factory and are generated automatically by the emitter in every language.

  • rewrite(rewrite: unknown)
  • deny(reason: string)
  • allow()