REST Resource: projects.locations.templates

Resource: Template

Message describing Template resource

JSON representation
{
  "name": string,
  "createTime": string,
  "updateTime": string,
  "labels": {
    string: string,
    ...
  },
  "filterConfig": {
    object (FilterConfig)
  },
  "templateMetadata": {
    object (TemplateMetadata)
  }
}
Fields
name

string

Identifier. name of resource

createTime

string (Timestamp format)

Output only. [Output only] Create time stamp

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

Output only. [Output only] Update time stamp

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

labels

map (key: string, value: string)

Optional. Labels as key value pairs

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

filterConfig

object (FilterConfig)

Required. filter configuration for this template

templateMetadata

object (TemplateMetadata)

Optional. metadata for this template

FilterConfig

Filters configuration.

JSON representation
{
  "raiSettings": {
    object (RaiFilterSettings)
  },
  "sdpSettings": {
    object (SdpFilterSettings)
  },
  "piAndJailbreakFilterSettings": {
    object (PiAndJailbreakFilterSettings)
  },
  "maliciousUriFilterSettings": {
    object (MaliciousUriFilterSettings)
  }
}
Fields
raiSettings

object (RaiFilterSettings)

Optional. Responsible AI settings.

sdpSettings

object (SdpFilterSettings)

Optional. Sensitive Data Protection settings.

piAndJailbreakFilterSettings

object (PiAndJailbreakFilterSettings)

Optional. Prompt injection and Jailbreak filter settings.

maliciousUriFilterSettings

object (MaliciousUriFilterSettings)

Optional. Malicious URI filter settings.

RaiFilterSettings

Responsible AI Filter settings.

JSON representation
{
  "raiFilters": [
    {
      object (RaiFilter)
    }
  ]
}
Fields
raiFilters[]

object (RaiFilter)

Required. List of Responsible AI filters enabled for template.

RaiFilter

Responsible AI filter.

JSON representation
{
  "filterType": enum (RaiFilterType),
  "confidenceLevel": enum (DetectionConfidenceLevel)
}
Fields
filterType

enum (RaiFilterType)

Required. Type of responsible AI filter.

confidenceLevel

enum (DetectionConfidenceLevel)

Optional. Confidence level for this RAI filter. During data sanitization, if data is classified under this filter with a confidence level equal to or greater than the specified level, a positive match is reported. If the confidence level is unspecified (i.e., 0), the system will use a reasonable default level based on the filterType.

RaiFilterType

Options for responsible AI Filter Types.

Enums
RAI_FILTER_TYPE_UNSPECIFIED Unspecified filter type.
SEXUALLY_EXPLICIT Sexually Explicit.
HATE_SPEECH Hate Speech.
HARASSMENT Harassment.
DANGEROUS Danger

DetectionConfidenceLevel

Confidence levels for detectors. Higher value maps to a greater confidence level. To enforce stricter level a lower value should be used.

Enums
DETECTION_CONFIDENCE_LEVEL_UNSPECIFIED Same as LOW_AND_ABOVE.
LOW_AND_ABOVE Highest chance of a false positive.
MEDIUM_AND_ABOVE Some chance of false positives.
HIGH Low chance of false positives.

SdpFilterSettings

Sensitive Data Protection settings.

JSON representation
{

  // Union field sdp_configuration can be only one of the following:
  "basicConfig": {
    object (SdpBasicConfig)
  },
  "advancedConfig": {
    object (SdpAdvancedConfig)
  }
  // End of list of possible types for union field sdp_configuration.
}
Fields
Union field sdp_configuration. Either of Sensitive Data Protection basic or advanced configuration. sdp_configuration can be only one of the following:
basicConfig

object (SdpBasicConfig)

Optional. Basic Sensitive Data Protection configuration inspects the content for sensitive data using a fixed set of six info-types. Sensitive Data Protection templates cannot be used with basic configuration. Only Sensitive Data Protection inspection operation is supported with basic configuration.

advancedConfig

object (SdpAdvancedConfig)

Optional. Advanced Sensitive Data Protection configuration which enables use of Sensitive Data Protection templates. Supports both Sensitive Data Protection inspection and de-identification operations.

SdpBasicConfig

Sensitive Data Protection basic configuration.

JSON representation
{
  "filterEnforcement": enum (SdpBasicConfigEnforcement)
}
Fields
filterEnforcement

enum (SdpBasicConfigEnforcement)

Optional. Tells whether the Sensitive Data Protection basic config is enabled or disabled.

SdpBasicConfigEnforcement

Option to specify the state of Sensitive Data Protection basic config (ENABLED/DISABLED).

