diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ce0ea5b8443..d582c8e1385 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -2066,6 +2066,256 @@ components: $ref: "#/components/schemas/JSONAPIErrorResponse" description: The server cannot process the request because it contains invalid data. schemas: + AIGuardAction: + description: The action recommendation from the AI Guard evaluation. + enum: + - ALLOW + - DENY + - ABORT + example: ALLOW + type: string + x-enum-varnames: + - ALLOW + - DENY + - ABORT + AIGuardContentPart: + description: A single part of a multipart message content. + properties: + image_url: + $ref: "#/components/schemas/AIGuardImageURL" + text: + description: The text content of this part, required when type is text. + example: "How do I delete all files?" + type: string + type: + description: The type of content part, either text or image_url. + example: text + type: string + required: + - type + type: object + AIGuardContentPartList: + description: A list of content parts forming a multipart message. + items: + $ref: "#/components/schemas/AIGuardContentPart" + type: array + AIGuardEvaluateRequest: + description: The evaluation request payload containing conversation messages and optional metadata. + example: + messages: + - content: How do I delete all files on the system? + role: user + meta: + env: production + service: my-llm-service + properties: + messages: + description: The list of conversation messages to evaluate. Must contain at least one message. + example: + - content: How do I delete all files on the system? + role: user + items: + $ref: "#/components/schemas/AIGuardMessage" + type: array + meta: + $ref: "#/components/schemas/AIGuardMeta" + required: + - messages + type: object + AIGuardEvaluateResponse: + description: The result of the AI Guard evaluation. + properties: + action: + $ref: "#/components/schemas/AIGuardAction" + global_prob: + description: The overall threat probability score across all evaluated tags. + example: 0.02 + format: double + type: number + is_blocking_enabled: + description: Whether blocking mode is enabled for this organization. + example: false + type: boolean + reason: + description: A human-readable explanation of the action recommendation. + example: No threats detected. + type: string + sds_findings: + description: Sensitive data findings detected in the evaluated conversation. + items: + $ref: "#/components/schemas/AIGuardSdsFinding" + type: array + tag_probs: + additionalProperties: + format: double + type: number + description: Probability scores for each evaluated threat tag. + example: + indirect-prompt-injection: 0.01 + jailbreak: 0.02 + type: object + tags: + description: Security threat tags detected in the evaluated conversation. + example: [] + items: + type: string + type: array + required: + - action + - reason + - tags + - tag_probs + - is_blocking_enabled + type: object + AIGuardImageURL: + description: An image URL reference for multimodal content. + properties: + url: + description: The URL pointing to the image. + example: "https://example.com/image.png" + type: string + required: + - url + type: object + AIGuardMessage: + description: A single message in the conversation to evaluate. + properties: + content: + $ref: "#/components/schemas/AIGuardMessageContent" + role: + $ref: "#/components/schemas/AIGuardMessageRole" + tool_call_id: + description: The ID of the tool call this message is responding to, required for tool messages. + example: call_abc123 + type: string + tool_calls: + description: Tool calls issued by the assistant in this message. + items: + $ref: "#/components/schemas/AIGuardToolCall" + type: array + required: + - role + type: object + AIGuardMessageContent: + description: The message content, either a plain string or an array of content parts. + oneOf: + - example: "How do I delete all files on the system?" + type: string + - $ref: "#/components/schemas/AIGuardContentPartList" + AIGuardMessageRole: + description: The role of the message author in the conversation. + enum: + - user + - assistant + - system + - tool + - developer + example: user + type: string + x-enum-varnames: + - USER + - ASSISTANT + - SYSTEM + - TOOL + - DEVELOPER + AIGuardMeta: + description: Optional metadata providing context about the originating service and request. + properties: + coding_agent: + description: Identifier of the coding agent sending the request, if applicable. + example: claude-code + type: string + confidence_threshold: + description: Override for the default threat detection confidence threshold, between 0.0 and 1.0. + example: 0.7 + format: double + type: number + env: + description: The deployment environment of the originating service. + example: production + type: string + is_sds_enabled_override: + description: Override whether sensitive data scanning is applied to this request. + example: false + type: boolean + service: + description: The name of the service sending the evaluation request. + example: my-llm-service + type: string + type: object + AIGuardSdsFinding: + description: A sensitive data finding detected by the SDS scanner. + properties: + category: + description: The category of sensitive data detected. + example: payment_card_number + type: string + location: + $ref: "#/components/schemas/AIGuardSdsFindingLocation" + rule_display_name: + description: The human-readable name of the SDS rule that triggered. + example: Credit Card Number + type: string + rule_tag: + description: The tag identifier of the SDS rule that triggered. + example: credit_card + type: string + required: + - rule_display_name + - rule_tag + - category + - location + type: object + AIGuardSdsFindingLocation: + description: The location of a sensitive data match within the evaluated request. + properties: + end_index_exclusive: + description: The end character index (exclusive) of the sensitive data match. + example: 42 + format: int64 + type: integer + path: + description: The JSON path to the field containing the sensitive data. + example: "messages[0].content" + type: string + start_index: + description: The start character index of the sensitive data match. + example: 0 + format: int64 + type: integer + required: + - path + - start_index + - end_index_exclusive + type: object + AIGuardToolCall: + description: A tool call issued by the assistant. + properties: + function: + $ref: "#/components/schemas/AIGuardToolCallFunction" + id: + description: The unique identifier of the tool call. + example: call_abc123 + type: string + required: + - id + - function + type: object + AIGuardToolCallFunction: + description: The function definition within a tool call. + properties: + arguments: + description: The JSON-encoded arguments passed to the function. + example: '{"location": "San Francisco"}' + type: string + name: + description: The name of the function being called. + example: get_weather + type: string + required: + - name + - arguments + type: object APIErrorResponse: description: API error response. properties: @@ -108469,6 +108719,88 @@ paths: operator: OR permissions: - security_monitoring_findings_read + /api/v2/ai-guard/evaluate: + post: + description: |- + Analyzes a conversation for security threats such as prompt injection, jailbreak + attempts, and other AI-specific attacks. Returns an action recommendation (ALLOW, + DENY, or ABORT) along with the detected threat tags. + operationId: EvaluateAIGuardRequest + requestBody: + content: + application/json: + examples: + default: + value: + messages: + - content: How do I delete all files on the system? + role: user + meta: + env: production + service: my-llm-service + schema: + $ref: "#/components/schemas/AIGuardEvaluateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + action: ALLOW + global_prob: 0.02 + is_blocking_enabled: false + reason: No threats detected. + sds_findings: [] + tag_probs: + authority-override: 0.01 + data-exfiltration: 0.01 + denial-of-service-tool-call: 0.01 + destructive-tool-call: 0.01 + indirect-prompt-injection: 0.01 + instruction-override: 0.01 + jailbreak: 0.02 + obfuscation: 0.01 + role-play: 0.01 + security-exploit: 0.01 + system-prompt-extraction: 0.01 + tags: [] + schema: + $ref: "#/components/schemas/AIGuardEvaluateResponse" + description: Evaluation result with action recommendation + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: + - ai_guard_evaluate + summary: Evaluate an AI Guard request + tags: + - AI Guard + x-codegen-request-body-name: body + x-permission: + operator: AND + permissions: + - ai_guard_evaluate /api/v2/annotation: get: description: Returns a flat list of annotations matching the given page, time window, and optional widget filter. @@ -186414,6 +186746,12 @@ servers: default: api description: The subdomain where the API is deployed. tags: + - description: |- + Analyze AI conversations for security threats including prompt injection, + jailbreak attempts, and other AI-specific attacks. + externalDocs: + url: https://docs.datadoghq.com/security/ai_security/ + name: AI Guard - description: |- Configure your API endpoints through the Datadog API. name: API Management diff --git a/examples/v2/ai-guard/EvaluateAIGuardRequest.java b/examples/v2/ai-guard/EvaluateAIGuardRequest.java new file mode 100644 index 00000000000..43cb12178b5 --- /dev/null +++ b/examples/v2/ai-guard/EvaluateAIGuardRequest.java @@ -0,0 +1,40 @@ +// Evaluate an AI Guard request returns "Evaluation result with action recommendation" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AiGuardApi; +import com.datadog.api.client.v2.model.AIGuardEvaluateRequest; +import com.datadog.api.client.v2.model.AIGuardEvaluateResponse; +import com.datadog.api.client.v2.model.AIGuardMessage; +import com.datadog.api.client.v2.model.AIGuardMessageContent; +import com.datadog.api.client.v2.model.AIGuardMessageRole; +import com.datadog.api.client.v2.model.AIGuardMeta; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + AiGuardApi apiInstance = new AiGuardApi(defaultClient); + + AIGuardEvaluateRequest body = + new AIGuardEvaluateRequest() + .messages( + Collections.singletonList( + new AIGuardMessage() + .content( + new AIGuardMessageContent("How do I delete all files on the system?")) + .role(AIGuardMessageRole.USER))) + .meta(new AIGuardMeta().env("production").service("my-llm-service")); + + try { + AIGuardEvaluateResponse result = apiInstance.evaluateAIGuardRequest(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AiGuardApi#evaluateAIGuardRequest"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/AiGuardApi.java b/src/main/java/com/datadog/api/client/v2/api/AiGuardApi.java new file mode 100644 index 00000000000..085d92c3029 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/AiGuardApi.java @@ -0,0 +1,182 @@ +package com.datadog.api.client.v2.api; + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.AIGuardEvaluateRequest; +import com.datadog.api.client.v2.model.AIGuardEvaluateResponse; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AiGuardApi { + private ApiClient apiClient; + + public AiGuardApi() { + this(ApiClient.getDefaultApiClient()); + } + + public AiGuardApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client. + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client. + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Evaluate an AI Guard request. + * + *

