Skip to content

Commit 0f7b58b

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 05ffaef of spec repo
1 parent 90cbce0 commit 0f7b58b

22 files changed

Lines changed: 2175 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 338 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,6 +2066,256 @@ components:
20662066
$ref: "#/components/schemas/JSONAPIErrorResponse"
20672067
description: The server cannot process the request because it contains invalid data.
20682068
schemas:
2069+
AIGuardAction:
2070+
description: The action recommendation from the AI Guard evaluation.
2071+
enum:
2072+
- ALLOW
2073+
- DENY
2074+
- ABORT
2075+
example: ALLOW
2076+
type: string
2077+
x-enum-varnames:
2078+
- ALLOW
2079+
- DENY
2080+
- ABORT
2081+
AIGuardContentPart:
2082+
description: A single part of a multipart message content.
2083+
properties:
2084+
image_url:
2085+
$ref: "#/components/schemas/AIGuardImageURL"
2086+
text:
2087+
description: The text content of this part, required when type is text.
2088+
example: "How do I delete all files?"
2089+
type: string
2090+
type:
2091+
description: The type of content part, either text or image_url.
2092+
example: text
2093+
type: string
2094+
required:
2095+
- type
2096+
type: object
2097+
AIGuardContentPartList:
2098+
description: A list of content parts forming a multipart message.
2099+
items:
2100+
$ref: "#/components/schemas/AIGuardContentPart"
2101+
type: array
2102+
AIGuardEvaluateRequest:
2103+
description: The evaluation request payload containing conversation messages and optional metadata.
2104+
example:
2105+
messages:
2106+
- content: How do I delete all files on the system?
2107+
role: user
2108+
meta:
2109+
env: production
2110+
service: my-llm-service
2111+
properties:
2112+
messages:
2113+
description: The list of conversation messages to evaluate. Must contain at least one message.
2114+
example:
2115+
- content: How do I delete all files on the system?
2116+
role: user
2117+
items:
2118+
$ref: "#/components/schemas/AIGuardMessage"
2119+
type: array
2120+
meta:
2121+
$ref: "#/components/schemas/AIGuardMeta"
2122+
required:
2123+
- messages
2124+
type: object
2125+
AIGuardEvaluateResponse:
2126+
description: The result of the AI Guard evaluation.
2127+
properties:
2128+
action:
2129+
$ref: "#/components/schemas/AIGuardAction"
2130+
global_prob:
2131+
description: The overall threat probability score across all evaluated tags.
2132+
example: 0.02
2133+
format: double
2134+
type: number
2135+
is_blocking_enabled:
2136+
description: Whether blocking mode is enabled for this organization.
2137+
example: false
2138+
type: boolean
2139+
reason:
2140+
description: A human-readable explanation of the action recommendation.
2141+
example: No threats detected.
2142+
type: string
2143+
sds_findings:
2144+
description: Sensitive data findings detected in the evaluated conversation.
2145+
items:
2146+
$ref: "#/components/schemas/AIGuardSdsFinding"
2147+
type: array
2148+
tag_probs:
2149+
additionalProperties:
2150+
format: double
2151+
type: number
2152+
description: Probability scores for each evaluated threat tag.
2153+
example:
2154+
indirect-prompt-injection: 0.01
2155+
jailbreak: 0.02
2156+
type: object
2157+
tags:
2158+
description: Security threat tags detected in the evaluated conversation.
2159+
example: []
2160+
items:
2161+
type: string
2162+
type: array
2163+
required:
2164+
- action
2165+
- reason
2166+
- tags
2167+
- tag_probs
2168+
- is_blocking_enabled
2169+
type: object
2170+
AIGuardImageURL:
2171+
description: An image URL reference for multimodal content.
2172+
properties:
2173+
url:
2174+
description: The URL pointing to the image.
2175+
example: "https://example.com/image.png"
2176+
type: string
2177+
required:
2178+
- url
2179+
type: object
2180+
AIGuardMessage:
2181+
description: A single message in the conversation to evaluate.
2182+
properties:
2183+
content:
2184+
$ref: "#/components/schemas/AIGuardMessageContent"
2185+
role:
2186+
$ref: "#/components/schemas/AIGuardMessageRole"
2187+
tool_call_id:
2188+
description: The ID of the tool call this message is responding to, required for tool messages.
2189+
example: call_abc123
2190+
type: string
2191+
tool_calls:
2192+
description: Tool calls issued by the assistant in this message.
2193+
items:
2194+
$ref: "#/components/schemas/AIGuardToolCall"
2195+
type: array
2196+
required:
2197+
- role
2198+
type: object
2199+
AIGuardMessageContent:
2200+
description: The message content, either a plain string or an array of content parts.
2201+
oneOf:
2202+
- example: "How do I delete all files on the system?"
2203+
type: string
2204+
- $ref: "#/components/schemas/AIGuardContentPartList"
2205+
AIGuardMessageRole:
2206+
description: The role of the message author in the conversation.
2207+
enum:
2208+
- user
2209+
- assistant
2210+
- system
2211+
- tool
2212+
- developer
2213+
example: user
2214+
type: string
2215+
x-enum-varnames:
2216+
- USER
2217+
- ASSISTANT
2218+
- SYSTEM
2219+
- TOOL
2220+
- DEVELOPER
2221+
AIGuardMeta:
2222+
description: Optional metadata providing context about the originating service and request.
2223+
properties:
2224+
coding_agent:
2225+
description: Identifier of the coding agent sending the request, if applicable.
2226+
example: claude-code
2227+
type: string
2228+
confidence_threshold:
2229+
description: Override for the default threat detection confidence threshold, between 0.0 and 1.0.
2230+
example: 0.7
2231+
format: double
2232+
type: number
2233+
env:
2234+
description: The deployment environment of the originating service.
2235+
example: production
2236+
type: string
2237+
is_sds_enabled_override:
2238+
description: Override whether sensitive data scanning is applied to this request.
2239+
example: false
2240+
type: boolean
2241+
service:
2242+
description: The name of the service sending the evaluation request.
2243+
example: my-llm-service
2244+
type: string
2245+
type: object
2246+
AIGuardSdsFinding:
2247+
description: A sensitive data finding detected by the SDS scanner.
2248+
properties:
2249+
category:
2250+
description: The category of sensitive data detected.
2251+
example: payment_card_number
2252+
type: string
2253+
location:
2254+
$ref: "#/components/schemas/AIGuardSdsFindingLocation"
2255+
rule_display_name:
2256+
description: The human-readable name of the SDS rule that triggered.
2257+
example: Credit Card Number
2258+
type: string
2259+
rule_tag:
2260+
description: The tag identifier of the SDS rule that triggered.
2261+
example: credit_card
2262+
type: string
2263+
required:
2264+
- rule_display_name
2265+
- rule_tag
2266+
- category
2267+
- location
2268+
type: object
2269+
AIGuardSdsFindingLocation:
2270+
description: The location of a sensitive data match within the evaluated request.
2271+
properties:
2272+
end_index_exclusive:
2273+
description: The end character index (exclusive) of the sensitive data match.
2274+
example: 42
2275+
format: int64
2276+
type: integer
2277+
path:
2278+
description: The JSON path to the field containing the sensitive data.
2279+
example: "messages[0].content"
2280+
type: string
2281+
start_index:
2282+
description: The start character index of the sensitive data match.
2283+
example: 0
2284+
format: int64
2285+
type: integer
2286+
required:
2287+
- path
2288+
- start_index
2289+
- end_index_exclusive
2290+
type: object
2291+
AIGuardToolCall:
2292+
description: A tool call issued by the assistant.
2293+
properties:
2294+
function:
2295+
$ref: "#/components/schemas/AIGuardToolCallFunction"
2296+
id:
2297+
description: The unique identifier of the tool call.
2298+
example: call_abc123
2299+
type: string
2300+
required:
2301+
- id
2302+
- function
2303+
type: object
2304+
AIGuardToolCallFunction:
2305+
description: The function definition within a tool call.
2306+
properties:
2307+
arguments:
2308+
description: The JSON-encoded arguments passed to the function.
2309+
example: '{"location": "San Francisco"}'
2310+
type: string
2311+
name:
2312+
description: The name of the function being called.
2313+
example: get_weather
2314+
type: string
2315+
required:
2316+
- name
2317+
- arguments
2318+
type: object
20692319
APIErrorResponse:
20702320
description: API error response.
20712321
properties:
@@ -108469,6 +108719,88 @@ paths:
108469108719
operator: OR
108470108720
permissions:
108471108721
- security_monitoring_findings_read
108722+
/api/v2/ai-guard/evaluate:
108723+
post:
108724+
description: |-
108725+
Analyzes a conversation for security threats such as prompt injection, jailbreak
108726+
attempts, and other AI-specific attacks. Returns an action recommendation (ALLOW,
108727+
DENY, or ABORT) along with the detected threat tags.
108728+
operationId: EvaluateAIGuardRequest
108729+
requestBody:
108730+
content:
108731+
application/json:
108732+
examples:
108733+
default:
108734+
value:
108735+
messages:
108736+
- content: How do I delete all files on the system?
108737+
role: user
108738+
meta:
108739+
env: production
108740+
service: my-llm-service
108741+
schema:
108742+
$ref: "#/components/schemas/AIGuardEvaluateRequest"
108743+
required: true
108744+
responses:
108745+
"200":
108746+
content:
108747+
application/json:
108748+
examples:
108749+
default:
108750+
value:
108751+
action: ALLOW
108752+
global_prob: 0.02
108753+
is_blocking_enabled: false
108754+
reason: No threats detected.
108755+
sds_findings: []
108756+
tag_probs:
108757+
authority-override: 0.01
108758+
data-exfiltration: 0.01
108759+
denial-of-service-tool-call: 0.01
108760+
destructive-tool-call: 0.01
108761+
indirect-prompt-injection: 0.01
108762+
instruction-override: 0.01
108763+
jailbreak: 0.02
108764+
obfuscation: 0.01
108765+
role-play: 0.01
108766+
security-exploit: 0.01
108767+
system-prompt-extraction: 0.01
108768+
tags: []
108769+
schema:
108770+
$ref: "#/components/schemas/AIGuardEvaluateResponse"
108771+
description: Evaluation result with action recommendation
108772+
"400":
108773+
content:
108774+
application/json:
108775+
schema:
108776+
$ref: "#/components/schemas/JSONAPIErrorResponse"
108777+
description: Bad Request
108778+
"401":
108779+
content:
108780+
application/json:
108781+
schema:
108782+
$ref: "#/components/schemas/JSONAPIErrorResponse"
108783+
description: Unauthorized
108784+
"403":
108785+
content:
108786+
application/json:
108787+
schema:
108788+
$ref: "#/components/schemas/JSONAPIErrorResponse"
108789+
description: Forbidden
108790+
"429":
108791+
$ref: "#/components/responses/TooManyRequestsResponse"
108792+
security:
108793+
- apiKeyAuth: []
108794+
appKeyAuth:
108795+
- ai_guard_evaluate
108796+
summary: Evaluate an AI Guard request
108797+
tags:
108798+
- AI Guard
108799+
x-codegen-request-body-name: body
108800+
x-permission:
108801+
operator: AND
108802+
permissions:
108803+
- ai_guard_evaluate
108472108804
/api/v2/annotation:
108473108805
get:
108474108806
description: Returns a flat list of annotations matching the given page, time window, and optional widget filter.
@@ -186414,6 +186746,12 @@ servers:
186414186746
default: api
186415186747
description: The subdomain where the API is deployed.
186416186748
tags:
186749+
- description: |-
186750+
Analyze AI conversations for security threats including prompt injection,
186751+
jailbreak attempts, and other AI-specific attacks.
186752+
externalDocs:
186753+
url: https://docs.datadoghq.com/security/ai_security/
186754+
name: AI Guard
186417186755
- description: |-
186418186756
Configure your API endpoints through the Datadog API.
186419186757
name: API Management
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Evaluate an AI Guard request returns "Evaluation result with action
2+
// recommendation" response
3+
use datadog_api_client::datadog;
4+
use datadog_api_client::datadogV2::api_ai_guard::AIGuardAPI;
5+
use datadog_api_client::datadogV2::model::AIGuardEvaluateRequest;
6+
use datadog_api_client::datadogV2::model::AIGuardMessage;
7+
use datadog_api_client::datadogV2::model::AIGuardMessageContent;
8+
use datadog_api_client::datadogV2::model::AIGuardMessageRole;
9+
use datadog_api_client::datadogV2::model::AIGuardMeta;
10+
11+
#[tokio::main]
12+
async fn main() {
13+
let body = AIGuardEvaluateRequest::new(vec![AIGuardMessage::new(AIGuardMessageRole::USER)
14+
.content(AIGuardMessageContent::String(
15+
"How do I delete all files on the system?".to_string(),
16+
))])
17+
.meta(
18+
AIGuardMeta::new()
19+
.env("production".to_string())
20+
.service("my-llm-service".to_string()),
21+
);
22+
let configuration = datadog::Configuration::new();
23+
let api = AIGuardAPI::with_config(configuration);
24+
let resp = api.evaluate_ai_guard_request(body).await;
25+
if let Ok(value) = resp {
26+
println!("{:#?}", value);
27+
} else {
28+
println!("{:#?}", resp.unwrap_err());
29+
}
30+
}

0 commit comments

Comments
 (0)