# 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-05-06T18:17:09.834382+00:00` (UTC).

## Primary page

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

## Sections on this page

- [classdatarobot.models.moderation.configuration.ModerationConfiguration](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.configuration.ModerationConfiguration): In-page section heading.
- [classmethodget(config_id)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.configuration.ModerationConfiguration.get): In-page section heading.
- [classmethodlist(entity_id, entity_type)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.configuration.ModerationConfiguration.list): In-page section heading.
- [classmethodcreate(template_id, name, description, stages, entity_id, entity_type, intervention=None, llm_type=None, deployment_id=None, model_info=None, nemo_info=None, openai_api_key='', openai_api_base='', openai_deployment_id='', openai_credential='')](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.configuration.ModerationConfiguration.create): In-page section heading.
- [update(name=None, description=None, intervention=None, llm_type=None, deployment_id=None, model_info=None, nemo_info=None, openai_api_key='', openai_api_base='', openai_deployment_id='', openai_credential='')](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.configuration.ModerationConfiguration.update): In-page section heading.
- [refresh()](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.configuration.ModerationConfiguration.refresh): In-page section heading.
- [delete()](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.configuration.ModerationConfiguration.delete): In-page section heading.
- [classdatarobot.models.moderation.intervention.GuardInterventionCondition](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.intervention.GuardInterventionCondition): In-page section heading.
- [classdatarobot.models.moderation.intervention.GuardInterventionForTemplate](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.intervention.GuardInterventionForTemplate): In-page section heading.
- [classmethodensure_object(maybe_dict)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.intervention.GuardInterventionForTemplate.ensure_object): In-page section heading.
- [classdatarobot.models.moderation.intervention.GuardInterventionForConfiguration](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.intervention.GuardInterventionForConfiguration): In-page section heading.
- [classmethodensure_object(maybe_dict)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.intervention.GuardInterventionForConfiguration.ensure_object): In-page section heading.
- [classdatarobot.models.moderation.model_info.GuardModelInfo](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.model_info.GuardModelInfo): In-page section heading.
- [to_dict()](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.model_info.GuardModelInfo.to_dict): In-page section heading.
- [classmethodensure_object(maybe_dict)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.model_info.GuardModelInfo.ensure_object): In-page section heading.
- [classdatarobot.models.moderation.model_version_update.ModelVersionUpdate](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.model_version_update.ModelVersionUpdate): In-page section heading.
- [classmethodnew_custom_model_version_with_config(custom_model_id, overall_config, configs)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.model_version_update.ModelVersionUpdate.new_custom_model_version_with_config): In-page section heading.
- [classdatarobot.models.moderation.nemo_info.GuardNemoInfo](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.nemo_info.GuardNemoInfo): In-page section heading.
- [classdatarobot.models.moderation.overall.OverallModerationConfig](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.overall.OverallModerationConfig): In-page section heading.
- [classmethodfind(entity_id, entity_type)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.overall.OverallModerationConfig.find): In-page section heading.
- [classmethodlocate(entity_id, entity_type)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.overall.OverallModerationConfig.locate): In-page section heading.
- [classmethodcreate(timeout_sec, timeout_action, entity_id, entity_type)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.overall.OverallModerationConfig.create): In-page section heading.
- [update(timeout_sec, timeout_action, entity_id, entity_type)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.overall.OverallModerationConfig.update): In-page section heading.
- [refresh()](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.overall.OverallModerationConfig.refresh): In-page section heading.
- [classdatarobot.models.moderation.template.ModerationTemplate](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.template.ModerationTemplate): In-page section heading.
- [classmethodget(template_id)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.template.ModerationTemplate.get): In-page section heading.
- [classmethodlist(include_agentic=None, is_agentic=None, for_playground=None, for_production=None, name=None)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.template.ModerationTemplate.list): In-page section heading.
- [classmethodfind(name)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.template.ModerationTemplate.find): In-page section heading.
- [classmethodcreate(name, description, type, allowed_stages, intervention=None, ootb_type=None, llm_type=None, model_info=None, nemo_info=None)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.template.ModerationTemplate.create): In-page section heading.
- [update(name=None, description=None, type=None, allowed_stages=None, intervention=None, ootb_type=None, llm_type=None, model_info=None, nemo_info=None)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.template.ModerationTemplate.update): In-page section heading.
- [refresh()](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.template.ModerationTemplate.refresh): In-page section heading.
- [delete()](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.template.ModerationTemplate.delete): In-page section heading.
- [classdatarobot.enums.ModerationGuardOotbType](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.enums.ModerationGuardOotbType): In-page section heading.

## Related documentation

