dragon.ai.inference.config.GuardrailsConfig

class GuardrailsConfig[source]

Bases: object

Prompt guardrails configuration.

Configures optional PromptGuard-based filtering before prompts reach the vLLM engine.

Parameters:
  • enabled (bool ) – Enable PromptGuard preprocessing. Disabled prompts bypass guardrail scoring and are considered safe.

  • prompt_guard_model (str ) – Hugging Face model name or local path for the PromptGuard classifier.

  • prompt_guard_sensitivity (float ) – Jailbreak score threshold in the range [0.0, 1.0]. Prompts with scores greater than or equal to this value are rejected.

__init__(enabled: bool = True, prompt_guard_model: str = 'meta-llama/Prompt-Guard-86M', prompt_guard_sensitivity: float = 0.5) None

Methods

__init__([enabled, prompt_guard_model, ...])

validate()

Validate guardrails configuration.

Attributes

enabled

prompt_guard_model

prompt_guard_sensitivity

enabled: bool = True
prompt_guard_model: str = 'meta-llama/Prompt-Guard-86M'
prompt_guard_sensitivity: float = 0.5
validate() None [source]

Validate guardrails configuration.

__init__(enabled: bool = True, prompt_guard_model: str = 'meta-llama/Prompt-Guard-86M', prompt_guard_sensitivity: float = 0.5) None