SanitizationResult

Sanitization result after applying all the filters on input content.

JSON representation
{
  "filterMatchState": enum (FilterMatchState),
  "filterResults": {
    string: {
      object (FilterResult)
    },
    ...
  },
  "invocationResult": enum (InvocationResult),
  "sanitizationMetadata": {
    object (SanitizationMetadata)
  }
}
Fields
filterMatchState

enum (FilterMatchState)

Output only. Overall filter match state for Sanitization. The state can have below two values.

1) NO_MATCH_FOUND: No filters in configuration satisfy matching criteria. In other words, input passed all filters.

2) MATCH_FOUND: At least one filter in configuration satisfies matching. In other words, input did not pass one or more filters.

filterResults

map (key: string, value: object (FilterResult))

Output only. Results for all filters where the key is the filter name - either of "csam", "malicious_uris", "rai", "pi_and_jailbreak" ,"sdp".

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

invocationResult

enum (InvocationResult)

Output only. A field indicating the outcome of the invocation, irrespective of match status. It can have the following three values: SUCCESS: All filters were executed successfully. PARTIAL: Some filters were skipped or failed execution. FAILURE: All filters were skipped or failed execution.

sanitizationMetadata

object (SanitizationMetadata)

Output only. Metadata related to Sanitization.

FilterMatchState

Option to specify filter match state.

Enums
FILTER_MATCH_STATE_UNSPECIFIED Unused
NO_MATCH_FOUND Matching criteria is not achieved for filters.
MATCH_FOUND Matching criteria is achieved for the filter.

FilterResult

Filter Result obtained after Sanitization operations.

JSON representation
{

  // Union field filter_result can be only one of the following:
  "raiFilterResult": {
    object (RaiFilterResult)
  },
  "sdpFilterResult": {
    object (SdpFilterResult)
  },
  "piAndJailbreakFilterResult": {
    object (PiAndJailbreakFilterResult)
  },
  "maliciousUriFilterResult": {
    object (MaliciousUriFilterResult)
  },
  "csamFilterFilterResult": {
    object (CsamFilterResult)
  },
  "virusScanFilterResult": {
    object (VirusScanFilterResult)
  }
  // End of list of possible types for union field filter_result.
}
Fields
Union field filter_result. Encapsulates one of responsible AI, Sensitive Data Protection, Prompt Injection and Jailbreak, Malicious URI, CSAM, Virus Scan related filter results. filter_result can be only one of the following:
raiFilterResult

object (RaiFilterResult)

Responsible AI filter results.

sdpFilterResult

object (SdpFilterResult)

Sensitive Data Protection results.

piAndJailbreakFilterResult

object (PiAndJailbreakFilterResult)

Prompt injection and Jailbreak filter results.

maliciousUriFilterResult

object (MaliciousUriFilterResult)

Malicious URI filter results.

csamFilterFilterResult

object (CsamFilterResult)

CSAM filter results.

virusScanFilterResult

object (VirusScanFilterResult)

Virus scan results.

RaiFilterResult

Responsible AI Result.

JSON representation
{
  "executionState": enum (FilterExecutionState),
  "messageItems": [
    {
      object (MessageItem)
    }
  ],
  "matchState": enum (FilterMatchState),
  "raiFilterTypeResults": {
    string: {
      object (RaiFilterTypeResult)
    },
    ...
  }
}
Fields
executionState

enum (FilterExecutionState)

Output only. Reports whether the RAI filter was successfully executed or not.

messageItems[]

object (MessageItem)

Optional messages corresponding to the result. A message can provide warnings or error details. For example, if execution state is skipped then this field provides related reason/explanation.

matchState

enum (FilterMatchState)

Output only. Overall filter match state for RAI. Value is MATCH_FOUND if at least one RAI filter confidence level is equal to or higher than the confidence level defined in configuration.

raiFilterTypeResults

map (key: string, value: object (RaiFilterTypeResult))

The map of RAI filter results where key is RAI filter type - either of "sexually_explicit", "hate_speech", "harassment", "dangerous".

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

FilterExecutionState

Enum which reports whether a specific filter executed successfully or not.

Enums
FILTER_EXECUTION_STATE_UNSPECIFIED Unused
EXECUTION_SUCCESS Filter executed successfully
EXECUTION_SKIPPED Filter execution was skipped. This can happen due to server-side error or permission issue.

MessageItem

Message item to report information, warning or error messages.

JSON representation
{
  "messageType": enum (MessageType),
  "message": string
}
Fields
messageType

enum (MessageType)

Type of message.

message

string

The message content.

MessageType

Option to specify the type of message.

Enums
MESSAGE_TYPE_UNSPECIFIED Unused
INFO Information related message.
WARNING Warning related message.
ERROR Error message.

RaiFilterTypeResult

Detailed Filter result for each of the responsible AI Filter Types.

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

enum (RaiFilterType)

Type of responsible AI filter.

confidenceLevel

enum (DetectionConfidenceLevel)

Confidence level identified for this RAI filter.

matchState

enum (FilterMatchState)

Output only. Match state for this RAI filter.