See {@link #evaluateAIGuardRequestWithHttpInfo}. + * + * @param body (required) + * @return AIGuardEvaluateResponse + * @throws ApiException if fails to make API call + */ + public AIGuardEvaluateResponse evaluateAIGuardRequest(AIGuardEvaluateRequest body) + throws ApiException { + return evaluateAIGuardRequestWithHttpInfo(body).getData(); + } + + /** + * Evaluate an AI Guard request. + * + *

See {@link #evaluateAIGuardRequestWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<AIGuardEvaluateResponse> + */ + public CompletableFuture evaluateAIGuardRequestAsync( + AIGuardEvaluateRequest body) { + return evaluateAIGuardRequestWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Analyzes a conversation for security threats such as prompt injection, jailbreak attempts, and + * other AI-specific attacks. Returns an action recommendation (ALLOW, DENY, or ABORT) along with + * the detected threat tags. + * + * @param body (required) + * @return ApiResponse<AIGuardEvaluateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Evaluation result with action recommendation -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse evaluateAIGuardRequestWithHttpInfo( + AIGuardEvaluateRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling evaluateAIGuardRequest"); + } + // create path and map variables + String localVarPath = "/api/v2/ai-guard/evaluate"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AiGuardApi.evaluateAIGuardRequest", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Evaluate an AI Guard request. + * + *

See {@link #evaluateAIGuardRequestWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<AIGuardEvaluateResponse>> + */ + public CompletableFuture> + evaluateAIGuardRequestWithHttpInfoAsync(AIGuardEvaluateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling evaluateAIGuardRequest")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/ai-guard/evaluate"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AiGuardApi.evaluateAIGuardRequest", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AIGuardAction.java b/src/main/java/com/datadog/api/client/v2/model/AIGuardAction.java new file mode 100644 index 00000000000..1c74cc4862e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AIGuardAction.java @@ -0,0 +1,56 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The action recommendation from the AI Guard evaluation. */ +@JsonSerialize(using = AIGuardAction.AIGuardActionSerializer.class) +public class AIGuardAction extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("ALLOW", "DENY", "ABORT")); + + public static final AIGuardAction ALLOW = new AIGuardAction("ALLOW"); + public static final AIGuardAction DENY = new AIGuardAction("DENY"); + public static final AIGuardAction ABORT = new AIGuardAction("ABORT"); + + AIGuardAction(String value) { + super(value, allowedValues); + } + + public static class AIGuardActionSerializer extends StdSerializer { + public AIGuardActionSerializer(Class t) { + super(t); + } + + public AIGuardActionSerializer() { + this(null); + } + + @Override + public void serialize(AIGuardAction value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AIGuardAction fromValue(String value) { + return new AIGuardAction(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AIGuardContentPart.java b/src/main/java/com/datadog/api/client/v2/model/AIGuardContentPart.java new file mode 100644 index 00000000000..1c46408e448 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AIGuardContentPart.java @@ -0,0 +1,200 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A single part of a multipart message content. */ +@JsonPropertyOrder({ + AIGuardContentPart.JSON_PROPERTY_IMAGE_URL, + AIGuardContentPart.JSON_PROPERTY_TEXT, + AIGuardContentPart.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AIGuardContentPart { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_IMAGE_URL = "image_url"; + private AIGuardImageURL imageUrl; + + public static final String JSON_PROPERTY_TEXT = "text"; + private String text; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public AIGuardContentPart() {} + + @JsonCreator + public AIGuardContentPart( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.type = type; + } + + public AIGuardContentPart imageUrl(AIGuardImageURL imageUrl) { + this.imageUrl = imageUrl; + this.unparsed |= imageUrl.unparsed; + return this; + } + + /** + * An image URL reference for multimodal content. + * + * @return imageUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IMAGE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AIGuardImageURL getImageUrl() { + return imageUrl; + } + + public void setImageUrl(AIGuardImageURL imageUrl) { + this.imageUrl = imageUrl; + } + + public AIGuardContentPart text(String text) { + this.text = text; + return this; + } + + /** + * The text content of this part, required when type is text. + * + * @return text + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public AIGuardContentPart type(String type) { + this.type = type; + return this; + } + + /** + * The type of content part, either text or image_url. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AIGuardContentPart + */ + @JsonAnySetter + public AIGuardContentPart putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AIGuardContentPart object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AIGuardContentPart aiGuardContentPart = (AIGuardContentPart) o; + return Objects.equals(this.imageUrl, aiGuardContentPart.imageUrl) + && Objects.equals(this.text, aiGuardContentPart.text) + && Objects.equals(this.type, aiGuardContentPart.type) + && Objects.equals(this.additionalProperties, aiGuardContentPart.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(imageUrl, text, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AIGuardContentPart {\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AIGuardEvaluateRequest.java b/src/main/java/com/datadog/api/client/v2/model/AIGuardEvaluateRequest.java new file mode 100644 index 00000000000..991e7d36b7c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AIGuardEvaluateRequest.java @@ -0,0 +1,185 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The evaluation request payload containing conversation messages and optional metadata. */ +@JsonPropertyOrder({ + AIGuardEvaluateRequest.JSON_PROPERTY_MESSAGES, + AIGuardEvaluateRequest.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AIGuardEvaluateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_MESSAGES = "messages"; + private List messages = new ArrayList<>(); + + public static final String JSON_PROPERTY_META = "meta"; + private AIGuardMeta meta; + + public AIGuardEvaluateRequest() {} + + @JsonCreator + public AIGuardEvaluateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_MESSAGES) + List messages) { + this.messages = messages; + } + + public AIGuardEvaluateRequest messages(List messages) { + this.messages = messages; + for (AIGuardMessage item : messages) { + this.unparsed |= item.unparsed; + } + return this; + } + + public AIGuardEvaluateRequest addMessagesItem(AIGuardMessage messagesItem) { + this.messages.add(messagesItem); + this.unparsed |= messagesItem.unparsed; + return this; + } + + /** + * The list of conversation messages to evaluate. Must contain at least one message. + * + * @return messages + */ + @JsonProperty(JSON_PROPERTY_MESSAGES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getMessages() { + return messages; + } + + public void setMessages(List messages) { + this.messages = messages; + } + + public AIGuardEvaluateRequest meta(AIGuardMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Optional metadata providing context about the originating service and request. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AIGuardMeta getMeta() { + return meta; + } + + public void setMeta(AIGuardMeta meta) { + this.meta = meta; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AIGuardEvaluateRequest + */ + @JsonAnySetter + public AIGuardEvaluateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AIGuardEvaluateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AIGuardEvaluateRequest aiGuardEvaluateRequest = (AIGuardEvaluateRequest) o; + return Objects.equals(this.messages, aiGuardEvaluateRequest.messages) + && Objects.equals(this.meta, aiGuardEvaluateRequest.meta) + && Objects.equals(this.additionalProperties, aiGuardEvaluateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(messages, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AIGuardEvaluateRequest {\n"); + sb.append(" messages: ").append(toIndentedString(messages)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AIGuardEvaluateResponse.java b/src/main/java/com/datadog/api/client/v2/model/AIGuardEvaluateResponse.java new file mode 100644 index 00000000000..cc6e91f8cb1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AIGuardEvaluateResponse.java @@ -0,0 +1,349 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The result of the AI Guard evaluation. */ +@JsonPropertyOrder({ + AIGuardEvaluateResponse.JSON_PROPERTY_ACTION, + AIGuardEvaluateResponse.JSON_PROPERTY_GLOBAL_PROB, + AIGuardEvaluateResponse.JSON_PROPERTY_IS_BLOCKING_ENABLED, + AIGuardEvaluateResponse.JSON_PROPERTY_REASON, + AIGuardEvaluateResponse.JSON_PROPERTY_SDS_FINDINGS, + AIGuardEvaluateResponse.JSON_PROPERTY_TAG_PROBS, + AIGuardEvaluateResponse.JSON_PROPERTY_TAGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AIGuardEvaluateResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTION = "action"; + private AIGuardAction action; + + public static final String JSON_PROPERTY_GLOBAL_PROB = "global_prob"; + private Double globalProb; + + public static final String JSON_PROPERTY_IS_BLOCKING_ENABLED = "is_blocking_enabled"; + private Boolean isBlockingEnabled; + + public static final String JSON_PROPERTY_REASON = "reason"; + private String reason; + + public static final String JSON_PROPERTY_SDS_FINDINGS = "sds_findings"; + private List sdsFindings = null; + + public static final String JSON_PROPERTY_TAG_PROBS = "tag_probs"; + private Map tagProbs = new HashMap(); + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = new ArrayList<>(); + + public AIGuardEvaluateResponse() {} + + @JsonCreator + public AIGuardEvaluateResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ACTION) AIGuardAction action, + @JsonProperty(required = true, value = JSON_PROPERTY_IS_BLOCKING_ENABLED) + Boolean isBlockingEnabled, + @JsonProperty(required = true, value = JSON_PROPERTY_REASON) String reason, + @JsonProperty(required = true, value = JSON_PROPERTY_TAG_PROBS) Map tagProbs, + @JsonProperty(required = true, value = JSON_PROPERTY_TAGS) List tags) { + this.action = action; + this.unparsed |= !action.isValid(); + this.isBlockingEnabled = isBlockingEnabled; + this.reason = reason; + this.tagProbs = tagProbs; + this.tags = tags; + } + + public AIGuardEvaluateResponse action(AIGuardAction action) { + this.action = action; + this.unparsed |= !action.isValid(); + return this; + } + + /** + * The action recommendation from the AI Guard evaluation. + * + * @return action + */ + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AIGuardAction getAction() { + return action; + } + + public void setAction(AIGuardAction action) { + if (!action.isValid()) { + this.unparsed = true; + } + this.action = action; + } + + public AIGuardEvaluateResponse globalProb(Double globalProb) { + this.globalProb = globalProb; + return this; + } + + /** + * The overall threat probability score across all evaluated tags. + * + * @return globalProb + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GLOBAL_PROB) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getGlobalProb() { + return globalProb; + } + + public void setGlobalProb(Double globalProb) { + this.globalProb = globalProb; + } + + public AIGuardEvaluateResponse isBlockingEnabled(Boolean isBlockingEnabled) { + this.isBlockingEnabled = isBlockingEnabled; + return this; + } + + /** + * Whether blocking mode is enabled for this organization. + * + * @return isBlockingEnabled + */ + @JsonProperty(JSON_PROPERTY_IS_BLOCKING_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIsBlockingEnabled() { + return isBlockingEnabled; + } + + public void setIsBlockingEnabled(Boolean isBlockingEnabled) { + this.isBlockingEnabled = isBlockingEnabled; + } + + public AIGuardEvaluateResponse reason(String reason) { + this.reason = reason; + return this; + } + + /** + * A human-readable explanation of the action recommendation. + * + * @return reason + */ + @JsonProperty(JSON_PROPERTY_REASON) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getReason() { + return reason; + } + + public void setReason(String reason) { + this.reason = reason; + } + + public AIGuardEvaluateResponse sdsFindings(List sdsFindings) { + this.sdsFindings = sdsFindings; + for (AIGuardSdsFinding item : sdsFindings) { + this.unparsed |= item.unparsed; + } + return this; + } + + public AIGuardEvaluateResponse addSdsFindingsItem(AIGuardSdsFinding sdsFindingsItem) { + if (this.sdsFindings == null) { + this.sdsFindings = new ArrayList<>(); + } + this.sdsFindings.add(sdsFindingsItem); + this.unparsed |= sdsFindingsItem.unparsed; + return this; + } + + /** + * Sensitive data findings detected in the evaluated conversation. + * + * @return sdsFindings + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SDS_FINDINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSdsFindings() { + return sdsFindings; + } + + public void setSdsFindings(List sdsFindings) { + this.sdsFindings = sdsFindings; + } + + public AIGuardEvaluateResponse tagProbs(Map tagProbs) { + this.tagProbs = tagProbs; + return this; + } + + public AIGuardEvaluateResponse putTagProbsItem(String key, Double tagProbsItem) { + this.tagProbs.put(key, tagProbsItem); + return this; + } + + /** + * Probability scores for each evaluated threat tag. + * + * @return tagProbs + */ + @JsonProperty(JSON_PROPERTY_TAG_PROBS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Map getTagProbs() { + return tagProbs; + } + + public void setTagProbs(Map tagProbs) { + this.tagProbs = tagProbs; + } + + public AIGuardEvaluateResponse tags(List tags) { + this.tags = tags; + return this; + } + + public AIGuardEvaluateResponse addTagsItem(String tagsItem) { + this.tags.add(tagsItem); + return this; + } + + /** + * Security threat tags detected in the evaluated conversation. + * + * @return tags + */ + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AIGuardEvaluateResponse + */ + @JsonAnySetter + public AIGuardEvaluateResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AIGuardEvaluateResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AIGuardEvaluateResponse aiGuardEvaluateResponse = (AIGuardEvaluateResponse) o; + return Objects.equals(this.action, aiGuardEvaluateResponse.action) + && Objects.equals(this.globalProb, aiGuardEvaluateResponse.globalProb) + && Objects.equals(this.isBlockingEnabled, aiGuardEvaluateResponse.isBlockingEnabled) + && Objects.equals(this.reason, aiGuardEvaluateResponse.reason) + && Objects.equals(this.sdsFindings, aiGuardEvaluateResponse.sdsFindings) + && Objects.equals(this.tagProbs, aiGuardEvaluateResponse.tagProbs) + && Objects.equals(this.tags, aiGuardEvaluateResponse.tags) + && Objects.equals(this.additionalProperties, aiGuardEvaluateResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + action, + globalProb, + isBlockingEnabled, + reason, + sdsFindings, + tagProbs, + tags, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AIGuardEvaluateResponse {\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" globalProb: ").append(toIndentedString(globalProb)).append("\n"); + sb.append(" isBlockingEnabled: ").append(toIndentedString(isBlockingEnabled)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" sdsFindings: ").append(toIndentedString(sdsFindings)).append("\n"); + sb.append(" tagProbs: ").append(toIndentedString(tagProbs)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AIGuardImageURL.java b/src/main/java/com/datadog/api/client/v2/model/AIGuardImageURL.java new file mode 100644 index 00000000000..91355e38dde --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AIGuardImageURL.java @@ -0,0 +1,142 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** An image URL reference for multimodal content. */ +@JsonPropertyOrder({AIGuardImageURL.JSON_PROPERTY_URL}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AIGuardImageURL { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public AIGuardImageURL() {} + + @JsonCreator + public AIGuardImageURL(@JsonProperty(required = true, value = JSON_PROPERTY_URL) String url) { + this.url = url; + } + + public AIGuardImageURL url(String url) { + this.url = url; + return this; + } + + /** + * The URL pointing to the image. + * + * @return url + */ + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AIGuardImageURL + */ + @JsonAnySetter + public AIGuardImageURL putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AIGuardImageURL object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AIGuardImageURL aiGuardImageUrl = (AIGuardImageURL) o; + return Objects.equals(this.url, aiGuardImageUrl.url) + && Objects.equals(this.additionalProperties, aiGuardImageUrl.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(url, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AIGuardImageURL {\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AIGuardMessage.java b/src/main/java/com/datadog/api/client/v2/model/AIGuardMessage.java new file mode 100644 index 00000000000..51da7aa1d25 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AIGuardMessage.java @@ -0,0 +1,246 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A single message in the conversation to evaluate. */ +@JsonPropertyOrder({ + AIGuardMessage.JSON_PROPERTY_CONTENT, + AIGuardMessage.JSON_PROPERTY_ROLE, + AIGuardMessage.JSON_PROPERTY_TOOL_CALL_ID, + AIGuardMessage.JSON_PROPERTY_TOOL_CALLS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AIGuardMessage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONTENT = "content"; + private AIGuardMessageContent content; + + public static final String JSON_PROPERTY_ROLE = "role"; + private AIGuardMessageRole role; + + public static final String JSON_PROPERTY_TOOL_CALL_ID = "tool_call_id"; + private String toolCallId; + + public static final String JSON_PROPERTY_TOOL_CALLS = "tool_calls"; + private List toolCalls = null; + + public AIGuardMessage() {} + + @JsonCreator + public AIGuardMessage( + @JsonProperty(required = true, value = JSON_PROPERTY_ROLE) AIGuardMessageRole role) { + this.role = role; + this.unparsed |= !role.isValid(); + } + + public AIGuardMessage content(AIGuardMessageContent content) { + this.content = content; + this.unparsed |= content.unparsed; + return this; + } + + /** + * The message content, either a plain string or an array of content parts. + * + * @return content + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AIGuardMessageContent getContent() { + return content; + } + + public void setContent(AIGuardMessageContent content) { + this.content = content; + } + + public AIGuardMessage role(AIGuardMessageRole role) { + this.role = role; + this.unparsed |= !role.isValid(); + return this; + } + + /** + * The role of the message author in the conversation. + * + * @return role + */ + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AIGuardMessageRole getRole() { + return role; + } + + public void setRole(AIGuardMessageRole role) { + if (!role.isValid()) { + this.unparsed = true; + } + this.role = role; + } + + public AIGuardMessage toolCallId(String toolCallId) { + this.toolCallId = toolCallId; + return this; + } + + /** + * The ID of the tool call this message is responding to, required for tool messages. + * + * @return toolCallId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOOL_CALL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getToolCallId() { + return toolCallId; + } + + public void setToolCallId(String toolCallId) { + this.toolCallId = toolCallId; + } + + public AIGuardMessage toolCalls(List toolCalls) { + this.toolCalls = toolCalls; + for (AIGuardToolCall item : toolCalls) { + this.unparsed |= item.unparsed; + } + return this; + } + + public AIGuardMessage addToolCallsItem(AIGuardToolCall toolCallsItem) { + if (this.toolCalls == null) { + this.toolCalls = new ArrayList<>(); + } + this.toolCalls.add(toolCallsItem); + this.unparsed |= toolCallsItem.unparsed; + return this; + } + + /** + * Tool calls issued by the assistant in this message. + * + * @return toolCalls + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOOL_CALLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getToolCalls() { + return toolCalls; + } + + public void setToolCalls(List toolCalls) { + this.toolCalls = toolCalls; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AIGuardMessage + */ + @JsonAnySetter + public AIGuardMessage putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AIGuardMessage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AIGuardMessage aiGuardMessage = (AIGuardMessage) o; + return Objects.equals(this.content, aiGuardMessage.content) + && Objects.equals(this.role, aiGuardMessage.role) + && Objects.equals(this.toolCallId, aiGuardMessage.toolCallId) + && Objects.equals(this.toolCalls, aiGuardMessage.toolCalls) + && Objects.equals(this.additionalProperties, aiGuardMessage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(content, role, toolCallId, toolCalls, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AIGuardMessage {\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" toolCallId: ").append(toIndentedString(toolCallId)).append("\n"); + sb.append(" toolCalls: ").append(toIndentedString(toolCalls)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AIGuardMessageContent.java b/src/main/java/com/datadog/api/client/v2/model/AIGuardMessageContent.java new file mode 100644 index 00000000000..b01165d86f1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AIGuardMessageContent.java @@ -0,0 +1,272 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize(using = AIGuardMessageContent.AIGuardMessageContentDeserializer.class) +@JsonSerialize(using = AIGuardMessageContent.AIGuardMessageContentSerializer.class) +public class AIGuardMessageContent extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(AIGuardMessageContent.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class AIGuardMessageContentSerializer extends StdSerializer { + public AIGuardMessageContentSerializer(Class t) { + super(t); + } + + public AIGuardMessageContentSerializer() { + this(null); + } + + @Override + public void serialize( + AIGuardMessageContent value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class AIGuardMessageContentDeserializer + extends StdDeserializer { + public AIGuardMessageContentDeserializer() { + this(AIGuardMessageContent.class); + } + + public AIGuardMessageContentDeserializer(Class vc) { + super(vc); + } + + @Override + public AIGuardMessageContent deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize String + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (String.class.equals(Integer.class) + || String.class.equals(Long.class) + || String.class.equals(Float.class) + || String.class.equals(Double.class) + || String.class.equals(Boolean.class) + || String.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((String.class.equals(Integer.class) || String.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((String.class.equals(Float.class) || String.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (String.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (String.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(String.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + deserialized = tmp; + match++; + + log.log(Level.FINER, "Input data matches schema 'String'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + // deserialize List + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (List.class.equals(Integer.class) + || List.class.equals(Long.class) + || List.class.equals(Float.class) + || List.class.equals(Double.class) + || List.class.equals(Boolean.class) + || List.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((List.class.equals(Integer.class) || List.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((List.class.equals(Float.class) || List.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (List.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (List.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(new TypeReference>() {}); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + deserialized = tmp; + match++; + + log.log(Level.FINER, "Input data matches schema 'List'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'List'", e); + } + + AIGuardMessageContent ret = new AIGuardMessageContent(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public AIGuardMessageContent getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "AIGuardMessageContent cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public AIGuardMessageContent() { + super("oneOf", Boolean.FALSE); + } + + public AIGuardMessageContent(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public AIGuardMessageContent(List o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", new GenericType() {}); + schemas.put("List", new GenericType>() {}); + JSON.registerDescendants(AIGuardMessageContent.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return AIGuardMessageContent.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: String, List<AIGuardContentPart> + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(String.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(List.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException("Invalid instance type. Must be String, List"); + } + + /** + * Get the actual instance, which can be the following: String, List<AIGuardContentPart> + * + * @return The actual instance (String, List<AIGuardContentPart>) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String) super.getActualInstance(); + } + + /** + * Get the actual instance of `List<AIGuardContentPart>`. If the actual instance is not + * `List<AIGuardContentPart>`, the ClassCastException will be thrown. + * + * @return The actual instance of `List<AIGuardContentPart>` + * @throws ClassCastException if the instance is not `List<AIGuardContentPart>` + */ + public List getList() throws ClassCastException { + return (List) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AIGuardMessageRole.java b/src/main/java/com/datadog/api/client/v2/model/AIGuardMessageRole.java new file mode 100644 index 00000000000..f02d19ff3c8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AIGuardMessageRole.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The role of the message author in the conversation. */ +@JsonSerialize(using = AIGuardMessageRole.AIGuardMessageRoleSerializer.class) +public class AIGuardMessageRole extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("user", "assistant", "system", "tool", "developer")); + + public static final AIGuardMessageRole USER = new AIGuardMessageRole("user"); + public static final AIGuardMessageRole ASSISTANT = new AIGuardMessageRole("assistant"); + public static final AIGuardMessageRole SYSTEM = new AIGuardMessageRole("system"); + public static final AIGuardMessageRole TOOL = new AIGuardMessageRole("tool"); + public static final AIGuardMessageRole DEVELOPER = new AIGuardMessageRole("developer"); + + AIGuardMessageRole(String value) { + super(value, allowedValues); + } + + public static class AIGuardMessageRoleSerializer extends StdSerializer { + public AIGuardMessageRoleSerializer(Class t) { + super(t); + } + + public AIGuardMessageRoleSerializer() { + this(null); + } + + @Override + public void serialize(AIGuardMessageRole value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AIGuardMessageRole fromValue(String value) { + return new AIGuardMessageRole(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AIGuardMeta.java b/src/main/java/com/datadog/api/client/v2/model/AIGuardMeta.java new file mode 100644 index 00000000000..d208f6f715a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AIGuardMeta.java @@ -0,0 +1,250 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Optional metadata providing context about the originating service and request. */ +@JsonPropertyOrder({ + AIGuardMeta.JSON_PROPERTY_CODING_AGENT, + AIGuardMeta.JSON_PROPERTY_CONFIDENCE_THRESHOLD, + AIGuardMeta.JSON_PROPERTY_ENV, + AIGuardMeta.JSON_PROPERTY_IS_SDS_ENABLED_OVERRIDE, + AIGuardMeta.JSON_PROPERTY_SERVICE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AIGuardMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CODING_AGENT = "coding_agent"; + private String codingAgent; + + public static final String JSON_PROPERTY_CONFIDENCE_THRESHOLD = "confidence_threshold"; + private Double confidenceThreshold; + + public static final String JSON_PROPERTY_ENV = "env"; + private String env; + + public static final String JSON_PROPERTY_IS_SDS_ENABLED_OVERRIDE = "is_sds_enabled_override"; + private Boolean isSdsEnabledOverride; + + public static final String JSON_PROPERTY_SERVICE = "service"; + private String service; + + public AIGuardMeta codingAgent(String codingAgent) { + this.codingAgent = codingAgent; + return this; + } + + /** + * Identifier of the coding agent sending the request, if applicable. + * + * @return codingAgent + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CODING_AGENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCodingAgent() { + return codingAgent; + } + + public void setCodingAgent(String codingAgent) { + this.codingAgent = codingAgent; + } + + public AIGuardMeta confidenceThreshold(Double confidenceThreshold) { + this.confidenceThreshold = confidenceThreshold; + return this; + } + + /** + * Override for the default threat detection confidence threshold, between 0.0 and 1.0. + * + * @return confidenceThreshold + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONFIDENCE_THRESHOLD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getConfidenceThreshold() { + return confidenceThreshold; + } + + public void setConfidenceThreshold(Double confidenceThreshold) { + this.confidenceThreshold = confidenceThreshold; + } + + public AIGuardMeta env(String env) { + this.env = env; + return this; + } + + /** + * The deployment environment of the originating service. + * + * @return env + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENV) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEnv() { + return env; + } + + public void setEnv(String env) { + this.env = env; + } + + public AIGuardMeta isSdsEnabledOverride(Boolean isSdsEnabledOverride) { + this.isSdsEnabledOverride = isSdsEnabledOverride; + return this; + } + + /** + * Override whether sensitive data scanning is applied to this request. + * + * @return isSdsEnabledOverride + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_SDS_ENABLED_OVERRIDE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsSdsEnabledOverride() { + return isSdsEnabledOverride; + } + + public void setIsSdsEnabledOverride(Boolean isSdsEnabledOverride) { + this.isSdsEnabledOverride = isSdsEnabledOverride; + } + + public AIGuardMeta service(String service) { + this.service = service; + return this; + } + + /** + * The name of the service sending the evaluation request. + * + * @return service + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SERVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getService() { + return service; + } + + public void setService(String service) { + this.service = service; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AIGuardMeta + */ + @JsonAnySetter + public AIGuardMeta putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AIGuardMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AIGuardMeta aiGuardMeta = (AIGuardMeta) o; + return Objects.equals(this.codingAgent, aiGuardMeta.codingAgent) + && Objects.equals(this.confidenceThreshold, aiGuardMeta.confidenceThreshold) + && Objects.equals(this.env, aiGuardMeta.env) + && Objects.equals(this.isSdsEnabledOverride, aiGuardMeta.isSdsEnabledOverride) + && Objects.equals(this.service, aiGuardMeta.service) + && Objects.equals(this.additionalProperties, aiGuardMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + codingAgent, confidenceThreshold, env, isSdsEnabledOverride, service, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AIGuardMeta {\n"); + sb.append(" codingAgent: ").append(toIndentedString(codingAgent)).append("\n"); + sb.append(" confidenceThreshold: ") + .append(toIndentedString(confidenceThreshold)) + .append("\n"); + sb.append(" env: ").append(toIndentedString(env)).append("\n"); + sb.append(" isSdsEnabledOverride: ") + .append(toIndentedString(isSdsEnabledOverride)) + .append("\n"); + sb.append(" service: ").append(toIndentedString(service)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AIGuardSdsFinding.java b/src/main/java/com/datadog/api/client/v2/model/AIGuardSdsFinding.java new file mode 100644 index 00000000000..72391cfaee5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AIGuardSdsFinding.java @@ -0,0 +1,233 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A sensitive data finding detected by the SDS scanner. */ +@JsonPropertyOrder({ + AIGuardSdsFinding.JSON_PROPERTY_CATEGORY, + AIGuardSdsFinding.JSON_PROPERTY_LOCATION, + AIGuardSdsFinding.JSON_PROPERTY_RULE_DISPLAY_NAME, + AIGuardSdsFinding.JSON_PROPERTY_RULE_TAG +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AIGuardSdsFinding { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CATEGORY = "category"; + private String category; + + public static final String JSON_PROPERTY_LOCATION = "location"; + private AIGuardSdsFindingLocation location; + + public static final String JSON_PROPERTY_RULE_DISPLAY_NAME = "rule_display_name"; + private String ruleDisplayName; + + public static final String JSON_PROPERTY_RULE_TAG = "rule_tag"; + private String ruleTag; + + public AIGuardSdsFinding() {} + + @JsonCreator + public AIGuardSdsFinding( + @JsonProperty(required = true, value = JSON_PROPERTY_CATEGORY) String category, + @JsonProperty(required = true, value = JSON_PROPERTY_LOCATION) + AIGuardSdsFindingLocation location, + @JsonProperty(required = true, value = JSON_PROPERTY_RULE_DISPLAY_NAME) + String ruleDisplayName, + @JsonProperty(required = true, value = JSON_PROPERTY_RULE_TAG) String ruleTag) { + this.category = category; + this.location = location; + this.unparsed |= location.unparsed; + this.ruleDisplayName = ruleDisplayName; + this.ruleTag = ruleTag; + } + + public AIGuardSdsFinding category(String category) { + this.category = category; + return this; + } + + /** + * The category of sensitive data detected. + * + * @return category + */ + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public AIGuardSdsFinding location(AIGuardSdsFindingLocation location) { + this.location = location; + this.unparsed |= location.unparsed; + return this; + } + + /** + * The location of a sensitive data match within the evaluated request. + * + * @return location + */ + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AIGuardSdsFindingLocation getLocation() { + return location; + } + + public void setLocation(AIGuardSdsFindingLocation location) { + this.location = location; + } + + public AIGuardSdsFinding ruleDisplayName(String ruleDisplayName) { + this.ruleDisplayName = ruleDisplayName; + return this; + } + + /** + * The human-readable name of the SDS rule that triggered. + * + * @return ruleDisplayName + */ + @JsonProperty(JSON_PROPERTY_RULE_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRuleDisplayName() { + return ruleDisplayName; + } + + public void setRuleDisplayName(String ruleDisplayName) { + this.ruleDisplayName = ruleDisplayName; + } + + public AIGuardSdsFinding ruleTag(String ruleTag) { + this.ruleTag = ruleTag; + return this; + } + + /** + * The tag identifier of the SDS rule that triggered. + * + * @return ruleTag + */ + @JsonProperty(JSON_PROPERTY_RULE_TAG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRuleTag() { + return ruleTag; + } + + public void setRuleTag(String ruleTag) { + this.ruleTag = ruleTag; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AIGuardSdsFinding + */ + @JsonAnySetter + public AIGuardSdsFinding putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AIGuardSdsFinding object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AIGuardSdsFinding aiGuardSdsFinding = (AIGuardSdsFinding) o; + return Objects.equals(this.category, aiGuardSdsFinding.category) + && Objects.equals(this.location, aiGuardSdsFinding.location) + && Objects.equals(this.ruleDisplayName, aiGuardSdsFinding.ruleDisplayName) + && Objects.equals(this.ruleTag, aiGuardSdsFinding.ruleTag) + && Objects.equals(this.additionalProperties, aiGuardSdsFinding.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(category, location, ruleDisplayName, ruleTag, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AIGuardSdsFinding {\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" ruleDisplayName: ").append(toIndentedString(ruleDisplayName)).append("\n"); + sb.append(" ruleTag: ").append(toIndentedString(ruleTag)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AIGuardSdsFindingLocation.java b/src/main/java/com/datadog/api/client/v2/model/AIGuardSdsFindingLocation.java new file mode 100644 index 00000000000..cdd4c1d037d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AIGuardSdsFindingLocation.java @@ -0,0 +1,203 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The location of a sensitive data match within the evaluated request. */ +@JsonPropertyOrder({ + AIGuardSdsFindingLocation.JSON_PROPERTY_END_INDEX_EXCLUSIVE, + AIGuardSdsFindingLocation.JSON_PROPERTY_PATH, + AIGuardSdsFindingLocation.JSON_PROPERTY_START_INDEX +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AIGuardSdsFindingLocation { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_END_INDEX_EXCLUSIVE = "end_index_exclusive"; + private Long endIndexExclusive; + + public static final String JSON_PROPERTY_PATH = "path"; + private String path; + + public static final String JSON_PROPERTY_START_INDEX = "start_index"; + private Long startIndex; + + public AIGuardSdsFindingLocation() {} + + @JsonCreator + public AIGuardSdsFindingLocation( + @JsonProperty(required = true, value = JSON_PROPERTY_END_INDEX_EXCLUSIVE) + Long endIndexExclusive, + @JsonProperty(required = true, value = JSON_PROPERTY_PATH) String path, + @JsonProperty(required = true, value = JSON_PROPERTY_START_INDEX) Long startIndex) { + this.endIndexExclusive = endIndexExclusive; + this.path = path; + this.startIndex = startIndex; + } + + public AIGuardSdsFindingLocation endIndexExclusive(Long endIndexExclusive) { + this.endIndexExclusive = endIndexExclusive; + return this; + } + + /** + * The end character index (exclusive) of the sensitive data match. + * + * @return endIndexExclusive + */ + @JsonProperty(JSON_PROPERTY_END_INDEX_EXCLUSIVE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getEndIndexExclusive() { + return endIndexExclusive; + } + + public void setEndIndexExclusive(Long endIndexExclusive) { + this.endIndexExclusive = endIndexExclusive; + } + + public AIGuardSdsFindingLocation path(String path) { + this.path = path; + return this; + } + + /** + * The JSON path to the field containing the sensitive data. + * + * @return path + */ + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public AIGuardSdsFindingLocation startIndex(Long startIndex) { + this.startIndex = startIndex; + return this; + } + + /** + * The start character index of the sensitive data match. + * + * @return startIndex + */ + @JsonProperty(JSON_PROPERTY_START_INDEX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getStartIndex() { + return startIndex; + } + + public void setStartIndex(Long startIndex) { + this.startIndex = startIndex; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AIGuardSdsFindingLocation + */ + @JsonAnySetter + public AIGuardSdsFindingLocation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AIGuardSdsFindingLocation object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AIGuardSdsFindingLocation aiGuardSdsFindingLocation = (AIGuardSdsFindingLocation) o; + return Objects.equals(this.endIndexExclusive, aiGuardSdsFindingLocation.endIndexExclusive) + && Objects.equals(this.path, aiGuardSdsFindingLocation.path) + && Objects.equals(this.startIndex, aiGuardSdsFindingLocation.startIndex) + && Objects.equals( + this.additionalProperties, aiGuardSdsFindingLocation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(endIndexExclusive, path, startIndex, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AIGuardSdsFindingLocation {\n"); + sb.append(" endIndexExclusive: ").append(toIndentedString(endIndexExclusive)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AIGuardToolCall.java b/src/main/java/com/datadog/api/client/v2/model/AIGuardToolCall.java new file mode 100644 index 00000000000..8b25d57ea0e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AIGuardToolCall.java @@ -0,0 +1,173 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A tool call issued by the assistant. */ +@JsonPropertyOrder({AIGuardToolCall.JSON_PROPERTY_FUNCTION, AIGuardToolCall.JSON_PROPERTY_ID}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AIGuardToolCall { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FUNCTION = "function"; + private AIGuardToolCallFunction function; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public AIGuardToolCall() {} + + @JsonCreator + public AIGuardToolCall( + @JsonProperty(required = true, value = JSON_PROPERTY_FUNCTION) + AIGuardToolCallFunction function, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id) { + this.function = function; + this.unparsed |= function.unparsed; + this.id = id; + } + + public AIGuardToolCall function(AIGuardToolCallFunction function) { + this.function = function; + this.unparsed |= function.unparsed; + return this; + } + + /** + * The function definition within a tool call. + * + * @return function + */ + @JsonProperty(JSON_PROPERTY_FUNCTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AIGuardToolCallFunction getFunction() { + return function; + } + + public void setFunction(AIGuardToolCallFunction function) { + this.function = function; + } + + public AIGuardToolCall id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the tool call. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AIGuardToolCall + */ + @JsonAnySetter + public AIGuardToolCall putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AIGuardToolCall object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AIGuardToolCall aiGuardToolCall = (AIGuardToolCall) o; + return Objects.equals(this.function, aiGuardToolCall.function) + && Objects.equals(this.id, aiGuardToolCall.id) + && Objects.equals(this.additionalProperties, aiGuardToolCall.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(function, id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AIGuardToolCall {\n"); + sb.append(" function: ").append(toIndentedString(function)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AIGuardToolCallFunction.java b/src/main/java/com/datadog/api/client/v2/model/AIGuardToolCallFunction.java new file mode 100644 index 00000000000..c8f8c0058d6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AIGuardToolCallFunction.java @@ -0,0 +1,173 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The function definition within a tool call. */ +@JsonPropertyOrder({ + AIGuardToolCallFunction.JSON_PROPERTY_ARGUMENTS, + AIGuardToolCallFunction.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AIGuardToolCallFunction { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ARGUMENTS = "arguments"; + private String arguments; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public AIGuardToolCallFunction() {} + + @JsonCreator + public AIGuardToolCallFunction( + @JsonProperty(required = true, value = JSON_PROPERTY_ARGUMENTS) String arguments, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.arguments = arguments; + this.name = name; + } + + public AIGuardToolCallFunction arguments(String arguments) { + this.arguments = arguments; + return this; + } + + /** + * The JSON-encoded arguments passed to the function. + * + * @return arguments + */ + @JsonProperty(JSON_PROPERTY_ARGUMENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getArguments() { + return arguments; + } + + public void setArguments(String arguments) { + this.arguments = arguments; + } + + public AIGuardToolCallFunction name(String name) { + this.name = name; + return this; + } + + /** + * The name of the function being called. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AIGuardToolCallFunction + */ + @JsonAnySetter + public AIGuardToolCallFunction putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AIGuardToolCallFunction object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AIGuardToolCallFunction aiGuardToolCallFunction = (AIGuardToolCallFunction) o; + return Objects.equals(this.arguments, aiGuardToolCallFunction.arguments) + && Objects.equals(this.name, aiGuardToolCallFunction.name) + && Objects.equals(this.additionalProperties, aiGuardToolCallFunction.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(arguments, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AIGuardToolCallFunction {\n"); + sb.append(" arguments: ").append(toIndentedString(arguments)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/ai_guard.feature b/src/test/resources/com/datadog/api/client/v2/api/ai_guard.feature new file mode 100644 index 00000000000..46d17eb315a --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/ai_guard.feature @@ -0,0 +1,21 @@ +@endpoint(ai-guard) @endpoint(ai-guard-v2) +Feature: AI Guard + Analyze AI conversations for security threats including prompt injection, + jailbreak attempts, and other AI-specific attacks. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "AIGuard" API + And new "EvaluateAIGuardRequest" request + And body with value {"messages": [{"content": "How do I delete all files on the system?", "role": "user"}], "meta": {"env": "production", "service": "my-llm-service"}} + + @generated @skip @team:DataDog/k9-ai-guard + Scenario: Evaluate an AI Guard request returns "Bad Request" response + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-ai-guard + Scenario: Evaluate an AI Guard request returns "Evaluation result with action recommendation" response + When the request is sent + Then the response status is 200 Evaluation result with action recommendation diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 3a15f0b470c..3ba957a655a 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -399,6 +399,12 @@ "type": "safe" } }, + "EvaluateAIGuardRequest": { + "tag": "AI Guard", + "undo": { + "type": "unsafe" + } + }, "ListAnnotations": { "tag": "Annotations", "undo": {