Evaluate an AI Guard request
https://api.datadoghq.com/api/v2/ai-guard/evaluatehttps://api.us3.datadoghq.com/api/v2/ai-guard/evaluatehttps://api.us5.datadoghq.com/api/v2/ai-guard/evaluatehttps://api.datadoghq.eu/api/v2/ai-guard/evaluatehttps://api.ap1.datadoghq.com/api/v2/ai-guard/evaluatehttps://api.ap2.datadoghq.com/api/v2/ai-guard/evaluatehttps://api.uk1.datadoghq.com/api/v2/ai-guard/evaluatehttps://api.ddog-gov.com/api/v2/ai-guard/evaluatehttps://api.us2.ddog-gov.com/api/v2/ai-guard/evaluateOverview
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 and their confidence scores.
AI Guard must be activated for the organization, and the calling user or
application key requires the ai_guard_evaluate permission. The action is a
recommendation for the caller to enforce: ALLOW permits the interaction,
DENY blocks the interaction, and ABORT terminates the workflow.
This endpoint is rate limited to 700 requests per minute per organization.
Organization token limits can also result in a 429 response.
Malformed messages return a 400 response. Requests exceeding the raw-input
limit of 1,000,000 tokens return a 413 response; this limit applies to the
input context, not only the size of the HTTP request body.
OAuth apps require the ai_guard_evaluate authorization scope to access this endpoint.
Request
Body Data (required)
The conversation to evaluate for security threats.
data [required]The JSON:API request envelope for an AI Guard evaluation.
attributes [required]The conversation to evaluate and its metadata.
messages [required]The messages of the conversation to evaluate, in order. Must contain at least one message.
contentThe content of a message, either a plain string or a list of OpenAI-style content parts.
Object 1The message content as a plain string.
Object 2The message content as a list of content parts. The list must be non-empty for user, system, developer, and tool messages.
image_urlAn image referenced by URL in a message content part.
url [required]The image URL or a data URI with an image/png, image/jpeg, image/gif, or image/webp MIME type.
textThe text content, required and non-empty when type is text in a user, system, developer, or tool message.
type [required]The type of the content part.
text, image_urlrole [required]The role of the message author in the conversation.
user, assistant, system, developer, tooltool_call_idThe identifier of the tool call this message responds to, present on tool result messages.
tool_callsThe tool calls emitted by the assistant, present on assistant messages that call tools.
function [required]The function invoked by a tool call.
arguments [required]The arguments of the function call, serialized as a JSON string.
name [required]The name of the function to call.
id [required]The identifier of the tool call.
metaMetadata about the evaluated conversation, used to select the policy and evaluator behavior.
coding_agentThe coding agent that produced the conversation. By default, a non-empty
value selects the coding-agent evaluator profile, while an omitted or empty
value selects the default profile. Known identifiers include claude-code,
codex, cursor, and github-copilot; other identifiers are accepted.
The coding-agent profile assumes the caller can ask the user to confirm
Supply Chain Firewall warnings; the default profile assumes it cannot.
confidence_thresholdRequest-only confidence threshold override. A number sets the threshold for every threat category; an object supplies a global threshold and optional per-category overrides. Omit this field to use the stored sensitivity policy. This field is not returned in evaluation responses.
Object 1The global confidence threshold applied to every threat category.
Object 2Request-level confidence threshold override. flagging_global is the global
threshold applied to every threat category. Any other property is a
per-category override keyed by an AI Guard threat tag; per-category values
take precedence over flagging_global, and categories without an entry fall
back to it. When this object omits flagging_global, the fallback is 0.5.
Recognized category keys include policy-evasion, indirect-prompt-injection,
system-and-capability-discovery, credential-access, sensitive-data-collection,
privilege-escalation, malicious-execution, private-network-target,
destructive-or-resource-abuse, tool-abuse, poisoning-or-persistence, and
data-exfiltration. Unknown category keys are ignored.
flagging_globalThe global confidence threshold applied to categories without a specific override.
envThe environment the conversation belongs to.
is_sds_enabled_overrideWhether to run the Sensitive Data Scanner for this request, overriding the stored policy.
serviceThe name of the service the conversation belongs to.
tool_policiesA non-empty map replaces stored tool policies for this request only, keyed by tool name. Any called tool not present resolves to EVALUATE. Only takes effect when tool policies are enabled for the organization.
<any-key>The policy action for a tool named by the property. Tool policies override the recommendation after evaluation; they do not skip evaluation. Any BLOCK takes precedence over PASS and EVALUATE. The Supply Chain Firewall is applied afterward and can still return DENY.
PASS, BLOCK, EVALUATEtype [required]The JSON:API resource type for AI Guard evaluation requests and responses.
Its value is evaluations for the action endpoint /api/v2/ai-guard/evaluate.
evaluationsEvaluate an AI Guard request returns "OK" response
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"content": "Hello world!",
"role": "user"
}
],
"meta": {
"confidence_threshold": 0.8
}
}
}
}Evaluate an AI Guard request with a numeric confidence threshold
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"role": "user",
"content": "Hello world!"
}
],
"meta": {
"confidence_threshold": 0.8
}
}
}
}Evaluate an AI Guard request with per-category confidence thresholds
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"role": "user",
"content": "Hello world!"
}
],
"meta": {
"confidence_threshold": {
"flagging_global": 0.6,
"policy-evasion": 0.9,
"indirect-prompt-injection": 0.4
}
}
}
}
}Response
OK
The response containing the evaluation result.
data [required]The JSON:API evaluation resource.
attributes [required]The evaluation result with the recommended action and detected threat information.
action [required]The recommended action for the evaluated conversation.
ALLOW, DENY, ABORTglobal_probThe global threat probability, between 0 and 1. Included only when computed.
is_blocking_enabled [required]Whether blocking is enabled for the organization.
reason [required]The explanation for the recommended action, for logging rather than user-facing display.
redaction_replacementsThe redacted replacements computed for the request. Included only when redaction applies.
path [required]The path of the redacted content relative to the request attributes.
replacement [required]The redacted replacement content.
scfw_findingsThe Supply Chain Firewall verdict for the version-pinned install packages
found in the request. Evaluation requires Supply Chain Firewall to be enabled
for the organization and the caller to have the appsec_vm_read permission.
Without that permission, Supply Chain Firewall evaluation is skipped; the
AI Guard evaluation request itself is not rejected. Findings are omitted
when Supply Chain Firewall does not produce a result.
The recommended action combines the package outcomes.
Confirmation support is inferred from the evaluator profile, not from a
separate confirmation-capability flag. By default, a non-empty
meta.coding_agent selects the coding-agent profile, which assumes the caller
can ask for confirmation and retains WARN in recommended_action.
Omitting meta.coding_agent or setting it to an empty string selects the
default profile, which assumes the caller cannot ask for confirmation and
returns ALLOW instead of WARN in recommended_action. Package outcomes
still retain WARN, and BLOCK is never changed to ALLOW by this rule.
packagesThe packages the firewall evaluated, ALLOW ones included.
ecosystem [required]The package ecosystem the firewall evaluated, such as PyPI, npm, or crates.io.
matched_rulesEvery rule the firewall matched on the package.
outcome [required]The Supply Chain Firewall outcome for a package, a matched rule, or the whole request.
ALLOW, WARN, BLOCKrule [required]The rule text the firewall reported, or the policy type when no text was reported.
name [required]The name of the package.
outcome [required]The Supply Chain Firewall outcome for a package, a matched rule, or the whole request.
ALLOW, WARN, BLOCKversion [required]The version of the package.
recommended_action [required]The Supply Chain Firewall outcome for a package, a matched rule, or the whole request.
ALLOW, WARN, BLOCKsds_findingsThe sensitive data findings from the Sensitive Data Scanner. Included only when findings exist.
category [required]The category of the sensitive data found.
location [required]The location of a sensitive data match within the request.
end_index_exclusive [required]The exclusive end index of the match within the located content.
path [required]The path of the match relative to the request attributes.
start_index [required]The start index of the match within the located content.
rule_display_name [required]The display name of the SDS rule that matched.
rule_tag [required]The tag of the SDS rule that matched.
tag_probs [required]The detection confidence for each threat tag, between 0 and 1. May be null when the evaluation does not produce per-category scores.
<any-key>The detection confidence for the threat tag named by the property.
tags [required]The threat tags detected in the conversation.
id [required]The unique identifier of the evaluation.
type [required]The JSON:API resource type for AI Guard evaluation requests and responses.
Its value is evaluations for the action endpoint /api/v2/ai-guard/evaluate.
evaluations{
"data": {
"attributes": {
"action": "ALLOW",
"global_prob": 0.005218505859375,
"is_blocking_enabled": false,
"reason": "No rule match.",
"redaction_replacements": [
{
"path": "messages[0].content",
"replacement": "[REDACTED]"
}
],
"scfw_findings": {
"packages": [
{
"ecosystem": "npm",
"matched_rules": [
{
"outcome": "BLOCK",
"rule": "Disallow install commands"
}
],
"name": "left-pad",
"outcome": "BLOCK",
"version": "1.3.0"
}
],
"recommended_action": "BLOCK"
},
"sds_findings": [
{
"category": "financial",
"location": {
"end_index_exclusive": 42,
"path": "messages[0].content",
"start_index": 12
},
"rule_display_name": "Credit Card Number",
"rule_tag": "credit-card"
}
],
"tag_probs": {
"<any-key>": 0.97
},
"tags": [
[]
]
},
"id": "a76a703c-324f-42ed-af33-9b17d65e28af",
"type": "evaluations"
}
}Bad Request
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Unauthorized
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Forbidden
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Request Timeout
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Payload Too Large
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Code Example
Evaluate an AI Guard request returns "OK" response
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"content": "Hello world!",
"role": "user"
}
],
"meta": {
"confidence_threshold": 0.8
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"content": "Hello world!",
"role": "user"
}
],
"meta": {
"confidence_threshold": 0.8
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"content": "Hello world!",
"role": "user"
}
],
"meta": {
"confidence_threshold": 0.8
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"content": "Hello world!",
"role": "user"
}
],
"meta": {
"confidence_threshold": 0.8
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"content": "Hello world!",
"role": "user"
}
],
"meta": {
"confidence_threshold": 0.8
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"content": "Hello world!",
"role": "user"
}
],
"meta": {
"confidence_threshold": 0.8
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"content": "Hello world!",
"role": "user"
}
],
"meta": {
"confidence_threshold": 0.8
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"content": "Hello world!",
"role": "user"
}
],
"meta": {
"confidence_threshold": 0.8
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"content": "Hello world!",
"role": "user"
}
],
"meta": {
"confidence_threshold": 0.8
}
}
}
}
EOFEvaluate an AI Guard request with a numeric confidence threshold
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"role": "user",
"content": "Hello world!"
}
],
"meta": {
"confidence_threshold": 0.8
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"role": "user",
"content": "Hello world!"
}
],
"meta": {
"confidence_threshold": 0.8
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"role": "user",
"content": "Hello world!"
}
],
"meta": {
"confidence_threshold": 0.8
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"role": "user",
"content": "Hello world!"
}
],
"meta": {
"confidence_threshold": 0.8
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"role": "user",
"content": "Hello world!"
}
],
"meta": {
"confidence_threshold": 0.8
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"role": "user",
"content": "Hello world!"
}
],
"meta": {
"confidence_threshold": 0.8
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"role": "user",
"content": "Hello world!"
}
],
"meta": {
"confidence_threshold": 0.8
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"role": "user",
"content": "Hello world!"
}
],
"meta": {
"confidence_threshold": 0.8
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"role": "user",
"content": "Hello world!"
}
],
"meta": {
"confidence_threshold": 0.8
}
}
}
}
EOFEvaluate an AI Guard request with per-category confidence thresholds
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"role": "user",
"content": "Hello world!"
}
],
"meta": {
"confidence_threshold": {
"flagging_global": 0.6,
"policy-evasion": 0.9,
"indirect-prompt-injection": 0.4
}
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"role": "user",
"content": "Hello world!"
}
],
"meta": {
"confidence_threshold": {
"flagging_global": 0.6,
"policy-evasion": 0.9,
"indirect-prompt-injection": 0.4
}
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"role": "user",
"content": "Hello world!"
}
],
"meta": {
"confidence_threshold": {
"flagging_global": 0.6,
"policy-evasion": 0.9,
"indirect-prompt-injection": 0.4
}
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"role": "user",
"content": "Hello world!"
}
],
"meta": {
"confidence_threshold": {
"flagging_global": 0.6,
"policy-evasion": 0.9,
"indirect-prompt-injection": 0.4
}
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"role": "user",
"content": "Hello world!"
}
],
"meta": {
"confidence_threshold": {
"flagging_global": 0.6,
"policy-evasion": 0.9,
"indirect-prompt-injection": 0.4
}
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"role": "user",
"content": "Hello world!"
}
],
"meta": {
"confidence_threshold": {
"flagging_global": 0.6,
"policy-evasion": 0.9,
"indirect-prompt-injection": 0.4
}
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"role": "user",
"content": "Hello world!"
}
],
"meta": {
"confidence_threshold": {
"flagging_global": 0.6,
"policy-evasion": 0.9,
"indirect-prompt-injection": 0.4
}
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"role": "user",
"content": "Hello world!"
}
],
"meta": {
"confidence_threshold": {
"flagging_global": 0.6,
"policy-evasion": 0.9,
"indirect-prompt-injection": 0.4
}
}
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/ai-guard/evaluate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "evaluations",
"attributes": {
"messages": [
{
"role": "user",
"content": "Hello world!"
}
],
"meta": {
"confidence_threshold": {
"flagging_global": 0.6,
"policy-evasion": 0.9,
"indirect-prompt-injection": 0.4
}
}
}
}
}
EOF