Use this endpoint to create a new guardrail workflow by specifying guardrail thresholds, an improvement action, and optional extended capabilities.
name for the workflow, a workflow threshold_type, either a custom_hallucination_threshold_values or an automatic_hallucination_tolerance_levels object specifying which guardrail metrics to evaluate against and their corresponding hallucination thresholds, and an improvement_action. Optionally, extended AI capabilities like web_search can be included as tools for the evaluation.workflow_id returned.automatic - Uses internal threshold logic based on tolerance level. The automatic_hallucination_tolerance_levels dictionary must be specified as low, medium, or high to indicate how strict the thresholds should be.custom - Allows the user to set custom thresholds (0.0-1.0) for each metric using the custom_hallucination_threshold_values dictionary.regen - Re-runs the user’s prompt with minor variancefixit - Directly addresses shortcomings using the guardrail failure rationale(s)do_nothing - No improvement is attempted by DeepRailsBearer authentication header of the form Bearer <token>, where <token> is your auth token.
Name of the workflow.
Type of thresholds to use for the workflow, either automatic or custom. Automatic thresholds are assigned internally after the user specifies a qualitative tolerance for the metrics, whereas custom metrics allow the user to set the threshold for each metric as a floating point number between 0.0 and 1.0.
automatic, custom The action used to improve outputs that fail one or more guardrail metrics for the workflow events. May be regen, fixit, or do_nothing. ReGen runs the user's input prompt with minor induced variance. FixIt attempts to directly address the shortcomings of the output using the guardrail failure rationale. Do Nothing does not attempt any improvement.
regen, fixit, do_nothing Description for the workflow.
Mapping of guardrail metrics to hallucination tolerance levels
(either low, medium, or high). Possible metrics are
completeness, instruction_adherence, context_adherence,
ground_truth_adherence, or comprehensive_safety.
Mapping of guardrail metrics to floating point threshold values. Possible metrics are correctness, completeness, instruction_adherence, context_adherence, ground_truth_adherence, or comprehensive_safety.
Max. number of improvement action attempts until a given event passes the guardrails. Defaults to 10.
Whether to enable web search for this workflow's evaluations. Defaults to false.
An array of file IDs to search in the workflow's evaluations. Files must be uploaded via the DeepRails API first.
A file ID corresponding to a file to search in the workflow's evaluations.
Workflow created successfully
A unique workflow ID.
"wkfl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Status of the selected workflow. May be inactive or active. Inactive workflows will not accept events.
inactive, active "active"
The time the workflow was created in UTC.
"2025-01-15T10:30:00Z"