SdpFilterResult

Sensitive Data Protection filter result.

JSON representation
{

  // Union field result can be only one of the following:
  "inspectResult": {
    object (SdpInspectResult)
  },
  "deidentifyResult": {
    object (SdpDeidentifyResult)
  }
  // End of list of possible types for union field result.
}
Fields
Union field result. Either of Sensitive Data Protection Inspect result or Deidentify result. result can be only one of the following:
inspectResult

object (SdpInspectResult)

Sensitive Data Protection Inspection result if inspection is performed.

deidentifyResult

object (SdpDeidentifyResult)

Sensitive Data Protection Deidentification result if deidentification is performed.

SdpInspectResult

Sensitive Data Protection Inspection Result.

JSON representation
{
  "executionState": enum (FilterExecutionState),
  "messageItems": [
    {
      object (MessageItem)
    }
  ],
  "matchState": enum (FilterMatchState),
  "findings": [
    {
      object (SdpFinding)
    }
  ],
  "findingsTruncated": boolean
}
Fields
executionState

enum (FilterExecutionState)

Output only. Reports whether Sensitive Data Protection inspection was successfully executed or not.

messageItems[]

object (MessageItem)

Optional messages corresponding to the result. A message can provide warnings or error details. For example, if execution state is skipped then this field provides related reason/explanation.

matchState

enum (FilterMatchState)

Output only. Match state for SDP Inspection. Value is MATCH_FOUND if at least one Sensitive Data Protection finding is identified.

findings[]

object (SdpFinding)

List of Sensitive Data Protection findings.

findingsTruncated

boolean

If true, then there is possibility that more findings were identified and the findings returned are a subset of all findings. The findings list might be truncated because the input items were too large, or because the server reached the maximum amount of resources allowed for a single API call.

SdpFinding

Finding corresponding to Sensitive Data Protection filter.

JSON representation
{
  "infoType": string,
  "likelihood": enum (SdpFindingLikelihood),
  "location": {
    object (SdpFindingLocation)
  }
}
Fields
infoType

string

Name of Sensitive Data Protection info type for this finding.

likelihood

enum (SdpFindingLikelihood)

Identified confidence likelihood for infoType.

location

object (SdpFindingLocation)

Location for this finding.

SdpFindingLikelihood

For more information about each Sensitive Data Protection likelihood level, see https://cloud.google.com/sensitive-data-protection/docs/likelihood.

Enums
SDP_FINDING_LIKELIHOOD_UNSPECIFIED Default value; same as POSSIBLE.
VERY_UNLIKELY Highest chance of a false positive.
UNLIKELY High chance of a false positive.
POSSIBLE Some matching signals. The default value.
LIKELY Low chance of a false positive.
VERY_LIKELY Confidence level is high. Lowest chance of a false positive.

SdpFindingLocation

Location of this Sensitive Data Protection Finding within input content.

JSON representation
{
  "byteRange": {
    object (RangeInfo)
  },
  "codepointRange": {
    object (RangeInfo)
  }
}
Fields
byteRange

object (RangeInfo)

Zero-based byte offsets delimiting the finding. These are relative to the finding's containing element. Note that when the content is not textual, this references the UTF-8 encoded textual representation of the content.

codepointRange

object (RangeInfo)

Unicode character offsets delimiting the finding. These are relative to the finding's containing element. Provided when the content is text.

RangeInfo

Half-open range interval [start, end)

JSON representation
{
  "start": string,
  "end": string
}
Fields
start

string (int64 format)

For proto3, value cannot be set to 0 unless the field is optional. Ref: https://protobuf.dev/programming-guides/proto3/#default Index of first character (inclusive).

end

string (int64 format)

Index of last character (exclusive).

SdpDeidentifyResult

Sensitive Data Protection Deidentification Result.

JSON representation
{
  "executionState": enum (FilterExecutionState),
  "messageItems": [
    {
      object (MessageItem)
    }
  ],
  "matchState": enum (FilterMatchState),
  "data": {
    object (DataItem)
  },
  "transformedBytes": string
}
Fields
executionState

enum (FilterExecutionState)

Output only. Reports whether Sensitive Data Protection deidentification was successfully executed or not.

messageItems[]

object (MessageItem)

Optional messages corresponding to the result. A message can provide warnings or error details. For example, if execution state is skipped then this field provides related reason/explanation.

matchState

enum (FilterMatchState)

Output only. Match state for Sensitive Data Protection Deidentification. Value is MATCH_FOUND if content is de-identified.

data

object (DataItem)

De-identified data.

transformedBytes

string (int64 format)

Total size in bytes that were transformed during deidentification.

PiAndJailbreakFilterResult

Prompt injection and Jailbreak Filter Result.

JSON representation
{
  "executionState": enum (FilterExecutionState),
  "messageItems": [
    {
      object (MessageItem)
    }
  ],
  "matchState": enum (FilterMatchState),
  "confidenceLevel": enum (DetectionConfidenceLevel)
}
Fields
executionState

enum (FilterExecutionState)

