# Generative AI Moderation

> Generative AI Moderation - Details of overall moderation configuration for a model.

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-07-27T18:44:30.544431+00:00` (UTC).

## Primary page

- [Generative AI Moderation](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md): Full documentation for this topic (Markdown sidecar).

## Sections on this page

- [ModerationConfiguration](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.configuration.ModerationConfiguration): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.configuration.ModerationConfiguration.get): In-page section heading.
- [list()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.configuration.ModerationConfiguration.list): In-page section heading.
- [create()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.configuration.ModerationConfiguration.create): In-page section heading.
- [update()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.configuration.ModerationConfiguration.update): In-page section heading.
- [refresh()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.configuration.ModerationConfiguration.refresh): In-page section heading.
- [delete()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.configuration.ModerationConfiguration.delete): In-page section heading.
- [GuardInterventionCondition](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.intervention.GuardInterventionCondition): In-page section heading.
- [GuardInterventionForTemplate](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.intervention.GuardInterventionForTemplate): In-page section heading.
- [ensure_object()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.intervention.GuardInterventionForTemplate.ensure_object): In-page section heading.
- [GuardInterventionForConfiguration](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.intervention.GuardInterventionForConfiguration): In-page section heading.
- [ensure_object()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.intervention.GuardInterventionForConfiguration.ensure_object): In-page section heading.
- [GuardModelInfo](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.model_info.GuardModelInfo): In-page section heading.
- [to_dict()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.model_info.GuardModelInfo.to_dict): In-page section heading.
- [ensure_object()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.model_info.GuardModelInfo.ensure_object): In-page section heading.
- [ModelVersionUpdate](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.model_version_update.ModelVersionUpdate): In-page section heading.
- [new_custom_model_version_with_config()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.model_version_update.ModelVersionUpdate.new_custom_model_version_with_config): In-page section heading.
- [GuardNemoInfo](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.nemo_info.GuardNemoInfo): In-page section heading.
- [OverallModerationConfig](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.overall.OverallModerationConfig): In-page section heading.
- [find()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.overall.OverallModerationConfig.find): In-page section heading.
- [locate()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.overall.OverallModerationConfig.locate): In-page section heading.
- [create()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.overall.OverallModerationConfig.create): In-page section heading.
- [update()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.overall.OverallModerationConfig.update): In-page section heading.
- [refresh()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.overall.OverallModerationConfig.refresh): In-page section heading.
- [ModerationTemplate](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.template.ModerationTemplate): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.template.ModerationTemplate.get): In-page section heading.
- [list()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.template.ModerationTemplate.list): In-page section heading.
- [find()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.template.ModerationTemplate.find): In-page section heading.
- [create()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.template.ModerationTemplate.create): In-page section heading.
- [update()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.template.ModerationTemplate.update): In-page section heading.
- [refresh()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.template.ModerationTemplate.refresh): In-page section heading.
- [delete()](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.template.ModerationTemplate.delete): In-page section heading.
- [ModerationGuardOotbType](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.enums.ModerationGuardOotbType): In-page section heading.

## Documentation content

### ModerationConfiguration

Details of overall moderation configuration for a model.

#### get()

Get a guard configuration by ID.

Added in version v3.6.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| config_id | str | ID of the configuration |

Returns

| Returns | Description |
| --- | --- |
| retrieved configuration |  |

Return type: [ModerationConfiguration](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.configuration.ModerationConfiguration)

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status. |
| datarobot.errors.ServerError | if the server responded with 5xx status. |

#### list()

List Guard Configurations.

Added in version v3.6.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | ID of the entity |
| entity_type | ModerationGuardEntityType | Type of the entity |

Returns

| Returns | Description |
| --- | --- |
| a list of configurations |  |

Return type: `List[ModerationConfiguration]`

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status |
| datarobot.errors.ServerError | if the server responded with 5xx status |

#### create()

Create a configuration. This is not a full create from scratch; it’s based on a template.

Added in version v3.6.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| template_id | str | ID of the template to base this configuration on. |
| name | str | name of the configuration. |
| description | str | description of the configuration. |
| stages | List[ModerationGuardStage] | the stages of moderation where this guard is active |
| entity_id | str | ID of the custom model version or playground this configuration applies to. |
| entity_type | ModerationGuardEntityType | Type of the associated entity_id |
| llm_type | Optional[ModerationGuardLlmType] | the backing LLM this guard uses. |
| nemo_info | Optional[GuardNemoInfo] | additional configuration for NeMo Guardrails guards. |
| model_info | Optional[GuardModelInfo] | additional configuration for guards using a deployed model. |
| intervention | Optional[GuardInterventionForConfiguration] | the assessment conditions, and action the guard should take if conditions are met. |
| openai_api_key | str | Token to use for OpenAI. Deprecated; use openai_credential instead. |
| openai_api_base | Optional[str] | Base of the OpenAI connection |
| openai_deployment_id | Optional[str] | ID of the OpenAI deployment |
| openai_credential | Optional[str] | ID of the credential defined in DataRobot for OpenAI. |

Returns

| Returns | Description |
| --- | --- |
| created ModerationConfiguration |  |

Return type: [ModerationConfiguration](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.configuration.ModerationConfiguration)

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status. |
| datarobot.errors.ServerError | if the server responded with 5xx status. |

#### update()

Update configuration. All fields are optional, and omitted fields are left unchanged.

entity_id, entity_type, and stages cannot be modified for a guard configuration,.

Added in version v3.6.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| name | str | name of the configuration. |
| description | str | description of the configuration. |
| llm_type | Optional[ModerationGuardLlmType] | the backing LLM this guard uses. |
| nemo_info | Optional[GuardNemoInfo] | additional configuration for NeMo Guardrails guards. |
| model_info | Optional[GuardModelInfo] | additional configuration for guards using a deployed model. |
| intervention | Optional[GuardInterventionForConfiguration] | the assessment conditions, and action the guard should take if conditions are met. |
| openai_api_key | str | Token to use for OpenAI. Deprecated; use openai_credential instead. |
| openai_api_base | Optional[str] | Base of the OpenAI connection |
| openai_deployment_id | Optional[str] | ID of the OpenAI deployment |
| openai_credential | Optional[str] | ID of the credential defined in DataRobot for OpenAI. |

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status. |
| datarobot.errors.ServerError | if the server responded with 5xx status. |

Return type: `None`

#### refresh()

Update OverallModerationConfig with the latest data from server.

Added in version v3.6.

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status |
| datarobot.errors.ServerError | if the server responded with 5xx status |

Return type: `None`

#### delete()

Delete configuration.

Added in version v3.6.

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | If the server responded with 4xx status. |
| datarobot.errors.ServerError | If the server responded with 5xx status. |

Return type: `None`

### GuardInterventionCondition

Defines a condition for intervention.

### GuardInterventionForTemplate

Defines the intervention conditions and actions a guard can take.
Configuration schema differs slightly from template because changes were requested after
templates were baked in.

#### ensure_object()

intervention may arrive as an object, or as a dict. Return an object.

Return type: [GuardInterventionForTemplate](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.intervention.GuardInterventionForTemplate)

### GuardInterventionForConfiguration

Defines the intervention conditions and actions a guard can take.
Configuration schema differs slightly from template because changes were requested after
templates were baked in.

#### ensure_object()

intervention may arrive as an object, or as a dict. Return an object.

Return type: [GuardInterventionForConfiguration](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.intervention.GuardInterventionForConfiguration)

### GuardModelInfo

Model information for moderation templates and configurations.
Omitted optional values are stored and presented as:
* []  (for class names)
* None  (all others)

#### to_dict()

Convert the model information object to a dictionary.

Return type: `Dict` [ `str`, `Union` [ `str`, `List` [ `str`], `None`]]

#### ensure_object()

intervention may arrive as an object, or as a dict. Return an object.

Return type: [GuardModelInfo](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.model_info.GuardModelInfo)

### ModelVersionUpdate

Implements the operation provided by “Save Configuration” in moderation UI.
All guard configurations and overall config is saved to a new custom model version.

#### new_custom_model_version_with_config()

Create a new custom model version with the provided moderation configuration
:type custom_model_id: `str`:param custom_model_id:
:type overall_config: [OverallModerationConfig](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.overall.OverallModerationConfig):param overall_config:
:type configs: `List` [ [ModerationConfiguration](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.configuration.ModerationConfiguration)]
:param configs:

Return type: `ID` of `the new custom model version.`

### GuardNemoInfo

Details of a NeMo Guardrails moderation guard.

### OverallModerationConfig

Details of overall moderation configuration for a model.

#### find()

Find overall configuration by entity ID and entity type.
Each entity (such as a customModelVersion) may have at most 1 overall moderation configuration.

Added in version v3.6.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | ID of the entity |
| entity_type | str | Type of the entity |

Returns

| Returns | Description |
| --- | --- |
| an OverallModerationConfig or None |  |

Return type: `Optional[OverallModerationConfig]`

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status |
| datarobot.errors.ServerError | if the server responded with 5xx status |

#### locate()

Find overall configuration by entity ID and entity type.
This version of find() expects the object to exist. Its return type is not optional.

Added in version v3.6.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | ID of the entity |
| entity_type | str | Type of the entity |

Returns

| Returns | Description |
| --- | --- |
| a list of OverallModerationConfig |  |

Return type: `List[OverallModerationConfig]`

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status |
| datarobot.errors.ServerError | if the server responded with 5xx status |

#### create()

Create an OverallModerationConfig.

Added in version v3.6.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| timeout_sec | int | how long to wait for all moderation tasks in a phase to complete. |
| timeout_action | ModerationTimeoutActionType | what to do if moderation times out. |
| entity_id | str | entity, such as customModelVersion, that this configuration applies to. |
| entity_type | ModerationGuardEntityType | type of the entity defined by entity_id |

Returns

| Returns | Description |
| --- | --- |
| created OverallModerationConfig |  |

Return type: [OverallModerationConfig](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.overall.OverallModerationConfig)

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status. |
| datarobot.errors.ServerError | if the server responded with 5xx status. |

#### update()

Update an OverallModerationConfig.

Added in version v3.6.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| timeout_sec | int | how long to wait for all moderation tasks in a phase to complete. |
| timeout_action | ModerationTimeoutActionType | what to do if moderation times out. |
| entity_id | str | entity, such as customModelVersion, that this configuration applies to. |
| entity_type | ModerationGuardEntityType | type of the entity defined by entity_id |

Returns

| Returns | Description |
| --- | --- |
| created OverallModerationConfig |  |

Return type: [OverallModerationConfig](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.overall.OverallModerationConfig)

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status. |
| datarobot.errors.ServerError | if the server responded with 5xx status. |

#### refresh()

Update OverallModerationConfig with the latest data from server.

Added in version v3.6.

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status |
| datarobot.errors.ServerError | if the server responded with 5xx status |

Return type: `None`

### ModerationTemplate

A DataRobot Moderation Template.

Added in version v3.6.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| id | str | ID of the Template |
| name | str | Template name |

#### get()

Get Template by id.

Added in version v3.6.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| template_id | str | ID of the Template |

Returns

| Returns | Description |
| --- | --- |
| retrieved Template |  |

Return type: [ModerationTemplate](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.template.ModerationTemplate)

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status. |
| datarobot.errors.ServerError | if the server responded with 5xx status. |

#### list()

List Templates.

Added in version v3.6.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| yet |  | (none) |

Returns

| Returns | Description |
| --- | --- |
| a list of Templates |  |

Return type: `List[ModerationTemplate]`

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status |
| datarobot.errors.ServerError | if the server responded with 5xx status |

#### find()

Find Template by name.

Added in version v3.6.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| name | str | name of the Template |

Returns

| Returns | Description |
| --- | --- |
| a list of Templates |  |

Return type: `List[ModerationTemplate]`

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status |
| datarobot.errors.ServerError | if the server responded with 5xx status |

#### create()

Create a Template.

Added in version v3.6.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| name | str | name of the template. |
| description | str | description of the template. |
| type | GuardType | type of the template. |
| allowed_stages | List[ModerationGuardStage] | the stages of moderation this guard is allowed to be used |
| ootb_type | ModerationGuardOotbType | for guards of type “ootb”, the specific “Out of the Box” metric type. |
| llm_type | Optional[ModerationGuardLlmType] | the backing LLM this guard uses. |
| nemo_info | Optional[GuardNemoInfo] | additional configuration for NeMo Guardrails guards. |
| model_info | Optional[GuardModelInfo] | additional configuration for guards using a deployed model. |
| intervention | Optional[GuardInterventionForTemplate] | the assessment conditions, and action the guard should take if conditions are met. |

Returns

| Returns | Description |
| --- | --- |
| created Template |  |

Return type: [ModerationTemplate](https://docs.datarobot.com/ja/docs/api/reference/sdk/gen-moderation.html.md#datarobot.models.moderation.template.ModerationTemplate)

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status. |
| datarobot.errors.ServerError | if the server responded with 5xx status. |

#### update()

Update Template. All fields are optional, and omitted fields are left unchanged.

Added in version v3.6.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| name | str | name of the template. |
| description | str | description of the template. |
| type | GuardType | type of the template. |
| allowed_stages | List[ModerationGuardStage] | the stages of moderation this guard is allowed to be used |
| ootb_type | ModerationGuardOotbType | for guards of type “ootb”, the specific “Out of the Box” metric type. |
| llm_type | Optional[ModerationGuardLlmType] | the backing LLM this guard uses. |
| nemo_info | Optional[GuardNemoInfo] | additional configuration for NeMo Guardrails guards. |
| model_info | Optional[GuardModelInfo] | additional configuration for guards using a deployed model. |
| intervention | Optional[GuardInterventionForTemplate] | the assessment conditions, and action the guard should take if conditions are met. |

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status. |
| datarobot.errors.ServerError | if the server responded with 5xx status. |

Return type: `None`

#### refresh()

Update Template with the latest data from server.

Added in version v3.6.

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status |
| datarobot.errors.ServerError | if the server responded with 5xx status |

Return type: `None`

#### delete()

Delete Template.

Added in version v3.6.

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | If the server responded with 4xx status. |
| datarobot.errors.ServerError | If the server responded with 5xx status. |

Return type: `None`

### ModerationGuardOotbType

Defines the available OOTB guards.
