Close httplib2 connections.
create(parent, body=None, detectorId=None, x__xgafv=None)
Creates a new customer-defined Detector. The detector is always created DISABLED; EnableDetector starts it scanning.
Deletes a specific detector. Hard and irreversible: the detector is gone from every read path at once.
disable(name, body=None, x__xgafv=None)
Disables a specific detector, so that it stops scanning. Disabling an already-DISABLED detector succeeds and changes nothing. The detector's config and history survive; only DeleteDetector removes a detector.
enable(name, body=None, x__xgafv=None)
Enables a specific detector, so that it starts scanning. Enabling an already-ACTIVE detector succeeds and changes nothing.
get(name, revisionId=None, x__xgafv=None)
Gets the details of a specific detector, including its current configuration.
list(parent, pageSize=None, pageToken=None, x__xgafv=None)
Lists the detectors in a Location.
listRevisions(name, pageSize=None, pageToken=None, x__xgafv=None)
Lists the revisions of a detector, newest first. Each entry is the detector as configured at one revision, with `revision_id` and `revision_create_time` set. `state` and `selected_revision_id` are unset: neither is a property of a revision, and GetDetector returns both.
listRevisions_next(previous_request, previous_response)
Retrieves the next page of results.
list_next(previous_request, previous_response)
Retrieves the next page of results.
patch(name, body=None, updateMask=None, x__xgafv=None)
Updates an existing detector. A mask covering `custom_detector_config` replaces the whole config; `state` cannot be changed here, use EnableDetector or DisableDetector.
close()
Close httplib2 connections.
create(parent, body=None, detectorId=None, x__xgafv=None)
Creates a new customer-defined Detector. The detector is always created DISABLED; EnableDetector starts it scanning.
Args:
parent: string, Required. The resource name of the Location to create the Detector in. Format: `projects/{project}/locations/{location}` (required)
body: object, The request body.
The object takes the form of:
{ # Represents a security rule or LLM-as-a-judge entity that scans agent interactions for anomalies.
"customDetectorConfig": { # The detection logic of a customer-defined detector: deterministic Filters, an LLM-evaluated AnomalyAnalysis, or both. At least one must be set. # Optional. The detection logic for a customer-defined detector. Unset on Google-managed detectors, whose logic is not customer visible.
"anomalyAnalysis": { # A customer-authored description of the anomaly to detect, evaluated by an LLM. # Optional. The anomaly criterion evaluated by an LLM against the sessions the filters admitted, or against every session when no filter is set.
"prompt": "A String", # Required. What the detector should flag, written as a description of the anomaly rather than as instructions to the model. Evaluated against each session's transcript.
},
"filterCombination": "A String", # Optional. How the entries in `filters` combine, as a join over their 1-based positions, for example "1 AND 2" or "1 OR 2 OR 3". The operators are uppercase "AND" and "OR", and each level uses only one of them. To combine both, put one inside parentheses, as in "(1 AND 2) OR 3". Parentheses nest at most one level, and every filter must appear. Required when `filters` holds more than one entry, and validated whenever set.
"filters": [ # Optional. Deterministic predicates a session must satisfy. At most five.
{ # One deterministic predicate over a session: `(field, operation, value)`. A config may carry several; `CustomDetectorConfig.filter_combination` says how they join.
"dataType": "A String", # Optional. How to interpret the field and value. Required for TOOL_CALL_ARGS and TOOL_CALL_RESPONSE, whose underlying values are untyped; must be unset for every other field type, whose type the field itself determines.
"field": { # What the filter observes. # Required. What the filter observes.
"qualifiers": { # Additional context for a field type. One shared message covers every type; which members are required, optional, or rejected depends on `type`, and is validated on write. # Optional. Additional context for `type`.
"toolName": "A String", # Optional. The tool this field refers to. Required for TOOL_CALL_COUNT, TOOL_CALL_ARGS and TOOL_CALL_RESPONSE; enforced on write.
"toolParameterName": "A String", # Optional. The tool parameter whose argument this field refers to. Required for TOOL_CALL_ARGS; enforced on write.
},
"type": "A String", # Required. The observable property.
},
"operation": { # How the field is compared against the value. # Required. How `field` is compared against `value`.
"type": "A String", # Required. The comparison to apply.
},
"value": { # The literal compared against the field. # Required. The literal compared against `field`.
"literal": "A String", # Required. The literal, always carried as a string. `Field.Type` determines how it is interpreted, except for TOOL_CALL_ARGS and TOOL_CALL_RESPONSE, where `Filter.data_type` does.
},
},
],
},
"description": "A String", # Optional. A description of what the detector scans for.
"displayName": "A String", # Optional. The human-readable name of the detector. Example: "Large refund issued".
"name": "A String", # Identifier. The resource name of the detector. Format: `projects/{project}/locations/{location}/detectors/{detector}`
"revisionCreateTime": "A String", # Output only. When this revision was created.
"revisionId": "A String", # Output only. The revision id of the configuration in this response.
"selectedRevisionId": "A String", # Output only. The revision that runs when this detector is ACTIVE. Set whatever the state, because the selected revision is kept through a disable. May differ from `revision_id`: an edit does not change the selected revision, so `revision_id != selected_revision_id` means this detector is holding an edit that enabling it would not apply.
"state": "A String", # Output only. The state of the detector. Only an ACTIVE detector scans.
}
detectorId: string, Optional. The ID to use for the Detector, which becomes the final component of its resource name. Must match `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. If omitted, the server generates one.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Represents a security rule or LLM-as-a-judge entity that scans agent interactions for anomalies.
"customDetectorConfig": { # The detection logic of a customer-defined detector: deterministic Filters, an LLM-evaluated AnomalyAnalysis, or both. At least one must be set. # Optional. The detection logic for a customer-defined detector. Unset on Google-managed detectors, whose logic is not customer visible.
"anomalyAnalysis": { # A customer-authored description of the anomaly to detect, evaluated by an LLM. # Optional. The anomaly criterion evaluated by an LLM against the sessions the filters admitted, or against every session when no filter is set.
"prompt": "A String", # Required. What the detector should flag, written as a description of the anomaly rather than as instructions to the model. Evaluated against each session's transcript.
},
"filterCombination": "A String", # Optional. How the entries in `filters` combine, as a join over their 1-based positions, for example "1 AND 2" or "1 OR 2 OR 3". The operators are uppercase "AND" and "OR", and each level uses only one of them. To combine both, put one inside parentheses, as in "(1 AND 2) OR 3". Parentheses nest at most one level, and every filter must appear. Required when `filters` holds more than one entry, and validated whenever set.
"filters": [ # Optional. Deterministic predicates a session must satisfy. At most five.
{ # One deterministic predicate over a session: `(field, operation, value)`. A config may carry several; `CustomDetectorConfig.filter_combination` says how they join.
"dataType": "A String", # Optional. How to interpret the field and value. Required for TOOL_CALL_ARGS and TOOL_CALL_RESPONSE, whose underlying values are untyped; must be unset for every other field type, whose type the field itself determines.
"field": { # What the filter observes. # Required. What the filter observes.
"qualifiers": { # Additional context for a field type. One shared message covers every type; which members are required, optional, or rejected depends on `type`, and is validated on write. # Optional. Additional context for `type`.
"toolName": "A String", # Optional. The tool this field refers to. Required for TOOL_CALL_COUNT, TOOL_CALL_ARGS and TOOL_CALL_RESPONSE; enforced on write.
"toolParameterName": "A String", # Optional. The tool parameter whose argument this field refers to. Required for TOOL_CALL_ARGS; enforced on write.
},
"type": "A String", # Required. The observable property.
},
"operation": { # How the field is compared against the value. # Required. How `field` is compared against `value`.
"type": "A String", # Required. The comparison to apply.
},
"value": { # The literal compared against the field. # Required. The literal compared against `field`.
"literal": "A String", # Required. The literal, always carried as a string. `Field.Type` determines how it is interpreted, except for TOOL_CALL_ARGS and TOOL_CALL_RESPONSE, where `Filter.data_type` does.
},
},
],
},
"description": "A String", # Optional. A description of what the detector scans for.
"displayName": "A String", # Optional. The human-readable name of the detector. Example: "Large refund issued".
"name": "A String", # Identifier. The resource name of the detector. Format: `projects/{project}/locations/{location}/detectors/{detector}`
"revisionCreateTime": "A String", # Output only. When this revision was created.
"revisionId": "A String", # Output only. The revision id of the configuration in this response.
"selectedRevisionId": "A String", # Output only. The revision that runs when this detector is ACTIVE. Set whatever the state, because the selected revision is kept through a disable. May differ from `revision_id`: an edit does not change the selected revision, so `revision_id != selected_revision_id` means this detector is holding an edit that enabling it would not apply.
"state": "A String", # Output only. The state of the detector. Only an ACTIVE detector scans.
}
delete(name, x__xgafv=None)
Deletes a specific detector. Hard and irreversible: the detector is gone from every read path at once.
Args:
name: string, Required. The name of the detector to delete. Format: `projects/{project}/locations/{location}/detectors/{detector}` (required)
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
}
disable(name, body=None, x__xgafv=None)
Disables a specific detector, so that it stops scanning. Disabling an already-DISABLED detector succeeds and changes nothing. The detector's config and history survive; only DeleteDetector removes a detector.
Args:
name: string, Required. The name of the detector to disable. Format: `projects/{project}/locations/{location}/detectors/{detector}` (required)
body: object, The request body.
The object takes the form of:
{ # Request message for AgentAnomalyDetectionService.DisableDetector.
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Represents a security rule or LLM-as-a-judge entity that scans agent interactions for anomalies.
"customDetectorConfig": { # The detection logic of a customer-defined detector: deterministic Filters, an LLM-evaluated AnomalyAnalysis, or both. At least one must be set. # Optional. The detection logic for a customer-defined detector. Unset on Google-managed detectors, whose logic is not customer visible.
"anomalyAnalysis": { # A customer-authored description of the anomaly to detect, evaluated by an LLM. # Optional. The anomaly criterion evaluated by an LLM against the sessions the filters admitted, or against every session when no filter is set.
"prompt": "A String", # Required. What the detector should flag, written as a description of the anomaly rather than as instructions to the model. Evaluated against each session's transcript.
},
"filterCombination": "A String", # Optional. How the entries in `filters` combine, as a join over their 1-based positions, for example "1 AND 2" or "1 OR 2 OR 3". The operators are uppercase "AND" and "OR", and each level uses only one of them. To combine both, put one inside parentheses, as in "(1 AND 2) OR 3". Parentheses nest at most one level, and every filter must appear. Required when `filters` holds more than one entry, and validated whenever set.
"filters": [ # Optional. Deterministic predicates a session must satisfy. At most five.
{ # One deterministic predicate over a session: `(field, operation, value)`. A config may carry several; `CustomDetectorConfig.filter_combination` says how they join.
"dataType": "A String", # Optional. How to interpret the field and value. Required for TOOL_CALL_ARGS and TOOL_CALL_RESPONSE, whose underlying values are untyped; must be unset for every other field type, whose type the field itself determines.
"field": { # What the filter observes. # Required. What the filter observes.
"qualifiers": { # Additional context for a field type. One shared message covers every type; which members are required, optional, or rejected depends on `type`, and is validated on write. # Optional. Additional context for `type`.
"toolName": "A String", # Optional. The tool this field refers to. Required for TOOL_CALL_COUNT, TOOL_CALL_ARGS and TOOL_CALL_RESPONSE; enforced on write.
"toolParameterName": "A String", # Optional. The tool parameter whose argument this field refers to. Required for TOOL_CALL_ARGS; enforced on write.
},
"type": "A String", # Required. The observable property.
},
"operation": { # How the field is compared against the value. # Required. How `field` is compared against `value`.
"type": "A String", # Required. The comparison to apply.
},
"value": { # The literal compared against the field. # Required. The literal compared against `field`.
"literal": "A String", # Required. The literal, always carried as a string. `Field.Type` determines how it is interpreted, except for TOOL_CALL_ARGS and TOOL_CALL_RESPONSE, where `Filter.data_type` does.
},
},
],
},
"description": "A String", # Optional. A description of what the detector scans for.
"displayName": "A String", # Optional. The human-readable name of the detector. Example: "Large refund issued".
"name": "A String", # Identifier. The resource name of the detector. Format: `projects/{project}/locations/{location}/detectors/{detector}`
"revisionCreateTime": "A String", # Output only. When this revision was created.
"revisionId": "A String", # Output only. The revision id of the configuration in this response.
"selectedRevisionId": "A String", # Output only. The revision that runs when this detector is ACTIVE. Set whatever the state, because the selected revision is kept through a disable. May differ from `revision_id`: an edit does not change the selected revision, so `revision_id != selected_revision_id` means this detector is holding an edit that enabling it would not apply.
"state": "A String", # Output only. The state of the detector. Only an ACTIVE detector scans.
}
enable(name, body=None, x__xgafv=None)
Enables a specific detector, so that it starts scanning. Enabling an already-ACTIVE detector succeeds and changes nothing.
Args:
name: string, Required. The name of the detector to enable. Format: `projects/{project}/locations/{location}/detectors/{detector}` (required)
body: object, The request body.
The object takes the form of:
{ # Request message for AgentAnomalyDetectionService.EnableDetector.
"revisionId": "A String", # Optional. The revision to run. Unset enables the detector's latest revision, which is the common case: publish what I just wrote.
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Represents a security rule or LLM-as-a-judge entity that scans agent interactions for anomalies.
"customDetectorConfig": { # The detection logic of a customer-defined detector: deterministic Filters, an LLM-evaluated AnomalyAnalysis, or both. At least one must be set. # Optional. The detection logic for a customer-defined detector. Unset on Google-managed detectors, whose logic is not customer visible.
"anomalyAnalysis": { # A customer-authored description of the anomaly to detect, evaluated by an LLM. # Optional. The anomaly criterion evaluated by an LLM against the sessions the filters admitted, or against every session when no filter is set.
"prompt": "A String", # Required. What the detector should flag, written as a description of the anomaly rather than as instructions to the model. Evaluated against each session's transcript.
},
"filterCombination": "A String", # Optional. How the entries in `filters` combine, as a join over their 1-based positions, for example "1 AND 2" or "1 OR 2 OR 3". The operators are uppercase "AND" and "OR", and each level uses only one of them. To combine both, put one inside parentheses, as in "(1 AND 2) OR 3". Parentheses nest at most one level, and every filter must appear. Required when `filters` holds more than one entry, and validated whenever set.
"filters": [ # Optional. Deterministic predicates a session must satisfy. At most five.
{ # One deterministic predicate over a session: `(field, operation, value)`. A config may carry several; `CustomDetectorConfig.filter_combination` says how they join.
"dataType": "A String", # Optional. How to interpret the field and value. Required for TOOL_CALL_ARGS and TOOL_CALL_RESPONSE, whose underlying values are untyped; must be unset for every other field type, whose type the field itself determines.
"field": { # What the filter observes. # Required. What the filter observes.
"qualifiers": { # Additional context for a field type. One shared message covers every type; which members are required, optional, or rejected depends on `type`, and is validated on write. # Optional. Additional context for `type`.
"toolName": "A String", # Optional. The tool this field refers to. Required for TOOL_CALL_COUNT, TOOL_CALL_ARGS and TOOL_CALL_RESPONSE; enforced on write.
"toolParameterName": "A String", # Optional. The tool parameter whose argument this field refers to. Required for TOOL_CALL_ARGS; enforced on write.
},
"type": "A String", # Required. The observable property.
},
"operation": { # How the field is compared against the value. # Required. How `field` is compared against `value`.
"type": "A String", # Required. The comparison to apply.
},
"value": { # The literal compared against the field. # Required. The literal compared against `field`.
"literal": "A String", # Required. The literal, always carried as a string. `Field.Type` determines how it is interpreted, except for TOOL_CALL_ARGS and TOOL_CALL_RESPONSE, where `Filter.data_type` does.
},
},
],
},
"description": "A String", # Optional. A description of what the detector scans for.
"displayName": "A String", # Optional. The human-readable name of the detector. Example: "Large refund issued".
"name": "A String", # Identifier. The resource name of the detector. Format: `projects/{project}/locations/{location}/detectors/{detector}`
"revisionCreateTime": "A String", # Output only. When this revision was created.
"revisionId": "A String", # Output only. The revision id of the configuration in this response.
"selectedRevisionId": "A String", # Output only. The revision that runs when this detector is ACTIVE. Set whatever the state, because the selected revision is kept through a disable. May differ from `revision_id`: an edit does not change the selected revision, so `revision_id != selected_revision_id` means this detector is holding an edit that enabling it would not apply.
"state": "A String", # Output only. The state of the detector. Only an ACTIVE detector scans.
}
get(name, revisionId=None, x__xgafv=None)
Gets the details of a specific detector, including its current configuration.
Args:
name: string, Required. The resource name of the detector. Format: `projects/{project}/locations/{location}/detectors/{detector}` (required)
revisionId: string, Optional. Return the detector as configured at this revision. Unset returns the latest revision.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Represents a security rule or LLM-as-a-judge entity that scans agent interactions for anomalies.
"customDetectorConfig": { # The detection logic of a customer-defined detector: deterministic Filters, an LLM-evaluated AnomalyAnalysis, or both. At least one must be set. # Optional. The detection logic for a customer-defined detector. Unset on Google-managed detectors, whose logic is not customer visible.
"anomalyAnalysis": { # A customer-authored description of the anomaly to detect, evaluated by an LLM. # Optional. The anomaly criterion evaluated by an LLM against the sessions the filters admitted, or against every session when no filter is set.
"prompt": "A String", # Required. What the detector should flag, written as a description of the anomaly rather than as instructions to the model. Evaluated against each session's transcript.
},
"filterCombination": "A String", # Optional. How the entries in `filters` combine, as a join over their 1-based positions, for example "1 AND 2" or "1 OR 2 OR 3". The operators are uppercase "AND" and "OR", and each level uses only one of them. To combine both, put one inside parentheses, as in "(1 AND 2) OR 3". Parentheses nest at most one level, and every filter must appear. Required when `filters` holds more than one entry, and validated whenever set.
"filters": [ # Optional. Deterministic predicates a session must satisfy. At most five.
{ # One deterministic predicate over a session: `(field, operation, value)`. A config may carry several; `CustomDetectorConfig.filter_combination` says how they join.
"dataType": "A String", # Optional. How to interpret the field and value. Required for TOOL_CALL_ARGS and TOOL_CALL_RESPONSE, whose underlying values are untyped; must be unset for every other field type, whose type the field itself determines.
"field": { # What the filter observes. # Required. What the filter observes.
"qualifiers": { # Additional context for a field type. One shared message covers every type; which members are required, optional, or rejected depends on `type`, and is validated on write. # Optional. Additional context for `type`.
"toolName": "A String", # Optional. The tool this field refers to. Required for TOOL_CALL_COUNT, TOOL_CALL_ARGS and TOOL_CALL_RESPONSE; enforced on write.
"toolParameterName": "A String", # Optional. The tool parameter whose argument this field refers to. Required for TOOL_CALL_ARGS; enforced on write.
},
"type": "A String", # Required. The observable property.
},
"operation": { # How the field is compared against the value. # Required. How `field` is compared against `value`.
"type": "A String", # Required. The comparison to apply.
},
"value": { # The literal compared against the field. # Required. The literal compared against `field`.
"literal": "A String", # Required. The literal, always carried as a string. `Field.Type` determines how it is interpreted, except for TOOL_CALL_ARGS and TOOL_CALL_RESPONSE, where `Filter.data_type` does.
},
},
],
},
"description": "A String", # Optional. A description of what the detector scans for.
"displayName": "A String", # Optional. The human-readable name of the detector. Example: "Large refund issued".
"name": "A String", # Identifier. The resource name of the detector. Format: `projects/{project}/locations/{location}/detectors/{detector}`
"revisionCreateTime": "A String", # Output only. When this revision was created.
"revisionId": "A String", # Output only. The revision id of the configuration in this response.
"selectedRevisionId": "A String", # Output only. The revision that runs when this detector is ACTIVE. Set whatever the state, because the selected revision is kept through a disable. May differ from `revision_id`: an edit does not change the selected revision, so `revision_id != selected_revision_id` means this detector is holding an edit that enabling it would not apply.
"state": "A String", # Output only. The state of the detector. Only an ACTIVE detector scans.
}
list(parent, pageSize=None, pageToken=None, x__xgafv=None)
Lists the detectors in a Location.
Args:
parent: string, Required. The resource name of the Location to list the detectors from. Format: `projects/{project}/locations/{location}` (required)
pageSize: integer, Optional. The maximum number of detectors to return. The maximum value is 100; values above 100 will be coerced to 100. If unspecified, at most 10 detectors will be returned.
pageToken: string, Optional. A page token, received from a previous `ListDetectors` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListDetectors` must match the call that provided the page token.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response message for AgentAnomalyDetectionService.ListDetectors.
"detectors": [ # The list of detectors.
{ # Represents a security rule or LLM-as-a-judge entity that scans agent interactions for anomalies.
"customDetectorConfig": { # The detection logic of a customer-defined detector: deterministic Filters, an LLM-evaluated AnomalyAnalysis, or both. At least one must be set. # Optional. The detection logic for a customer-defined detector. Unset on Google-managed detectors, whose logic is not customer visible.
"anomalyAnalysis": { # A customer-authored description of the anomaly to detect, evaluated by an LLM. # Optional. The anomaly criterion evaluated by an LLM against the sessions the filters admitted, or against every session when no filter is set.
"prompt": "A String", # Required. What the detector should flag, written as a description of the anomaly rather than as instructions to the model. Evaluated against each session's transcript.
},
"filterCombination": "A String", # Optional. How the entries in `filters` combine, as a join over their 1-based positions, for example "1 AND 2" or "1 OR 2 OR 3". The operators are uppercase "AND" and "OR", and each level uses only one of them. To combine both, put one inside parentheses, as in "(1 AND 2) OR 3". Parentheses nest at most one level, and every filter must appear. Required when `filters` holds more than one entry, and validated whenever set.
"filters": [ # Optional. Deterministic predicates a session must satisfy. At most five.
{ # One deterministic predicate over a session: `(field, operation, value)`. A config may carry several; `CustomDetectorConfig.filter_combination` says how they join.
"dataType": "A String", # Optional. How to interpret the field and value. Required for TOOL_CALL_ARGS and TOOL_CALL_RESPONSE, whose underlying values are untyped; must be unset for every other field type, whose type the field itself determines.
"field": { # What the filter observes. # Required. What the filter observes.
"qualifiers": { # Additional context for a field type. One shared message covers every type; which members are required, optional, or rejected depends on `type`, and is validated on write. # Optional. Additional context for `type`.
"toolName": "A String", # Optional. The tool this field refers to. Required for TOOL_CALL_COUNT, TOOL_CALL_ARGS and TOOL_CALL_RESPONSE; enforced on write.
"toolParameterName": "A String", # Optional. The tool parameter whose argument this field refers to. Required for TOOL_CALL_ARGS; enforced on write.
},
"type": "A String", # Required. The observable property.
},
"operation": { # How the field is compared against the value. # Required. How `field` is compared against `value`.
"type": "A String", # Required. The comparison to apply.
},
"value": { # The literal compared against the field. # Required. The literal compared against `field`.
"literal": "A String", # Required. The literal, always carried as a string. `Field.Type` determines how it is interpreted, except for TOOL_CALL_ARGS and TOOL_CALL_RESPONSE, where `Filter.data_type` does.
},
},
],
},
"description": "A String", # Optional. A description of what the detector scans for.
"displayName": "A String", # Optional. The human-readable name of the detector. Example: "Large refund issued".
"name": "A String", # Identifier. The resource name of the detector. Format: `projects/{project}/locations/{location}/detectors/{detector}`
"revisionCreateTime": "A String", # Output only. When this revision was created.
"revisionId": "A String", # Output only. The revision id of the configuration in this response.
"selectedRevisionId": "A String", # Output only. The revision that runs when this detector is ACTIVE. Set whatever the state, because the selected revision is kept through a disable. May differ from `revision_id`: an edit does not change the selected revision, so `revision_id != selected_revision_id` means this detector is holding an edit that enabling it would not apply.
"state": "A String", # Output only. The state of the detector. Only an ACTIVE detector scans.
},
],
"nextPageToken": "A String", # A token to retrieve the next page of results.
}
listRevisions(name, pageSize=None, pageToken=None, x__xgafv=None)
Lists the revisions of a detector, newest first. Each entry is the detector as configured at one revision, with `revision_id` and `revision_create_time` set. `state` and `selected_revision_id` are unset: neither is a property of a revision, and GetDetector returns both.
Args:
name: string, Required. The detector whose revisions to list. Format: `projects/{project}/locations/{location}/detectors/{detector}` (required)
pageSize: integer, Optional. The maximum number of revisions to return. The maximum value is 100; values above 100 will be coerced to 100. If unspecified, at most 10 revisions will be returned.
pageToken: string, Optional. A page token, received from a previous `ListDetectorRevisions` call. Provide this to retrieve the subsequent page. When paginating, `name` must match the call that provided the page token.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response message for AgentAnomalyDetectionService.ListDetectorRevisions.
"detectors": [ # The detector as configured at each revision, newest first.
{ # Represents a security rule or LLM-as-a-judge entity that scans agent interactions for anomalies.
"customDetectorConfig": { # The detection logic of a customer-defined detector: deterministic Filters, an LLM-evaluated AnomalyAnalysis, or both. At least one must be set. # Optional. The detection logic for a customer-defined detector. Unset on Google-managed detectors, whose logic is not customer visible.
"anomalyAnalysis": { # A customer-authored description of the anomaly to detect, evaluated by an LLM. # Optional. The anomaly criterion evaluated by an LLM against the sessions the filters admitted, or against every session when no filter is set.
"prompt": "A String", # Required. What the detector should flag, written as a description of the anomaly rather than as instructions to the model. Evaluated against each session's transcript.
},
"filterCombination": "A String", # Optional. How the entries in `filters` combine, as a join over their 1-based positions, for example "1 AND 2" or "1 OR 2 OR 3". The operators are uppercase "AND" and "OR", and each level uses only one of them. To combine both, put one inside parentheses, as in "(1 AND 2) OR 3". Parentheses nest at most one level, and every filter must appear. Required when `filters` holds more than one entry, and validated whenever set.
"filters": [ # Optional. Deterministic predicates a session must satisfy. At most five.
{ # One deterministic predicate over a session: `(field, operation, value)`. A config may carry several; `CustomDetectorConfig.filter_combination` says how they join.
"dataType": "A String", # Optional. How to interpret the field and value. Required for TOOL_CALL_ARGS and TOOL_CALL_RESPONSE, whose underlying values are untyped; must be unset for every other field type, whose type the field itself determines.
"field": { # What the filter observes. # Required. What the filter observes.
"qualifiers": { # Additional context for a field type. One shared message covers every type; which members are required, optional, or rejected depends on `type`, and is validated on write. # Optional. Additional context for `type`.
"toolName": "A String", # Optional. The tool this field refers to. Required for TOOL_CALL_COUNT, TOOL_CALL_ARGS and TOOL_CALL_RESPONSE; enforced on write.
"toolParameterName": "A String", # Optional. The tool parameter whose argument this field refers to. Required for TOOL_CALL_ARGS; enforced on write.
},
"type": "A String", # Required. The observable property.
},
"operation": { # How the field is compared against the value. # Required. How `field` is compared against `value`.
"type": "A String", # Required. The comparison to apply.
},
"value": { # The literal compared against the field. # Required. The literal compared against `field`.
"literal": "A String", # Required. The literal, always carried as a string. `Field.Type` determines how it is interpreted, except for TOOL_CALL_ARGS and TOOL_CALL_RESPONSE, where `Filter.data_type` does.
},
},
],
},
"description": "A String", # Optional. A description of what the detector scans for.
"displayName": "A String", # Optional. The human-readable name of the detector. Example: "Large refund issued".
"name": "A String", # Identifier. The resource name of the detector. Format: `projects/{project}/locations/{location}/detectors/{detector}`
"revisionCreateTime": "A String", # Output only. When this revision was created.
"revisionId": "A String", # Output only. The revision id of the configuration in this response.
"selectedRevisionId": "A String", # Output only. The revision that runs when this detector is ACTIVE. Set whatever the state, because the selected revision is kept through a disable. May differ from `revision_id`: an edit does not change the selected revision, so `revision_id != selected_revision_id` means this detector is holding an edit that enabling it would not apply.
"state": "A String", # Output only. The state of the detector. Only an ACTIVE detector scans.
},
],
"nextPageToken": "A String", # A token to retrieve the next page of results.
}
listRevisions_next(previous_request, previous_response)
Retrieves the next page of results. Args: previous_request: The request for the previous page. (required) previous_response: The response from the request for the previous page. (required) Returns: A request object that you can call 'execute()' on to request the next page. Returns None if there are no more items in the collection.
list_next(previous_request, previous_response)
Retrieves the next page of results. Args: previous_request: The request for the previous page. (required) previous_response: The response from the request for the previous page. (required) Returns: A request object that you can call 'execute()' on to request the next page. Returns None if there are no more items in the collection.
patch(name, body=None, updateMask=None, x__xgafv=None)
Updates an existing detector. A mask covering `custom_detector_config` replaces the whole config; `state` cannot be changed here, use EnableDetector or DisableDetector.
Args:
name: string, Identifier. The resource name of the detector. Format: `projects/{project}/locations/{location}/detectors/{detector}` (required)
body: object, The request body.
The object takes the form of:
{ # Represents a security rule or LLM-as-a-judge entity that scans agent interactions for anomalies.
"customDetectorConfig": { # The detection logic of a customer-defined detector: deterministic Filters, an LLM-evaluated AnomalyAnalysis, or both. At least one must be set. # Optional. The detection logic for a customer-defined detector. Unset on Google-managed detectors, whose logic is not customer visible.
"anomalyAnalysis": { # A customer-authored description of the anomaly to detect, evaluated by an LLM. # Optional. The anomaly criterion evaluated by an LLM against the sessions the filters admitted, or against every session when no filter is set.
"prompt": "A String", # Required. What the detector should flag, written as a description of the anomaly rather than as instructions to the model. Evaluated against each session's transcript.
},
"filterCombination": "A String", # Optional. How the entries in `filters` combine, as a join over their 1-based positions, for example "1 AND 2" or "1 OR 2 OR 3". The operators are uppercase "AND" and "OR", and each level uses only one of them. To combine both, put one inside parentheses, as in "(1 AND 2) OR 3". Parentheses nest at most one level, and every filter must appear. Required when `filters` holds more than one entry, and validated whenever set.
"filters": [ # Optional. Deterministic predicates a session must satisfy. At most five.
{ # One deterministic predicate over a session: `(field, operation, value)`. A config may carry several; `CustomDetectorConfig.filter_combination` says how they join.
"dataType": "A String", # Optional. How to interpret the field and value. Required for TOOL_CALL_ARGS and TOOL_CALL_RESPONSE, whose underlying values are untyped; must be unset for every other field type, whose type the field itself determines.
"field": { # What the filter observes. # Required. What the filter observes.
"qualifiers": { # Additional context for a field type. One shared message covers every type; which members are required, optional, or rejected depends on `type`, and is validated on write. # Optional. Additional context for `type`.
"toolName": "A String", # Optional. The tool this field refers to. Required for TOOL_CALL_COUNT, TOOL_CALL_ARGS and TOOL_CALL_RESPONSE; enforced on write.
"toolParameterName": "A String", # Optional. The tool parameter whose argument this field refers to. Required for TOOL_CALL_ARGS; enforced on write.
},
"type": "A String", # Required. The observable property.
},
"operation": { # How the field is compared against the value. # Required. How `field` is compared against `value`.
"type": "A String", # Required. The comparison to apply.
},
"value": { # The literal compared against the field. # Required. The literal compared against `field`.
"literal": "A String", # Required. The literal, always carried as a string. `Field.Type` determines how it is interpreted, except for TOOL_CALL_ARGS and TOOL_CALL_RESPONSE, where `Filter.data_type` does.
},
},
],
},
"description": "A String", # Optional. A description of what the detector scans for.
"displayName": "A String", # Optional. The human-readable name of the detector. Example: "Large refund issued".
"name": "A String", # Identifier. The resource name of the detector. Format: `projects/{project}/locations/{location}/detectors/{detector}`
"revisionCreateTime": "A String", # Output only. When this revision was created.
"revisionId": "A String", # Output only. The revision id of the configuration in this response.
"selectedRevisionId": "A String", # Output only. The revision that runs when this detector is ACTIVE. Set whatever the state, because the selected revision is kept through a disable. May differ from `revision_id`: an edit does not change the selected revision, so `revision_id != selected_revision_id` means this detector is holding an edit that enabling it would not apply.
"state": "A String", # Output only. The state of the detector. Only an ACTIVE detector scans.
}
updateMask: string, Optional. The list of fields to update. Supported paths are `display_name`, `description` and `custom_detector_config`. `name` and `state` are ignored if named; any other path is rejected with INVALID_ARGUMENT.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Represents a security rule or LLM-as-a-judge entity that scans agent interactions for anomalies.
"customDetectorConfig": { # The detection logic of a customer-defined detector: deterministic Filters, an LLM-evaluated AnomalyAnalysis, or both. At least one must be set. # Optional. The detection logic for a customer-defined detector. Unset on Google-managed detectors, whose logic is not customer visible.
"anomalyAnalysis": { # A customer-authored description of the anomaly to detect, evaluated by an LLM. # Optional. The anomaly criterion evaluated by an LLM against the sessions the filters admitted, or against every session when no filter is set.
"prompt": "A String", # Required. What the detector should flag, written as a description of the anomaly rather than as instructions to the model. Evaluated against each session's transcript.
},
"filterCombination": "A String", # Optional. How the entries in `filters` combine, as a join over their 1-based positions, for example "1 AND 2" or "1 OR 2 OR 3". The operators are uppercase "AND" and "OR", and each level uses only one of them. To combine both, put one inside parentheses, as in "(1 AND 2) OR 3". Parentheses nest at most one level, and every filter must appear. Required when `filters` holds more than one entry, and validated whenever set.
"filters": [ # Optional. Deterministic predicates a session must satisfy. At most five.
{ # One deterministic predicate over a session: `(field, operation, value)`. A config may carry several; `CustomDetectorConfig.filter_combination` says how they join.
"dataType": "A String", # Optional. How to interpret the field and value. Required for TOOL_CALL_ARGS and TOOL_CALL_RESPONSE, whose underlying values are untyped; must be unset for every other field type, whose type the field itself determines.
"field": { # What the filter observes. # Required. What the filter observes.
"qualifiers": { # Additional context for a field type. One shared message covers every type; which members are required, optional, or rejected depends on `type`, and is validated on write. # Optional. Additional context for `type`.
"toolName": "A String", # Optional. The tool this field refers to. Required for TOOL_CALL_COUNT, TOOL_CALL_ARGS and TOOL_CALL_RESPONSE; enforced on write.
"toolParameterName": "A String", # Optional. The tool parameter whose argument this field refers to. Required for TOOL_CALL_ARGS; enforced on write.
},
"type": "A String", # Required. The observable property.
},
"operation": { # How the field is compared against the value. # Required. How `field` is compared against `value`.
"type": "A String", # Required. The comparison to apply.
},
"value": { # The literal compared against the field. # Required. The literal compared against `field`.
"literal": "A String", # Required. The literal, always carried as a string. `Field.Type` determines how it is interpreted, except for TOOL_CALL_ARGS and TOOL_CALL_RESPONSE, where `Filter.data_type` does.
},
},
],
},
"description": "A String", # Optional. A description of what the detector scans for.
"displayName": "A String", # Optional. The human-readable name of the detector. Example: "Large refund issued".
"name": "A String", # Identifier. The resource name of the detector. Format: `projects/{project}/locations/{location}/detectors/{detector}`
"revisionCreateTime": "A String", # Output only. When this revision was created.
"revisionId": "A String", # Output only. The revision id of the configuration in this response.
"selectedRevisionId": "A String", # Output only. The revision that runs when this detector is ACTIVE. Set whatever the state, because the selected revision is kept through a disable. May differ from `revision_id`: an edit does not change the selected revision, so `revision_id != selected_revision_id` means this detector is holding an edit that enabling it would not apply.
"state": "A String", # Output only. The state of the detector. Only an ACTIVE detector scans.
}