Guardrail Node

vellum.workflows.nodes.GuardrailNode

Used to execute a Metric Definition and surface a float output representing the score. This node is commonly used to implement quality checks and guardrails in your workflows.

Metrics are defined in the Vellum UI and can be reused across workflows.

Attributes

metric_definition
Union[UUID, str]Required

Either the Metric Definition’s UUID or its name

metric_inputs
EntityInputsInterfaceRequired

The inputs for the Metric

release_tag
strDefaults to LATEST

The release tag to use for the Metric

request_options
Optional[RequestOptions]

The request options to use for the Metric execution

Outputs

score
float

The score output from the metric execution (between 0 and 1)

Additional outputs may be available depending on the metric definition.