Output only. Reports whether Prompt injection and Jailbreak filter was successfully executed or not.

messageItems[]

object (MessageItem)

Optional messages corresponding to the result. A message can provide warnings or error details. For example, if execution state is skipped then this field provides related reason/explanation.

matchState

enum (FilterMatchState)

Output only. Match state for Prompt injection and Jailbreak.

confidenceLevel

enum (DetectionConfidenceLevel)

Confidence level identified for Prompt injection and Jailbreak.

MaliciousUriFilterResult

Malicious URI Filter Result.

JSON representation
{
  "executionState": enum (FilterExecutionState),
  "messageItems": [
    {
      object (MessageItem)
    }
  ],
  "matchState": enum (FilterMatchState),
  "maliciousUriMatchedItems": [
    {
      object (MaliciousUriMatchedItem)
    }
  ]
}
Fields
executionState

enum (FilterExecutionState)

Output only. Reports whether Malicious URI filter was successfully executed or not.

messageItems[]

object (MessageItem)

Optional messages corresponding to the result. A message can provide warnings or error details. For example, if execution state is skipped then this field provides related reason/explanation.

matchState

enum (FilterMatchState)

Output only. Match state for this Malicious URI. Value is MATCH_FOUND if at least one Malicious URI is found.

maliciousUriMatchedItems[]

object (MaliciousUriMatchedItem)

List of Malicious URIs found in data.

MaliciousUriMatchedItem

Information regarding malicious URI and its location within the input content.

JSON representation
{
  "uri": string,
  "locations": [
    {
      object (RangeInfo)
    }
  ]
}
Fields
uri

string

Malicious URI.

locations[]

object (RangeInfo)

List of locations where Malicious URI is identified. The locations field is supported only for plaintext content i.e. ByteItemType.PLAINTEXT_UTF8

CsamFilterResult

CSAM (Child Safety Abuse Material) Filter Result

JSON representation
{
  "executionState": enum (FilterExecutionState),
  "messageItems": [
    {
      object (MessageItem)
    }
  ],
  "matchState": enum (FilterMatchState)
}
Fields
executionState

enum (FilterExecutionState)

Output only. Reports whether the CSAM filter was successfully executed or not.

messageItems[]

object (MessageItem)

Optional messages corresponding to the result. A message can provide warnings or error details. For example, if execution state is skipped then this field provides related reason/explanation.

matchState

enum (FilterMatchState)

Output only. Match state for CSAM.

VirusScanFilterResult

Virus scan results.

JSON representation
{
  "executionState": enum (FilterExecutionState),
  "messageItems": [
    {
      object (MessageItem)
    }
  ],
  "matchState": enum (FilterMatchState),
  "scannedContentType": enum (ScannedContentType),
  "virusDetails": [
    {
      object (VirusDetail)
    }
  ],
  "scannedSize": string
}
Fields
executionState

enum (FilterExecutionState)

Output only. Reports whether Virus Scan was successfully executed or not.

messageItems[]

object (MessageItem)

Optional messages corresponding to the result. A message can provide warnings or error details. For example, if execution status is skipped then this field provides related reason/explanation.

matchState

enum (FilterMatchState)

Output only. Match status for Virus. Value is MATCH_FOUND if the data is infected with a virus.

scannedContentType

enum (ScannedContentType)

Type of content scanned.

virusDetails[]

object (VirusDetail)

List of Viruses identified. This field will be empty if no virus was detected.

scannedSize

string (int64 format)

Size of scanned content in bytes.

ScannedContentType

Type of content scanned.

Enums
SCANNED_CONTENT_TYPE_UNSPECIFIED Unused
UNKNOWN Unknown content
PLAINTEXT Plaintext
PDF PDF Scanning for only PDF is supported.

VirusDetail

Details of an identified virus

JSON representation
{
  "vendor": string,
  "names": [
    string
  ],
  "threatType": enum (ThreatType)
}
Fields
vendor

string

Name of vendor that produced this virus identification.

names[]

string

Names of this Virus.

threatType

enum (ThreatType)

Threat type of the identified virus

ThreatType

Defines all the threat types of a virus

Enums
THREAT_TYPE_UNSPECIFIED Unused
UNKNOWN Unable to categorize threat
VIRUS_OR_WORM Virus or Worm threat.
MALICIOUS_PROGRAM Malicious program. E.g. Spyware, Trojan.
POTENTIALLY_HARMFUL_CONTENT Potentially harmful content. E.g. Injected code, Macro
POTENTIALLY_UNWANTED_CONTENT Potentially unwanted content. E.g. Adware.

InvocationResult

A field indicating the outcome of the invocation, irrespective of match status.

Enums
INVOCATION_RESULT_UNSPECIFIED Unused. Default value.
SUCCESS All filters were invoked successfully.
PARTIAL Some filters were skipped or failed.
FAILURE All filters were skipped or failed.

SanitizationMetadata

Message describing Sanitization metadata.

JSON representation
{
  "errorCode": string,
  "errorMessage": string
}
Fields
errorCode

string (int64 format)

Error code if any.

errorMessage

string

Error message if any.