Enums
SDP_BASIC_CONFIG_ENFORCEMENT_UNSPECIFIED Same as Disabled
ENABLED Enabled
DISABLED Disabled

SdpAdvancedConfig

Sensitive Data Protection Advanced configuration.

JSON representation
{
  "inspectTemplate": string,
  "deidentifyTemplate": string
}
Fields
inspectTemplate

string

Optional. Sensitive Data Protection inspect template resource name

If only inspect template is provided (de-identify template not provided), then Sensitive Data Protection InspectContent action is performed during Sanitization. All Sensitive Data Protection findings identified during inspection will be returned as SdpFinding in SdpInsepctionResult e.g. organizations/{organization}/inspectTemplates/{inspectTemplate}, projects/{project}/inspectTemplates/{inspectTemplate} organizations/{organization}/locations/{location}/inspectTemplates/{inspectTemplate} projects/{project}/locations/{location}/inspectTemplates/{inspectTemplate}

deidentifyTemplate

string

Optional. Optional Sensitive Data Protection Deidentify template resource name.

If provided then DeidentifyContent action is performed during Sanitization using this template and inspect template. The De-identified data will be returned in SdpDeidentifyResult. Note that all info-types present in the deidentify template must be present in inspect template.

e.g. organizations/{organization}/deidentifyTemplates/{deidentifyTemplate}, projects/{project}/deidentifyTemplates/{deidentifyTemplate} organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentifyTemplate} projects/{project}/locations/{location}/deidentifyTemplates/{deidentifyTemplate}

PiAndJailbreakFilterSettings

Prompt injection and Jailbreak Filter settings.

JSON representation
{
  "filterEnforcement": enum (PiAndJailbreakFilterEnforcement),
  "confidenceLevel": enum (DetectionConfidenceLevel)
}
Fields
filterEnforcement

enum (PiAndJailbreakFilterEnforcement)

Optional. Tells whether Prompt injection and Jailbreak filter is enabled or disabled.

confidenceLevel

enum (DetectionConfidenceLevel)

Optional. Confidence level for this filter. Confidence level is used to determine the threshold for the filter. If detection confidence is equal to or greater than the specified level, a positive match is reported. Confidence level will only be used if the filter is enabled.

PiAndJailbreakFilterEnforcement

Option to specify the state of Prompt Injection and Jailbreak filter (ENABLED/DISABLED).

Enums
PI_AND_JAILBREAK_FILTER_ENFORCEMENT_UNSPECIFIED Same as Disabled
ENABLED Enabled
DISABLED Enabled

MaliciousUriFilterSettings

Malicious URI filter settings.

JSON representation
{
  "filterEnforcement": enum (MaliciousUriFilterEnforcement)
}
Fields
filterEnforcement

enum (MaliciousUriFilterEnforcement)

Optional. Tells whether the Malicious URI filter is enabled or disabled.

MaliciousUriFilterEnforcement

Option to specify the state of Malicious URI filter (ENABLED/DISABLED).

Enums
MALICIOUS_URI_FILTER_ENFORCEMENT_UNSPECIFIED Same as Disabled
ENABLED Enabled
DISABLED Disabled

TemplateMetadata

Message describing TemplateMetadata

JSON representation
{
  "ignorePartialInvocationFailures": boolean,
  "customPromptSafetyErrorCode": integer,
  "customPromptSafetyErrorMessage": string,
  "customLlmResponseSafetyErrorCode": integer,
  "customLlmResponseSafetyErrorMessage": string,
  "logTemplateOperations": boolean,
  "logSanitizeOperations": boolean
}
Fields
ignorePartialInvocationFailures

boolean

Optional. If true, partial detector failures should be ignored.

customPromptSafetyErrorCode

integer

Optional. Indicates the custom error code set by the user to be returned to the end user by the service extension if the prompt trips Model Armor filters.

customPromptSafetyErrorMessage

string

Optional. Indicates the custom error message set by the user to be returned to the end user if the prompt trips Model Armor filters.

customLlmResponseSafetyErrorCode

integer

Optional. Indicates the custom error code set by the user to be returned to the end user if the LLM response trips Model Armor filters.

customLlmResponseSafetyErrorMessage

string

Optional. Indicates the custom error message set by the user to be returned to the end user if the LLM response trips Model Armor filters.

logTemplateOperations

boolean

Optional. If true, log template crud operations.

logSanitizeOperations

boolean

Optional. If true, log sanitize operations.

Methods

create

Creates a new Template in a given project and location.

delete

Deletes a single Template.

get

Gets details of a single Template.

list

Lists Templates in a given project and location.

patch

Updates the parameters of a single Template.

sanitizeModelResponse

Sanitizes Model Response.

sanitizeUserPrompt

Sanitizes User Prompt.