- [Developer documentation](https://docs.datarobot.com/en/docs/api/index.html): Linked from this page.
- [API reference](https://docs.datarobot.com/en/docs/api/reference/index.html): Linked from this page.
- [datarobot.errors.ClientError](https://docs.datarobot.com/en/docs/api/reference/sdk/errors.html#datarobot.errors.ClientError): Linked from this page.

## Documentation content

### class datarobot.models.moderation.configuration.ModerationConfiguration

Details of overall moderation configuration for a model.

#### classmethod get(config_id)

Get a guard configuration by ID.

Added in version v3.6.

- Parameters: config_id ( str ) – ID of the configuration
- Returns: retrieved configuration
- Return type: ModerationConfiguration
- Raises:

#### classmethod list(entity_id, entity_type)

List Guard Configurations.

Added in version v3.6.

- Parameters:
- Returns: a list of configurations
- Return type: List[ModerationConfiguration]
- Raises:

#### classmethod create(template_id, name, description, stages, entity_id, entity_type, intervention=None, llm_type=None, deployment_id=None, model_info=None, nemo_info=None, openai_api_key='', openai_api_base='', openai_deployment_id='', openai_credential='')

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

Added in version v3.6.

- Parameters:
- Returns: created ModerationConfiguration
- Return type: ModerationConfiguration
- Raises:

#### update(name=None, description=None, intervention=None, llm_type=None, deployment_id=None, model_info=None, nemo_info=None, openai_api_key='', openai_api_base='', openai_deployment_id='', openai_credential='')

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:
- Raises:
- Return type: None

#### refresh()

Update OverallModerationConfig with the latest data from server.

Added in version v3.6.

- Raises:
- Return type: None

#### delete()

Delete configuration.

Added in version v3.6.

- Raises:
- Return type: None

### class datarobot.models.moderation.intervention.GuardInterventionCondition

Defines a condition for intervention.

### class datarobot.models.moderation.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.

#### classmethod ensure_object(maybe_dict)

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

- Return type: GuardInterventionForTemplate

### class datarobot.models.moderation.intervention.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.

#### classmethod ensure_object(maybe_dict)

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

- Return type: GuardInterventionForConfiguration

### class datarobot.models.moderation.model_info.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 ]]

#### classmethod ensure_object(maybe_dict)

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

- Return type: GuardModelInfo

### class datarobot.models.moderation.model_version_update.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.

#### classmethod new_custom_model_version_with_config(custom_model_id, overall_config, configs)

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/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.overall.OverallModerationConfig):param overall_config:
:type configs: `List` [ [ModerationConfiguration](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-moderation.html#datarobot.models.moderation.configuration.ModerationConfiguration)]
:param configs:

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

### class datarobot.models.moderation.nemo_info.GuardNemoInfo

Details of a NeMo Guardrails moderation guard.

### class datarobot.models.moderation.overall.OverallModerationConfig

Details of overall moderation configuration for a model.

#### classmethod find(entity_id, entity_type)

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:
- Returns: an OverallModerationConfig or None
- Return type: Optional[OverallModerationConfig]
- Raises:

#### classmethod locate(entity_id, entity_type)

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:
- Returns: a list of OverallModerationConfig
- Return type: List[OverallModerationConfig]
- Raises:

#### classmethod create(timeout_sec, timeout_action, entity_id, entity_type)

Create an OverallModerationConfig.

Added in version v3.6.

- Parameters:
- Returns: created OverallModerationConfig
- Return type: OverallModerationConfig
- Raises:

#### update(timeout_sec, timeout_action, entity_id, entity_type)

Update an OverallModerationConfig.

Added in version v3.6.

- Parameters:
- Returns: created OverallModerationConfig
- Return type: OverallModerationConfig
- Raises:

#### refresh()

Update OverallModerationConfig with the latest data from server.

Added in version v3.6.

- Raises:
- Return type: None

### class datarobot.models.moderation.template.ModerationTemplate

A DataRobot Moderation Template.

Added in version v3.6.

- Variables:

#### classmethod get(template_id)

Get Template by id.

Added in version v3.6.

- Parameters: template_id ( str ) – ID of the Template
- Returns: retrieved Template
- Return type: ModerationTemplate
- Raises:

#### classmethod list(include_agentic=None, is_agentic=None, for_playground=None, for_production=None, name=None)

List Templates.

Added in version v3.6.

- Parameters: yet ( none )
- Returns: a list of Templates
- Return type: List[ModerationTemplate]
- Raises:

#### classmethod find(name)

Find Template by name.

Added in version v3.6.

- Parameters: name ( str ) – name of the Template
- Returns: a list of Templates
- Return type: List[ModerationTemplate]
- Raises:

#### classmethod create(name, description, type, allowed_stages, intervention=None, ootb_type=None, llm_type=None, model_info=None, nemo_info=None)

Create a Template.

Added in version v3.6.

- Parameters:
- Returns: created Template
- Return type: ModerationTemplate
- Raises:

#### update(name=None, description=None, type=None, allowed_stages=None, intervention=None, ootb_type=None, llm_type=None, model_info=None, nemo_info=None)

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

Added in version v3.6.

- Parameters:
- Raises:
- Return type: None

#### refresh()

Update Template with the latest data from server.

Added in version v3.6.

- Raises:
- Return type: None

#### delete()

Delete Template.

Added in version v3.6.

- Raises:
- Return type: None

### class datarobot.enums.ModerationGuardOotbType

Defines the available OOTB guards.
