GuardrailsSettings

Properties

Name

Type

Description

Notes

exception_message

str

A message that will be returned in case some guardrails settings are violated.

[optional]

show_violated_responses

bool

Admin-only toggle to view the exact content of violated responses. When enabled, admins can see what triggered a guardrail violation. This is disabled by default for privacy and security. Only administrators can enable this setting and view violated content.

[optional] [default to False]

guardrails_on_transcriptions

bool

When enabled, audio and video transcriptions are checked for content safety violations using the guardrails LLM, in addition to the existing PII detection.

[optional] [default to False]

vision_guardrails_enabled

bool

When enabled, images and video frames are checked for content safety violations using a vision-capable guardrails LLM during document ingestion.

[optional] [default to False]

guardrails_vision_llm

str

Vision-capable LLM for image and video content safety checks. Defaults to auto which selects the best available vision model.

[optional] [default to ‘auto’]

column_redaction_config

List[List[str]]

List of [column_pattern, redaction_label], both strings.

[optional]

disallowed_regex_patterns

List[str]

A list of regular expressions that match custom PII.

[optional]

presidio_labels_to_flag

List[str]

A list of entities to be flagged as PII by the built-in Presidio model.

[optional]

pii_labels_to_flag

List[str]

A list of entities to be flagged as PII by the built-in PII model.

[optional]

pii_detection_parse_action

str

What to do when PII is detected during parsing of documents. The ‘redact’ option will replace disallowed content in the ingested documents with redaction bars.

[optional]

pii_detection_llm_input_action

str

What to do when PII is detected in the input to the LLM (document content and user prompts). The ‘redact’ option will replace disallowed content with placeholders.

[optional]

pii_detection_llm_output_action

str

What to do when PII is detected in the output of the LLM. The ‘redact’ option will replace disallowed content with placeholders.

[optional]

prompt_guard_labels_to_flag

List[str]

A list of entities to be flagged as safety violations in user prompts by the built-in prompt guard model.

[optional]

guardrails_labels_to_flag

List[str]

A list of entities to be flagged as safety violations in user prompts. Must be a subset of guardrails_entities, if provided.

[optional]

guardrails_llm

str

LLM to use for Guardrails and PII detection

[optional]

guardrails_safe_category

str

Name of the safe category for guardrails. Must be a key in guardrails_entities, if provided. Otherwise uses system defaults.

[optional]

guardrails_entities

Dict[str, str]

(Optional) Dictionary mapping each guardrails category name to its definition, used by the guardrails model to classify messages. The first entry is the "safe" class; the rest are "unsafe" classes. Omit this field to inherit the server’s maintained default category definitions and keep receiving improvements to them. Supplying it REPLACES the defaults wholesale (the dict is not merged with them), so a value copied from documentation pins the collection to those exact definitions permanently — including wordings later found too weak to classify reliably. Pass it only when you deliberately own the full category set. No example is shown here on purpose, to avoid inviting such a copy.

[optional]

column_redaction_custom_entities_to_flag

List[str]

Deprecated - Use custom_pii_entities_to_flag. A list of entities to redact in tabular data files. Must be a subset of column_redaction_custom_entities, if provided.

[optional]

column_redaction_custom_entities

Dict[str, str]

(Optional) Deprecated - Use custom_pii_entities. A dictionary of entities and a short description for the LLM to check for and redact columns containing PII in tabular data files.

[optional]

custom_pii_entities_to_flag

List[str]

A list of entities to redact in tabular data files. Must be a subset of custom_pii_entities, if provided.

[optional]

custom_pii_entities

Dict[str, str]

(Optional) A dictionary of entities and a short description for the LLM to check for and redact columns containing PII in tabular data files.

[optional]

Example

from h2ogpte.rest_async.models.guardrails_settings import GuardrailsSettings

# TODO update the JSON string below
json = "{}"
# create an instance of GuardrailsSettings from a JSON string
guardrails_settings_instance = GuardrailsSettings.from_json(json)
# print the JSON string representation of the object
print(GuardrailsSettings.to_json())

# convert the object into a dict
guardrails_settings_dict = guardrails_settings_instance.to_dict()
# create an instance of GuardrailsSettings from a dict
guardrails_settings_from_dict = GuardrailsSettings.from_dict(guardrails_settings_dict)