GlobalGuardRailsRegistry

class GlobalGuardRailsRegistry(userInputClassNames: String, assistantMessageClassNames: String, failOnError: Boolean)

Registry for globally configured guardrails loaded from application properties.

Guardrails are instantiated from comma-separated class names specified in:

  • embabel.agent.guardrails.user-input

  • embabel.agent.guardrails.assistant-message

Global guardrails are created once as singletons and reused across all LLM operations.

This registry can be accessed in two ways:

  • As an injected Spring bean: constructor(private val registry: GlobalGuardRailsRegistry)

  • Statically via companion object: GlobalGuardRailsRegistry.get()

Example configuration:

embabel.agent.guardrails.user-input=com.example.ProfanityFilter,com.example.LengthValidator
embabel.agent.guardrails.assistant-message=com.example.OutputValidator

Constructors

Link copied to clipboard
constructor(userInputClassNames: String, assistantMessageClassNames: String, failOnError: Boolean)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun init()