Skip to main content
The request body must include a 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.

The type of the workflow determines how hallucination thresholds are configured:
- 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.

Improvement actions determine the remediation step for events where one or more metric evaluations fail below the threshold.
- regen - Re-runs the user’s prompt with minor variance
- fixit - Directly addresses shortcomings using the guardrail failure rationale(s)
- do_nothing - No improvement is attempted by DeepRails

When you create a workflow, you’ll receive a workflow ID. Use this ID to submit new events for evaluation and remediation for the defend workflow.