API reference · Guard
Check a prompt before model execution
Checks a prompt (plus optional context and attachments) against the AI system's guardrails before you call the model. The verdict tells you whether to continue and, when masking is enabled, returns the protected text to send instead of the original.
https://app.getagentid.com/api/v1/guardallowed: truewithtransformed_input: sendtransformed_input(andtransformed_attachments) to the model, never the original.allowed: false: do not call the model;reasonsays why.bypassed: true: AgentID could not complete the check and the system is fail-open.
Masked values are replaced with typed placeholders such as <PERSON_NAME_1> or
<EMAIL_1>. When Restore masked values for the end user is enabled for the
system, an allowed response also carries client_placeholder_mapping so your
application can restore the originals in its own response to the user.
Limits: request body 4 MiB, input and prompt_context 64,000 characters each,
at most 4 attachments.
Native attachment delivery. When GET /api/v1/agent/config advertises
attachment_delivery.native, send attachment_delivery: {version: 1, native: true}.
The response then carries attachment_results with one decision per file: the
original when nothing needed masking, the file masked in its own format (DOCX, XLSX,
PPTX, Markdown, TXT, CSV, JSON, HTML) after a verification that no original value is
left, masked Markdown for images and PDFs with findings, or the failure mode for files
that cannot be checked. Shadow mode never changes what is sent.
Authentication
Send one of these headers (either is accepted):
x-agentid-api-key: <API key>AgentID API key of the AI system, for example
x-agentid-api-key: sk_live_....Authorization: Bearer <API key>The same API key passed as
Authorization: Bearer sk_live_....
Request body
application/jsonrequiredGuardRequest
system_idstring<uuid>requiredThe AI system the API key belongs to.
inputstringrequiredThe text to check and mask, usually the latest user message.
max length 64000
prompt_contextstringOptional surrounding context (for example earlier turns). It helps detection and prompt-injection analysis but is not returned in a transformed form.
max length 64000
modelstringmin length 1 · max length 256
user_idstringYour identifier of the end user, shown in the Activity log.
min length 1 · max length 128
client_event_idstring<uuid>Correlation id for this model call. Reuse it on
/ingest.expected_languagesarray<string>Language hints such as
enorcs.originstringdefaultuser_inputUse
tool_outputwhen the text comes from a tool result rather than the user.One of:
user_input,tool_outputpii_detection_modestringdefaultfullminimalrequests a fast rule-based retry after a slow or failedfullcall. It is honoured only as one retry of afullattempt for the same system that started within the last 60 seconds and is named inmetadata.minimal_retry_of_client_event_id; otherwise the request runs asfull.One of:
full,minimalattachmentsarray<object>›Show item attributes
filenamestringrequiredmin length 1 · max length 255
mime_typestringmax length 255
mimeTypestringAlias of
mime_type.max length 255
content_base64stringFile bytes, base64-encoded.
max length 6000000
contentBase64stringAlias of
content_base64.max length 6000000
textstringExtracted text of the attachment.
max length 500000
unreadable_reasonstringThe client could not read the file; the system's failure mode applies.
pattern ^[a-z0-9_]{1,80}$
idstringYour correlation id for this file, echoed in
attachment_results[].id.max length 128
sha256stringSHA-256 of the file bytes (lowercase hex), recorded in the audit.
max length 128
attachment_deliveryobject›Show child attributes
versionintegerrequiredValue:
1nativebooleanrequiredAsk for per-file delivery decisions and masked files in their own format.
max_inline_bytesintegerMasked files above this size are returned as a short-lived signed URL.
min 0 · max 3000000
acceptsarray<string>Deliveries your client can attach, from the
attachment_delivery.acceptsthe system configuration advertises.macro_free_office: a masked DOCM, XLSM or PPTM comes back without its macros as DOCX, XLSX or PPTX (seedelivered_extension).redacted_images: images and scanned PDFs come back in their own format with each value covered by its placeholder label (seepainted_tokens). Without them these files arrive as masked text.
token_continuityobjectKeeps one token per person or value across the turns of a conversation. Send
{"v": 1}on the first turn, then thetoken_continuityobject the previous response returned, unchanged. Send it only when/api/v1/agent/configadvertisestoken_continuity. A changed or foreign state is ignored and numbering starts over.›Show child attributes
vintegerValue:
1
Additional properties are accepted.
metadataobjectFree-form telemetry stored with the Guard event.
request_identityobjectOptional client-side identity hints stored with the event for audit.
›Show child attributes
ip_addressstringuser_agentstringgeostringCountry or region hint.
session_idstring
Additional properties are accepted.
client_capabilitiesobjectOptional description of the calling client. Official SDKs fill it automatically.
›Show child attributes
frameworkstringpii_masking_enabledbooleanWhether the client masks personal data locally before calling Guard.
secret_masking_enabledbooleanWhether the client masks secrets locally before calling Guard.
has_feedback_handlerbooleansdk_versionstring
Additional properties are accepted.
Example request
curl -X POST "https://app.getagentid.com/api/v1/guard" \
-H "x-agentid-api-key: $AGENTID_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"system_id": "00000000-0000-0000-0000-000000000000",
"input": "Write a reply to Jana Novakova (jana.novakova@example.com) about her refund.",
"model": "gpt-4o-mini",
"user_id": "user-123",
"client_event_id": "0467f78f-5821-4827-a09b-d59a9b08866c",
"expected_languages": [
"en"
]
}'const response = await fetch("https://app.getagentid.com/api/v1/guard", {
method: "POST",
headers: {
"x-agentid-api-key": process.env.AGENTID_API_KEY!,
"Content-Type": "application/json",
},
body: JSON.stringify({
"system_id": "00000000-0000-0000-0000-000000000000",
"input": "Write a reply to Jana Novakova (jana.novakova@example.com) about her refund.",
"model": "gpt-4o-mini",
"user_id": "user-123",
"client_event_id": "0467f78f-5821-4827-a09b-d59a9b08866c",
"expected_languages": [
"en"
]
}),
});
if (!response.ok) throw new Error(`AgentID request failed: ${response.status}`);
const data = await response.json();import os
import requests
response = requests.post(
"https://app.getagentid.com/api/v1/guard",
headers={"x-agentid-api-key": os.environ["AGENTID_API_KEY"]},
json={
"system_id": "00000000-0000-0000-0000-000000000000",
"input": "Write a reply to Jana Novakova (jana.novakova@example.com) about her refund.",
"model": "gpt-4o-mini",
"user_id": "user-123",
"client_event_id": "0467f78f-5821-4827-a09b-d59a9b08866c",
"expected_languages": [
"en",
],
},
timeout=10,
)
response.raise_for_status()
data = response.json()Responses
200Check completed. Read `allowed`: a `200` can also carry `allowed: false`, for
Headers
X-AgentID-StatusstringBYPASSED_INFRA_ERRORwhen a fail-open system skipped the check because a dependency failed.Value:
BYPASSED_INFRA_ERROR
›Response schemaGuardResponse
allowedbooleanrequiredWhether you may call the model.
reasonstringWhy the request was blocked or bypassed. Common values:
unauthorized,system_id_mismatch,invalid_payload,payload_too_large,prompt_injection_blocked,tool_output_prompt_injection_blocked,pii_blocked,secret_blocked,toxicity_blocked,attachment_requires_secure_preprocessing,system_suspended,rate_limited,rate_limited_burst,daily_limit,hourly_token_limit,daily_token_limit,pii_detection_unavailable,semantic_authority_unavailable,circuit_breaker,system_failure,system_failure_db_unavailable. Content-policy blocks use a readable message such asPolicy violation: Term blocked by admin.Legacy reasons that can still be returned:database_access_blocked,code_execution_blocked.detected_piibooleanWhether personal data or secrets were detected in the input or attachments.
checkedbooleanbypassedbooleanTrue when the check was skipped because of a dependency failure in a fail-open system.
transformed_inputstringThe text to send to the model. Equal to
inputwhen nothing was masked.input_char_countintegerLength of the received
input, so you can confirm nothing was cut.min 0
transformed_input_completebooleanTrue when
transformed_inputcovers the wholeinput.transformed_attachmentsarray<object>›Show item attributes
filenamestringrequiredtransformed_textstringrequiredmime_typestringsourcestringOne of:
inline_text,base64_fileextraction_errorstring | nullrequires_ocrbooleanocr_usedboolean
Additional properties are accepted.
attachment_resultsarray<object>Present when the request sent
attachment_delivery.›Show item attributes
indexintegerrequiredPosition of the file in
attachments.filenamestringrequiredName to use; masked placeholders use the bracket form, e.g.
Contract [PERSON_NAME_1].docx.deliverystringrequiredOne of:
original,masked_native,masked_text,blocked,unscanneddelivery_reasonstringrequiredFor example
no_findings,findings_masked,unreadable_fail_open,unreadable_fail_close,native_verification_failed,not_editable_segment,embedded_media_findings,unsupported_parts,shadow_mode,macros_removed,embedded_objects_removed,image_redacted,image_redaction_failed,image_redaction_unavailable,text_layer_present,sheet_name_invalid.idstring | nullkindstringDetected format, e.g.
docx,xlsx,pptx,markdown,pdf,image.filename_maskedbooleandelivered_extensionstringExtension of the masked file when it differs from the original, e.g.
docxfor a DOCM delivered without macros. Use it in the filename you attach.painted_tokensarray<string>Placeholders drawn into a redacted image or scan. Pixels cannot be renamed: if your client renumbers placeholders across a conversation and any of these would change, attach
masked_text(always present with them) instead.masked_textobject›Show child attributes
formatstringOne of:
markdown,textfilenamestringtextstring
masked_fileobject›Show child attributes
encodingstringOne of:
base64,signed_urlcontent_base64stringurlstringexpires_atstring<date-time>sha256stringbyte_lengthintegermime_typestring
detectionsobjectCounts by type, in the filename, and the types excluded from masking.
coveragestringOne of:
full,partial,noneverificationobject›Show child attributes
statusstringOne of:
passed,failed,skippedresidual_countinteger
Additional properties are accepted.
client_deanonymization_enabledbooleanWhether this allowed response permits restoring placeholders for the end user.
client_substitute_stylestringAlways
tokens(typed placeholders).Value:
tokensclient_placeholder_mappingmap<string, string>Placeholder-to-original mapping, present only on allowed responses when restoration is enabled. Keep it in memory for this request; never send it to the model provider or into logs.
token_continuityobjectSigned conversation state, returned when the request sent
token_continuity. It holds keyed hashes and tokens only, never a value. Store it per conversation and send it with the next request of that conversation.guard_event_idstring<uuid>client_event_idstring<uuid>guard_latency_msintegermin 0
shadow_modebooleanTrue when the system runs in Shadow Mode; nothing is blocked or masked.
simulated_decisionstringIn Shadow Mode, what Active Guard would have done.
One of:
allowed,masked,blockedshadow_blockedbooleanpolicy_pack_matcher_backendstringOne of:
rust_wasm,js_hybrid,legacy_fallbackpolicy_pack_scan_profilestringOne of:
expected_languages,auto_detected,global_high_priority,core_en_fallbackpolicy_pack_scan_modestringOne of:
full,segmentedexotic_language_detectedbooleanlangid_primarystringlangid_confidencestringOne of:
high,medium,lowlangid_secondaryarray<string>langid_mixedbooleanlangid_sourcestringOne of:
input_detection,input_detection_with_hintguard_metadataobjectDiagnostic summary of the decision. Its fields may change.
transparencyobjectPresent when transparency metadata injection is enabled for the system.
›Show child attributes
is_ai_generatedbooleanValue:
truedisclosurestringarticlestringinjection_modestring
Additional properties are accepted.
{
"allowed": true,
"detected_pii": false,
"transformed_input": "What is the capital of the Czech Republic?",
"input_char_count": 42,
"transformed_input_complete": true,
"client_deanonymization_enabled": false,
"guard_event_id": "7a7394af-77a9-4d32-a714-ad7af7ab86f3",
"client_event_id": "0467f78f-5821-4827-a09b-d59a9b08866c",
"guard_latency_ms": 118
}{
"allowed": true,
"detected_pii": true,
"transformed_input": "Write a reply to <PERSON_NAME_1> (<EMAIL_1>) about her refund.",
"input_char_count": 77,
"transformed_input_complete": true,
"client_deanonymization_enabled": true,
"client_substitute_style": "tokens",
"client_placeholder_mapping": {
"<PERSON_NAME_1>": "Jana Novakova",
"<EMAIL_1>": "jana.novakova@example.com"
},
"guard_event_id": "9c1d1b8e-3f5a-4c8e-9a51-0f4f2e5c7d10",
"client_event_id": "0467f78f-5821-4827-a09b-d59a9b08866c",
"guard_latency_ms": 840
}{
"allowed": true,
"bypassed": true,
"reason": "system_failure_db_unavailable"
}{
"allowed": false,
"reason": "pii_detection_unavailable"
}400Invalid JSON or a field outside the request schema.
›Response schemaGuardResponse
allowedbooleanrequiredWhether you may call the model.
reasonstringWhy the request was blocked or bypassed. Common values:
unauthorized,system_id_mismatch,invalid_payload,payload_too_large,prompt_injection_blocked,tool_output_prompt_injection_blocked,pii_blocked,secret_blocked,toxicity_blocked,attachment_requires_secure_preprocessing,system_suspended,rate_limited,rate_limited_burst,daily_limit,hourly_token_limit,daily_token_limit,pii_detection_unavailable,semantic_authority_unavailable,circuit_breaker,system_failure,system_failure_db_unavailable. Content-policy blocks use a readable message such asPolicy violation: Term blocked by admin.Legacy reasons that can still be returned:database_access_blocked,code_execution_blocked.detected_piibooleanWhether personal data or secrets were detected in the input or attachments.
checkedbooleanbypassedbooleanTrue when the check was skipped because of a dependency failure in a fail-open system.
transformed_inputstringThe text to send to the model. Equal to
inputwhen nothing was masked.input_char_countintegerLength of the received
input, so you can confirm nothing was cut.min 0
transformed_input_completebooleanTrue when
transformed_inputcovers the wholeinput.transformed_attachmentsarray<object>›Show item attributes
filenamestringrequiredtransformed_textstringrequiredmime_typestringsourcestringOne of:
inline_text,base64_fileextraction_errorstring | nullrequires_ocrbooleanocr_usedboolean
Additional properties are accepted.
attachment_resultsarray<object>Present when the request sent
attachment_delivery.›Show item attributes
indexintegerrequiredPosition of the file in
attachments.filenamestringrequiredName to use; masked placeholders use the bracket form, e.g.
Contract [PERSON_NAME_1].docx.deliverystringrequiredOne of:
original,masked_native,masked_text,blocked,unscanneddelivery_reasonstringrequiredFor example
no_findings,findings_masked,unreadable_fail_open,unreadable_fail_close,native_verification_failed,not_editable_segment,embedded_media_findings,unsupported_parts,shadow_mode,macros_removed,embedded_objects_removed,image_redacted,image_redaction_failed,image_redaction_unavailable,text_layer_present,sheet_name_invalid.idstring | nullkindstringDetected format, e.g.
docx,xlsx,pptx,markdown,pdf,image.filename_maskedbooleandelivered_extensionstringExtension of the masked file when it differs from the original, e.g.
docxfor a DOCM delivered without macros. Use it in the filename you attach.painted_tokensarray<string>Placeholders drawn into a redacted image or scan. Pixels cannot be renamed: if your client renumbers placeholders across a conversation and any of these would change, attach
masked_text(always present with them) instead.masked_textobject›Show child attributes
formatstringOne of:
markdown,textfilenamestringtextstring
masked_fileobject›Show child attributes
encodingstringOne of:
base64,signed_urlcontent_base64stringurlstringexpires_atstring<date-time>sha256stringbyte_lengthintegermime_typestring
detectionsobjectCounts by type, in the filename, and the types excluded from masking.
coveragestringOne of:
full,partial,noneverificationobject›Show child attributes
statusstringOne of:
passed,failed,skippedresidual_countinteger
Additional properties are accepted.
client_deanonymization_enabledbooleanWhether this allowed response permits restoring placeholders for the end user.
client_substitute_stylestringAlways
tokens(typed placeholders).Value:
tokensclient_placeholder_mappingmap<string, string>Placeholder-to-original mapping, present only on allowed responses when restoration is enabled. Keep it in memory for this request; never send it to the model provider or into logs.
token_continuityobjectSigned conversation state, returned when the request sent
token_continuity. It holds keyed hashes and tokens only, never a value. Store it per conversation and send it with the next request of that conversation.guard_event_idstring<uuid>client_event_idstring<uuid>guard_latency_msintegermin 0
shadow_modebooleanTrue when the system runs in Shadow Mode; nothing is blocked or masked.
simulated_decisionstringIn Shadow Mode, what Active Guard would have done.
One of:
allowed,masked,blockedshadow_blockedbooleanpolicy_pack_matcher_backendstringOne of:
rust_wasm,js_hybrid,legacy_fallbackpolicy_pack_scan_profilestringOne of:
expected_languages,auto_detected,global_high_priority,core_en_fallbackpolicy_pack_scan_modestringOne of:
full,segmentedexotic_language_detectedbooleanlangid_primarystringlangid_confidencestringOne of:
high,medium,lowlangid_secondaryarray<string>langid_mixedbooleanlangid_sourcestringOne of:
input_detection,input_detection_with_hintguard_metadataobjectDiagnostic summary of the decision. Its fields may change.
transparencyobjectPresent when transparency metadata injection is enabled for the system.
›Show child attributes
is_ai_generatedbooleanValue:
truedisclosurestringarticlestringinjection_modestring
Additional properties are accepted.
{
"allowed": false,
"reason": "invalid_payload"
}401Missing, invalid or revoked API key, or `system_id` does not match the key.
›Response schemaGuardResponse
allowedbooleanrequiredWhether you may call the model.
reasonstringWhy the request was blocked or bypassed. Common values:
unauthorized,system_id_mismatch,invalid_payload,payload_too_large,prompt_injection_blocked,tool_output_prompt_injection_blocked,pii_blocked,secret_blocked,toxicity_blocked,attachment_requires_secure_preprocessing,system_suspended,rate_limited,rate_limited_burst,daily_limit,hourly_token_limit,daily_token_limit,pii_detection_unavailable,semantic_authority_unavailable,circuit_breaker,system_failure,system_failure_db_unavailable. Content-policy blocks use a readable message such asPolicy violation: Term blocked by admin.Legacy reasons that can still be returned:database_access_blocked,code_execution_blocked.detected_piibooleanWhether personal data or secrets were detected in the input or attachments.
checkedbooleanbypassedbooleanTrue when the check was skipped because of a dependency failure in a fail-open system.
transformed_inputstringThe text to send to the model. Equal to
inputwhen nothing was masked.input_char_countintegerLength of the received
input, so you can confirm nothing was cut.min 0
transformed_input_completebooleanTrue when
transformed_inputcovers the wholeinput.transformed_attachmentsarray<object>›Show item attributes
filenamestringrequiredtransformed_textstringrequiredmime_typestringsourcestringOne of:
inline_text,base64_fileextraction_errorstring | nullrequires_ocrbooleanocr_usedboolean
Additional properties are accepted.
attachment_resultsarray<object>Present when the request sent
attachment_delivery.›Show item attributes
indexintegerrequiredPosition of the file in
attachments.filenamestringrequiredName to use; masked placeholders use the bracket form, e.g.
Contract [PERSON_NAME_1].docx.deliverystringrequiredOne of:
original,masked_native,masked_text,blocked,unscanneddelivery_reasonstringrequiredFor example
no_findings,findings_masked,unreadable_fail_open,unreadable_fail_close,native_verification_failed,not_editable_segment,embedded_media_findings,unsupported_parts,shadow_mode,macros_removed,embedded_objects_removed,image_redacted,image_redaction_failed,image_redaction_unavailable,text_layer_present,sheet_name_invalid.idstring | nullkindstringDetected format, e.g.
docx,xlsx,pptx,markdown,pdf,image.filename_maskedbooleandelivered_extensionstringExtension of the masked file when it differs from the original, e.g.
docxfor a DOCM delivered without macros. Use it in the filename you attach.painted_tokensarray<string>Placeholders drawn into a redacted image or scan. Pixels cannot be renamed: if your client renumbers placeholders across a conversation and any of these would change, attach
masked_text(always present with them) instead.masked_textobject›Show child attributes
formatstringOne of:
markdown,textfilenamestringtextstring
masked_fileobject›Show child attributes
encodingstringOne of:
base64,signed_urlcontent_base64stringurlstringexpires_atstring<date-time>sha256stringbyte_lengthintegermime_typestring
detectionsobjectCounts by type, in the filename, and the types excluded from masking.
coveragestringOne of:
full,partial,noneverificationobject›Show child attributes
statusstringOne of:
passed,failed,skippedresidual_countinteger
Additional properties are accepted.
client_deanonymization_enabledbooleanWhether this allowed response permits restoring placeholders for the end user.
client_substitute_stylestringAlways
tokens(typed placeholders).Value:
tokensclient_placeholder_mappingmap<string, string>Placeholder-to-original mapping, present only on allowed responses when restoration is enabled. Keep it in memory for this request; never send it to the model provider or into logs.
token_continuityobjectSigned conversation state, returned when the request sent
token_continuity. It holds keyed hashes and tokens only, never a value. Store it per conversation and send it with the next request of that conversation.guard_event_idstring<uuid>client_event_idstring<uuid>guard_latency_msintegermin 0
shadow_modebooleanTrue when the system runs in Shadow Mode; nothing is blocked or masked.
simulated_decisionstringIn Shadow Mode, what Active Guard would have done.
One of:
allowed,masked,blockedshadow_blockedbooleanpolicy_pack_matcher_backendstringOne of:
rust_wasm,js_hybrid,legacy_fallbackpolicy_pack_scan_profilestringOne of:
expected_languages,auto_detected,global_high_priority,core_en_fallbackpolicy_pack_scan_modestringOne of:
full,segmentedexotic_language_detectedbooleanlangid_primarystringlangid_confidencestringOne of:
high,medium,lowlangid_secondaryarray<string>langid_mixedbooleanlangid_sourcestringOne of:
input_detection,input_detection_with_hintguard_metadataobjectDiagnostic summary of the decision. Its fields may change.
transparencyobjectPresent when transparency metadata injection is enabled for the system.
›Show child attributes
is_ai_generatedbooleanValue:
truedisclosurestringarticlestringinjection_modestring
Additional properties are accepted.
{
"allowed": false,
"reason": "unauthorized"
}{
"allowed": false,
"reason": "system_id_mismatch"
}403Blocked by a guardrail, a content policy or the kill switch.
›Response schemaGuardResponse
allowedbooleanrequiredWhether you may call the model.
reasonstringWhy the request was blocked or bypassed. Common values:
unauthorized,system_id_mismatch,invalid_payload,payload_too_large,prompt_injection_blocked,tool_output_prompt_injection_blocked,pii_blocked,secret_blocked,toxicity_blocked,attachment_requires_secure_preprocessing,system_suspended,rate_limited,rate_limited_burst,daily_limit,hourly_token_limit,daily_token_limit,pii_detection_unavailable,semantic_authority_unavailable,circuit_breaker,system_failure,system_failure_db_unavailable. Content-policy blocks use a readable message such asPolicy violation: Term blocked by admin.Legacy reasons that can still be returned:database_access_blocked,code_execution_blocked.detected_piibooleanWhether personal data or secrets were detected in the input or attachments.
checkedbooleanbypassedbooleanTrue when the check was skipped because of a dependency failure in a fail-open system.
transformed_inputstringThe text to send to the model. Equal to
inputwhen nothing was masked.input_char_countintegerLength of the received
input, so you can confirm nothing was cut.min 0
transformed_input_completebooleanTrue when
transformed_inputcovers the wholeinput.transformed_attachmentsarray<object>›Show item attributes
filenamestringrequiredtransformed_textstringrequiredmime_typestringsourcestringOne of:
inline_text,base64_fileextraction_errorstring | nullrequires_ocrbooleanocr_usedboolean
Additional properties are accepted.
attachment_resultsarray<object>Present when the request sent
attachment_delivery.›Show item attributes
indexintegerrequiredPosition of the file in
attachments.filenamestringrequiredName to use; masked placeholders use the bracket form, e.g.
Contract [PERSON_NAME_1].docx.deliverystringrequiredOne of:
original,masked_native,masked_text,blocked,unscanneddelivery_reasonstringrequiredFor example
no_findings,findings_masked,unreadable_fail_open,unreadable_fail_close,native_verification_failed,not_editable_segment,embedded_media_findings,unsupported_parts,shadow_mode,macros_removed,embedded_objects_removed,image_redacted,image_redaction_failed,image_redaction_unavailable,text_layer_present,sheet_name_invalid.idstring | nullkindstringDetected format, e.g.
docx,xlsx,pptx,markdown,pdf,image.filename_maskedbooleandelivered_extensionstringExtension of the masked file when it differs from the original, e.g.
docxfor a DOCM delivered without macros. Use it in the filename you attach.painted_tokensarray<string>Placeholders drawn into a redacted image or scan. Pixels cannot be renamed: if your client renumbers placeholders across a conversation and any of these would change, attach
masked_text(always present with them) instead.masked_textobject›Show child attributes
formatstringOne of:
markdown,textfilenamestringtextstring
masked_fileobject›Show child attributes
encodingstringOne of:
base64,signed_urlcontent_base64stringurlstringexpires_atstring<date-time>sha256stringbyte_lengthintegermime_typestring
detectionsobjectCounts by type, in the filename, and the types excluded from masking.
coveragestringOne of:
full,partial,noneverificationobject›Show child attributes
statusstringOne of:
passed,failed,skippedresidual_countinteger
Additional properties are accepted.
client_deanonymization_enabledbooleanWhether this allowed response permits restoring placeholders for the end user.
client_substitute_stylestringAlways
tokens(typed placeholders).Value:
tokensclient_placeholder_mappingmap<string, string>Placeholder-to-original mapping, present only on allowed responses when restoration is enabled. Keep it in memory for this request; never send it to the model provider or into logs.
token_continuityobjectSigned conversation state, returned when the request sent
token_continuity. It holds keyed hashes and tokens only, never a value. Store it per conversation and send it with the next request of that conversation.guard_event_idstring<uuid>client_event_idstring<uuid>guard_latency_msintegermin 0
shadow_modebooleanTrue when the system runs in Shadow Mode; nothing is blocked or masked.
simulated_decisionstringIn Shadow Mode, what Active Guard would have done.
One of:
allowed,masked,blockedshadow_blockedbooleanpolicy_pack_matcher_backendstringOne of:
rust_wasm,js_hybrid,legacy_fallbackpolicy_pack_scan_profilestringOne of:
expected_languages,auto_detected,global_high_priority,core_en_fallbackpolicy_pack_scan_modestringOne of:
full,segmentedexotic_language_detectedbooleanlangid_primarystringlangid_confidencestringOne of:
high,medium,lowlangid_secondaryarray<string>langid_mixedbooleanlangid_sourcestringOne of:
input_detection,input_detection_with_hintguard_metadataobjectDiagnostic summary of the decision. Its fields may change.
transparencyobjectPresent when transparency metadata injection is enabled for the system.
›Show child attributes
is_ai_generatedbooleanValue:
truedisclosurestringarticlestringinjection_modestring
Additional properties are accepted.
{
"allowed": false,
"reason": "prompt_injection_blocked"
}{
"allowed": false,
"reason": "pii_blocked"
}{
"allowed": false,
"reason": "system_suspended"
}413Request body exceeds 4 MiB.
›Response schemaGuardResponse
allowedbooleanrequiredWhether you may call the model.
reasonstringWhy the request was blocked or bypassed. Common values:
unauthorized,system_id_mismatch,invalid_payload,payload_too_large,prompt_injection_blocked,tool_output_prompt_injection_blocked,pii_blocked,secret_blocked,toxicity_blocked,attachment_requires_secure_preprocessing,system_suspended,rate_limited,rate_limited_burst,daily_limit,hourly_token_limit,daily_token_limit,pii_detection_unavailable,semantic_authority_unavailable,circuit_breaker,system_failure,system_failure_db_unavailable. Content-policy blocks use a readable message such asPolicy violation: Term blocked by admin.Legacy reasons that can still be returned:database_access_blocked,code_execution_blocked.detected_piibooleanWhether personal data or secrets were detected in the input or attachments.
checkedbooleanbypassedbooleanTrue when the check was skipped because of a dependency failure in a fail-open system.
transformed_inputstringThe text to send to the model. Equal to
inputwhen nothing was masked.input_char_countintegerLength of the received
input, so you can confirm nothing was cut.min 0
transformed_input_completebooleanTrue when
transformed_inputcovers the wholeinput.transformed_attachmentsarray<object>›Show item attributes
filenamestringrequiredtransformed_textstringrequiredmime_typestringsourcestringOne of:
inline_text,base64_fileextraction_errorstring | nullrequires_ocrbooleanocr_usedboolean
Additional properties are accepted.
attachment_resultsarray<object>Present when the request sent
attachment_delivery.›Show item attributes
indexintegerrequiredPosition of the file in
attachments.filenamestringrequiredName to use; masked placeholders use the bracket form, e.g.
Contract [PERSON_NAME_1].docx.deliverystringrequiredOne of:
original,masked_native,masked_text,blocked,unscanneddelivery_reasonstringrequiredFor example
no_findings,findings_masked,unreadable_fail_open,unreadable_fail_close,native_verification_failed,not_editable_segment,embedded_media_findings,unsupported_parts,shadow_mode,macros_removed,embedded_objects_removed,image_redacted,image_redaction_failed,image_redaction_unavailable,text_layer_present,sheet_name_invalid.idstring | nullkindstringDetected format, e.g.
docx,xlsx,pptx,markdown,pdf,image.filename_maskedbooleandelivered_extensionstringExtension of the masked file when it differs from the original, e.g.
docxfor a DOCM delivered without macros. Use it in the filename you attach.painted_tokensarray<string>Placeholders drawn into a redacted image or scan. Pixels cannot be renamed: if your client renumbers placeholders across a conversation and any of these would change, attach
masked_text(always present with them) instead.masked_textobject›Show child attributes
formatstringOne of:
markdown,textfilenamestringtextstring
masked_fileobject›Show child attributes
encodingstringOne of:
base64,signed_urlcontent_base64stringurlstringexpires_atstring<date-time>sha256stringbyte_lengthintegermime_typestring
detectionsobjectCounts by type, in the filename, and the types excluded from masking.
coveragestringOne of:
full,partial,noneverificationobject›Show child attributes
statusstringOne of:
passed,failed,skippedresidual_countinteger
Additional properties are accepted.
client_deanonymization_enabledbooleanWhether this allowed response permits restoring placeholders for the end user.
client_substitute_stylestringAlways
tokens(typed placeholders).Value:
tokensclient_placeholder_mappingmap<string, string>Placeholder-to-original mapping, present only on allowed responses when restoration is enabled. Keep it in memory for this request; never send it to the model provider or into logs.
token_continuityobjectSigned conversation state, returned when the request sent
token_continuity. It holds keyed hashes and tokens only, never a value. Store it per conversation and send it with the next request of that conversation.guard_event_idstring<uuid>client_event_idstring<uuid>guard_latency_msintegermin 0
shadow_modebooleanTrue when the system runs in Shadow Mode; nothing is blocked or masked.
simulated_decisionstringIn Shadow Mode, what Active Guard would have done.
One of:
allowed,masked,blockedshadow_blockedbooleanpolicy_pack_matcher_backendstringOne of:
rust_wasm,js_hybrid,legacy_fallbackpolicy_pack_scan_profilestringOne of:
expected_languages,auto_detected,global_high_priority,core_en_fallbackpolicy_pack_scan_modestringOne of:
full,segmentedexotic_language_detectedbooleanlangid_primarystringlangid_confidencestringOne of:
high,medium,lowlangid_secondaryarray<string>langid_mixedbooleanlangid_sourcestringOne of:
input_detection,input_detection_with_hintguard_metadataobjectDiagnostic summary of the decision. Its fields may change.
transparencyobjectPresent when transparency metadata injection is enabled for the system.
›Show child attributes
is_ai_generatedbooleanValue:
truedisclosurestringarticlestringinjection_modestring
Additional properties are accepted.
{
"allowed": false,
"reason": "payload_too_large"
}429Rate limit or quota exceeded.
Headers
Retry-AfterintegerSeconds to wait before retrying.
min 1
X-RateLimit-LimitintegerMaximum requests allowed in the current window.
X-RateLimit-RemainingintegerRequests remaining in the current window.
›Response schemaGuardResponse
allowedbooleanrequiredWhether you may call the model.
reasonstringWhy the request was blocked or bypassed. Common values:
unauthorized,system_id_mismatch,invalid_payload,payload_too_large,prompt_injection_blocked,tool_output_prompt_injection_blocked,pii_blocked,secret_blocked,toxicity_blocked,attachment_requires_secure_preprocessing,system_suspended,rate_limited,rate_limited_burst,daily_limit,hourly_token_limit,daily_token_limit,pii_detection_unavailable,semantic_authority_unavailable,circuit_breaker,system_failure,system_failure_db_unavailable. Content-policy blocks use a readable message such asPolicy violation: Term blocked by admin.Legacy reasons that can still be returned:database_access_blocked,code_execution_blocked.detected_piibooleanWhether personal data or secrets were detected in the input or attachments.
checkedbooleanbypassedbooleanTrue when the check was skipped because of a dependency failure in a fail-open system.
transformed_inputstringThe text to send to the model. Equal to
inputwhen nothing was masked.input_char_countintegerLength of the received
input, so you can confirm nothing was cut.min 0
transformed_input_completebooleanTrue when
transformed_inputcovers the wholeinput.transformed_attachmentsarray<object>›Show item attributes
filenamestringrequiredtransformed_textstringrequiredmime_typestringsourcestringOne of:
inline_text,base64_fileextraction_errorstring | nullrequires_ocrbooleanocr_usedboolean
Additional properties are accepted.
attachment_resultsarray<object>Present when the request sent
attachment_delivery.›Show item attributes
indexintegerrequiredPosition of the file in
attachments.filenamestringrequiredName to use; masked placeholders use the bracket form, e.g.
Contract [PERSON_NAME_1].docx.deliverystringrequiredOne of:
original,masked_native,masked_text,blocked,unscanneddelivery_reasonstringrequiredFor example
no_findings,findings_masked,unreadable_fail_open,unreadable_fail_close,native_verification_failed,not_editable_segment,embedded_media_findings,unsupported_parts,shadow_mode,macros_removed,embedded_objects_removed,image_redacted,image_redaction_failed,image_redaction_unavailable,text_layer_present,sheet_name_invalid.idstring | nullkindstringDetected format, e.g.
docx,xlsx,pptx,markdown,pdf,image.filename_maskedbooleandelivered_extensionstringExtension of the masked file when it differs from the original, e.g.
docxfor a DOCM delivered without macros. Use it in the filename you attach.painted_tokensarray<string>Placeholders drawn into a redacted image or scan. Pixels cannot be renamed: if your client renumbers placeholders across a conversation and any of these would change, attach
masked_text(always present with them) instead.masked_textobject›Show child attributes
formatstringOne of:
markdown,textfilenamestringtextstring
masked_fileobject›Show child attributes
encodingstringOne of:
base64,signed_urlcontent_base64stringurlstringexpires_atstring<date-time>sha256stringbyte_lengthintegermime_typestring
detectionsobjectCounts by type, in the filename, and the types excluded from masking.
coveragestringOne of:
full,partial,noneverificationobject›Show child attributes
statusstringOne of:
passed,failed,skippedresidual_countinteger
Additional properties are accepted.
client_deanonymization_enabledbooleanWhether this allowed response permits restoring placeholders for the end user.
client_substitute_stylestringAlways
tokens(typed placeholders).Value:
tokensclient_placeholder_mappingmap<string, string>Placeholder-to-original mapping, present only on allowed responses when restoration is enabled. Keep it in memory for this request; never send it to the model provider or into logs.
token_continuityobjectSigned conversation state, returned when the request sent
token_continuity. It holds keyed hashes and tokens only, never a value. Store it per conversation and send it with the next request of that conversation.guard_event_idstring<uuid>client_event_idstring<uuid>guard_latency_msintegermin 0
shadow_modebooleanTrue when the system runs in Shadow Mode; nothing is blocked or masked.
simulated_decisionstringIn Shadow Mode, what Active Guard would have done.
One of:
allowed,masked,blockedshadow_blockedbooleanpolicy_pack_matcher_backendstringOne of:
rust_wasm,js_hybrid,legacy_fallbackpolicy_pack_scan_profilestringOne of:
expected_languages,auto_detected,global_high_priority,core_en_fallbackpolicy_pack_scan_modestringOne of:
full,segmentedexotic_language_detectedbooleanlangid_primarystringlangid_confidencestringOne of:
high,medium,lowlangid_secondaryarray<string>langid_mixedbooleanlangid_sourcestringOne of:
input_detection,input_detection_with_hintguard_metadataobjectDiagnostic summary of the decision. Its fields may change.
transparencyobjectPresent when transparency metadata injection is enabled for the system.
›Show child attributes
is_ai_generatedbooleanValue:
truedisclosurestringarticlestringinjection_modestring
Additional properties are accepted.
{
"allowed": false,
"reason": "rate_limited"
}{
"allowed": false,
"reason": "daily_token_limit"
}500Internal processing failure.
›Response schemaGuardResponse
allowedbooleanrequiredWhether you may call the model.
reasonstringWhy the request was blocked or bypassed. Common values:
unauthorized,system_id_mismatch,invalid_payload,payload_too_large,prompt_injection_blocked,tool_output_prompt_injection_blocked,pii_blocked,secret_blocked,toxicity_blocked,attachment_requires_secure_preprocessing,system_suspended,rate_limited,rate_limited_burst,daily_limit,hourly_token_limit,daily_token_limit,pii_detection_unavailable,semantic_authority_unavailable,circuit_breaker,system_failure,system_failure_db_unavailable. Content-policy blocks use a readable message such asPolicy violation: Term blocked by admin.Legacy reasons that can still be returned:database_access_blocked,code_execution_blocked.detected_piibooleanWhether personal data or secrets were detected in the input or attachments.
checkedbooleanbypassedbooleanTrue when the check was skipped because of a dependency failure in a fail-open system.
transformed_inputstringThe text to send to the model. Equal to
inputwhen nothing was masked.input_char_countintegerLength of the received
input, so you can confirm nothing was cut.min 0
transformed_input_completebooleanTrue when
transformed_inputcovers the wholeinput.transformed_attachmentsarray<object>›Show item attributes
filenamestringrequiredtransformed_textstringrequiredmime_typestringsourcestringOne of:
inline_text,base64_fileextraction_errorstring | nullrequires_ocrbooleanocr_usedboolean
Additional properties are accepted.
attachment_resultsarray<object>Present when the request sent
attachment_delivery.›Show item attributes
indexintegerrequiredPosition of the file in
attachments.filenamestringrequiredName to use; masked placeholders use the bracket form, e.g.
Contract [PERSON_NAME_1].docx.deliverystringrequiredOne of:
original,masked_native,masked_text,blocked,unscanneddelivery_reasonstringrequiredFor example
no_findings,findings_masked,unreadable_fail_open,unreadable_fail_close,native_verification_failed,not_editable_segment,embedded_media_findings,unsupported_parts,shadow_mode,macros_removed,embedded_objects_removed,image_redacted,image_redaction_failed,image_redaction_unavailable,text_layer_present,sheet_name_invalid.idstring | nullkindstringDetected format, e.g.
docx,xlsx,pptx,markdown,pdf,image.filename_maskedbooleandelivered_extensionstringExtension of the masked file when it differs from the original, e.g.
docxfor a DOCM delivered without macros. Use it in the filename you attach.painted_tokensarray<string>Placeholders drawn into a redacted image or scan. Pixels cannot be renamed: if your client renumbers placeholders across a conversation and any of these would change, attach
masked_text(always present with them) instead.masked_textobject›Show child attributes
formatstringOne of:
markdown,textfilenamestringtextstring
masked_fileobject›Show child attributes
encodingstringOne of:
base64,signed_urlcontent_base64stringurlstringexpires_atstring<date-time>sha256stringbyte_lengthintegermime_typestring
detectionsobjectCounts by type, in the filename, and the types excluded from masking.
coveragestringOne of:
full,partial,noneverificationobject›Show child attributes
statusstringOne of:
passed,failed,skippedresidual_countinteger
Additional properties are accepted.
client_deanonymization_enabledbooleanWhether this allowed response permits restoring placeholders for the end user.
client_substitute_stylestringAlways
tokens(typed placeholders).Value:
tokensclient_placeholder_mappingmap<string, string>Placeholder-to-original mapping, present only on allowed responses when restoration is enabled. Keep it in memory for this request; never send it to the model provider or into logs.
token_continuityobjectSigned conversation state, returned when the request sent
token_continuity. It holds keyed hashes and tokens only, never a value. Store it per conversation and send it with the next request of that conversation.guard_event_idstring<uuid>client_event_idstring<uuid>guard_latency_msintegermin 0
shadow_modebooleanTrue when the system runs in Shadow Mode; nothing is blocked or masked.
simulated_decisionstringIn Shadow Mode, what Active Guard would have done.
One of:
allowed,masked,blockedshadow_blockedbooleanpolicy_pack_matcher_backendstringOne of:
rust_wasm,js_hybrid,legacy_fallbackpolicy_pack_scan_profilestringOne of:
expected_languages,auto_detected,global_high_priority,core_en_fallbackpolicy_pack_scan_modestringOne of:
full,segmentedexotic_language_detectedbooleanlangid_primarystringlangid_confidencestringOne of:
high,medium,lowlangid_secondaryarray<string>langid_mixedbooleanlangid_sourcestringOne of:
input_detection,input_detection_with_hintguard_metadataobjectDiagnostic summary of the decision. Its fields may change.
transparencyobjectPresent when transparency metadata injection is enabled for the system.
›Show child attributes
is_ai_generatedbooleanValue:
truedisclosurestringarticlestringinjection_modestring
Additional properties are accepted.
{
"allowed": false,
"reason": "server_error"
}503A dependency failed in a fail-closed system, or the automatic circuit breaker
›Response schemaGuardResponse
allowedbooleanrequiredWhether you may call the model.
reasonstringWhy the request was blocked or bypassed. Common values:
unauthorized,system_id_mismatch,invalid_payload,payload_too_large,prompt_injection_blocked,tool_output_prompt_injection_blocked,pii_blocked,secret_blocked,toxicity_blocked,attachment_requires_secure_preprocessing,system_suspended,rate_limited,rate_limited_burst,daily_limit,hourly_token_limit,daily_token_limit,pii_detection_unavailable,semantic_authority_unavailable,circuit_breaker,system_failure,system_failure_db_unavailable. Content-policy blocks use a readable message such asPolicy violation: Term blocked by admin.Legacy reasons that can still be returned:database_access_blocked,code_execution_blocked.detected_piibooleanWhether personal data or secrets were detected in the input or attachments.
checkedbooleanbypassedbooleanTrue when the check was skipped because of a dependency failure in a fail-open system.
transformed_inputstringThe text to send to the model. Equal to
inputwhen nothing was masked.input_char_countintegerLength of the received
input, so you can confirm nothing was cut.min 0
transformed_input_completebooleanTrue when
transformed_inputcovers the wholeinput.transformed_attachmentsarray<object>›Show item attributes
filenamestringrequiredtransformed_textstringrequiredmime_typestringsourcestringOne of:
inline_text,base64_fileextraction_errorstring | nullrequires_ocrbooleanocr_usedboolean
Additional properties are accepted.
attachment_resultsarray<object>Present when the request sent
attachment_delivery.›Show item attributes
indexintegerrequiredPosition of the file in
attachments.filenamestringrequiredName to use; masked placeholders use the bracket form, e.g.
Contract [PERSON_NAME_1].docx.deliverystringrequiredOne of:
original,masked_native,masked_text,blocked,unscanneddelivery_reasonstringrequiredFor example
no_findings,findings_masked,unreadable_fail_open,unreadable_fail_close,native_verification_failed,not_editable_segment,embedded_media_findings,unsupported_parts,shadow_mode,macros_removed,embedded_objects_removed,image_redacted,image_redaction_failed,image_redaction_unavailable,text_layer_present,sheet_name_invalid.idstring | nullkindstringDetected format, e.g.
docx,xlsx,pptx,markdown,pdf,image.filename_maskedbooleandelivered_extensionstringExtension of the masked file when it differs from the original, e.g.
docxfor a DOCM delivered without macros. Use it in the filename you attach.painted_tokensarray<string>Placeholders drawn into a redacted image or scan. Pixels cannot be renamed: if your client renumbers placeholders across a conversation and any of these would change, attach
masked_text(always present with them) instead.masked_textobject›Show child attributes
formatstringOne of:
markdown,textfilenamestringtextstring
masked_fileobject›Show child attributes
encodingstringOne of:
base64,signed_urlcontent_base64stringurlstringexpires_atstring<date-time>sha256stringbyte_lengthintegermime_typestring
detectionsobjectCounts by type, in the filename, and the types excluded from masking.
coveragestringOne of:
full,partial,noneverificationobject›Show child attributes
statusstringOne of:
passed,failed,skippedresidual_countinteger
Additional properties are accepted.
client_deanonymization_enabledbooleanWhether this allowed response permits restoring placeholders for the end user.
client_substitute_stylestringAlways
tokens(typed placeholders).Value:
tokensclient_placeholder_mappingmap<string, string>Placeholder-to-original mapping, present only on allowed responses when restoration is enabled. Keep it in memory for this request; never send it to the model provider or into logs.
token_continuityobjectSigned conversation state, returned when the request sent
token_continuity. It holds keyed hashes and tokens only, never a value. Store it per conversation and send it with the next request of that conversation.guard_event_idstring<uuid>client_event_idstring<uuid>guard_latency_msintegermin 0
shadow_modebooleanTrue when the system runs in Shadow Mode; nothing is blocked or masked.
simulated_decisionstringIn Shadow Mode, what Active Guard would have done.
One of:
allowed,masked,blockedshadow_blockedbooleanpolicy_pack_matcher_backendstringOne of:
rust_wasm,js_hybrid,legacy_fallbackpolicy_pack_scan_profilestringOne of:
expected_languages,auto_detected,global_high_priority,core_en_fallbackpolicy_pack_scan_modestringOne of:
full,segmentedexotic_language_detectedbooleanlangid_primarystringlangid_confidencestringOne of:
high,medium,lowlangid_secondaryarray<string>langid_mixedbooleanlangid_sourcestringOne of:
input_detection,input_detection_with_hintguard_metadataobjectDiagnostic summary of the decision. Its fields may change.
transparencyobjectPresent when transparency metadata injection is enabled for the system.
›Show child attributes
is_ai_generatedbooleanValue:
truedisclosurestringarticlestringinjection_modestring
Additional properties are accepted.
{
"allowed": false,
"reason": "system_failure"
}{
"allowed": false,
"reason": "circuit_breaker"
}