Skip to content
AgentIDDocs

Type at least two characters to search titles, headings and content.

↑ ↓ to navigate↵ to open
AgentID Docs

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.

POSThttps://app.getagentid.com/api/v1/guard
  • allowed: true with transformed_input: send transformed_input (and transformed_attachments) to the model, never the original.
  • allowed: false: do not call the model; reason says 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>required

The AI system the API key belongs to.

inputstringrequired

The text to check and mask, usually the latest user message.

max length 64000

prompt_contextstring

Optional surrounding context (for example earlier turns). It helps detection and prompt-injection analysis but is not returned in a transformed form.

max length 64000

modelstring

min length 1 · max length 256

user_idstring

Your 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 en or cs.

originstringdefault user_input

Use tool_output when the text comes from a tool result rather than the user.

One of: user_input, tool_output

pii_detection_modestringdefault full

minimal requests a fast rule-based retry after a slow or failed full call. It is honoured only as one retry of a full attempt for the same system that started within the last 60 seconds and is named in metadata.minimal_retry_of_client_event_id; otherwise the request runs as full.

One of: full, minimal

attachmentsarray<object>
›Show item attributes
filenamestringrequired

min length 1 · max length 255

mime_typestring

max length 255

mimeTypestring

Alias of mime_type.

max length 255

content_base64string

File bytes, base64-encoded.

max length 6000000

contentBase64string

Alias of content_base64.

max length 6000000

textstring

Extracted text of the attachment.

max length 500000

unreadable_reasonstring

The client could not read the file; the system's failure mode applies.

pattern ^[a-z0-9_]{1,80}$

idstring

Your correlation id for this file, echoed in attachment_results[].id.

max length 128

sha256string

SHA-256 of the file bytes (lowercase hex), recorded in the audit.

max length 128

attachment_deliveryobject
›Show child attributes
versionintegerrequired

Value: 1

nativebooleanrequired

Ask for per-file delivery decisions and masked files in their own format.

max_inline_bytesinteger

Masked 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.accepts the system configuration advertises. macro_free_office: a masked DOCM, XLSM or PPTM comes back without its macros as DOCX, XLSX or PPTX (see delivered_extension). redacted_images: images and scanned PDFs come back in their own format with each value covered by its placeholder label (see painted_tokens). Without them these files arrive as masked text.

token_continuityobject

Keeps one token per person or value across the turns of a conversation. Send {"v": 1} on the first turn, then the token_continuity object the previous response returned, unchanged. Send it only when /api/v1/agent/config advertises token_continuity. A changed or foreign state is ignored and numbering starts over.

›Show child attributes
vinteger

Value: 1

Additional properties are accepted.

metadataobject

Free-form telemetry stored with the Guard event.

request_identityobject

Optional client-side identity hints stored with the event for audit.

›Show child attributes
ip_addressstring
user_agentstring
geostring

Country or region hint.

session_idstring

Additional properties are accepted.

client_capabilitiesobject

Optional description of the calling client. Official SDKs fill it automatically.

›Show child attributes
frameworkstring
pii_masking_enabledboolean

Whether the client masks personal data locally before calling Guard.

secret_masking_enabledboolean

Whether the client masks secrets locally before calling Guard.

has_feedback_handlerboolean
sdk_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"
  ]
}'

Responses

200Check completed. Read `allowed`: a `200` can also carry `allowed: false`, for

Headers

X-AgentID-Statusstring

BYPASSED_INFRA_ERROR when a fail-open system skipped the check because a dependency failed.

Value: BYPASSED_INFRA_ERROR

›Response schemaGuardResponse
allowedbooleanrequired

Whether you may call the model.

reasonstring

Why 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 as Policy violation: Term blocked by admin. Legacy reasons that can still be returned: database_access_blocked, code_execution_blocked.

detected_piiboolean

Whether personal data or secrets were detected in the input or attachments.

checkedboolean
bypassedboolean

True when the check was skipped because of a dependency failure in a fail-open system.

transformed_inputstring

The text to send to the model. Equal to input when nothing was masked.

input_char_countinteger

Length of the received input, so you can confirm nothing was cut.

min 0

transformed_input_completeboolean

True when transformed_input covers the whole input.

transformed_attachmentsarray<object>
›Show item attributes
filenamestringrequired
transformed_textstringrequired
mime_typestring
sourcestring

One of: inline_text, base64_file

extraction_errorstring | null
requires_ocrboolean
ocr_usedboolean

Additional properties are accepted.

attachment_resultsarray<object>

Present when the request sent attachment_delivery.

›Show item attributes
indexintegerrequired

Position of the file in attachments.

filenamestringrequired

Name to use; masked placeholders use the bracket form, e.g. Contract [PERSON_NAME_1].docx.

deliverystringrequired

One of: original, masked_native, masked_text, blocked, unscanned

delivery_reasonstringrequired

For 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 | null
kindstring

Detected format, e.g. docx, xlsx, pptx, markdown, pdf, image.

filename_maskedboolean
delivered_extensionstring

Extension of the masked file when it differs from the original, e.g. docx for 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
formatstring

One of: markdown, text

filenamestring
textstring
masked_fileobject
›Show child attributes
encodingstring

One of: base64, signed_url

content_base64string
urlstring
expires_atstring<date-time>
sha256string
byte_lengthinteger
mime_typestring
detectionsobject

Counts by type, in the filename, and the types excluded from masking.

coveragestring

One of: full, partial, none

verificationobject
›Show child attributes
statusstring

One of: passed, failed, skipped

residual_countinteger

Additional properties are accepted.

client_deanonymization_enabledboolean

Whether this allowed response permits restoring placeholders for the end user.

client_substitute_stylestring

Always tokens (typed placeholders).

Value: tokens

client_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_continuityobject

Signed 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_msinteger

min 0

shadow_modeboolean

True when the system runs in Shadow Mode; nothing is blocked or masked.

simulated_decisionstring

In Shadow Mode, what Active Guard would have done.

One of: allowed, masked, blocked

shadow_blockedboolean
policy_pack_matcher_backendstring

One of: rust_wasm, js_hybrid, legacy_fallback

policy_pack_scan_profilestring

One of: expected_languages, auto_detected, global_high_priority, core_en_fallback

policy_pack_scan_modestring

One of: full, segmented

exotic_language_detectedboolean
langid_primarystring
langid_confidencestring

One of: high, medium, low

langid_secondaryarray<string>
langid_mixedboolean
langid_sourcestring

One of: input_detection, input_detection_with_hint

guard_metadataobject

Diagnostic summary of the decision. Its fields may change.

transparencyobject

Present when transparency metadata injection is enabled for the system.

›Show child attributes
is_ai_generatedboolean

Value: true

disclosurestring
articlestring
injection_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
}

400Invalid JSON or a field outside the request schema.

›Response schemaGuardResponse
allowedbooleanrequired

Whether you may call the model.

reasonstring

Why 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 as Policy violation: Term blocked by admin. Legacy reasons that can still be returned: database_access_blocked, code_execution_blocked.

detected_piiboolean

Whether personal data or secrets were detected in the input or attachments.

checkedboolean
bypassedboolean

True when the check was skipped because of a dependency failure in a fail-open system.

transformed_inputstring

The text to send to the model. Equal to input when nothing was masked.

input_char_countinteger

Length of the received input, so you can confirm nothing was cut.

min 0

transformed_input_completeboolean

True when transformed_input covers the whole input.

transformed_attachmentsarray<object>
›Show item attributes
filenamestringrequired
transformed_textstringrequired
mime_typestring
sourcestring

One of: inline_text, base64_file

extraction_errorstring | null
requires_ocrboolean
ocr_usedboolean

Additional properties are accepted.

attachment_resultsarray<object>

Present when the request sent attachment_delivery.

›Show item attributes
indexintegerrequired

Position of the file in attachments.

filenamestringrequired

Name to use; masked placeholders use the bracket form, e.g. Contract [PERSON_NAME_1].docx.

deliverystringrequired

One of: original, masked_native, masked_text, blocked, unscanned

delivery_reasonstringrequired

For 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 | null
kindstring

Detected format, e.g. docx, xlsx, pptx, markdown, pdf, image.

filename_maskedboolean
delivered_extensionstring

Extension of the masked file when it differs from the original, e.g. docx for 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
formatstring

One of: markdown, text

filenamestring
textstring
masked_fileobject
›Show child attributes
encodingstring

One of: base64, signed_url

content_base64string
urlstring
expires_atstring<date-time>
sha256string
byte_lengthinteger
mime_typestring
detectionsobject

Counts by type, in the filename, and the types excluded from masking.

coveragestring

One of: full, partial, none

verificationobject
›Show child attributes
statusstring

One of: passed, failed, skipped

residual_countinteger

Additional properties are accepted.

client_deanonymization_enabledboolean

Whether this allowed response permits restoring placeholders for the end user.

client_substitute_stylestring

Always tokens (typed placeholders).

Value: tokens

client_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_continuityobject

Signed 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_msinteger

min 0

shadow_modeboolean

True when the system runs in Shadow Mode; nothing is blocked or masked.

simulated_decisionstring

In Shadow Mode, what Active Guard would have done.

One of: allowed, masked, blocked

shadow_blockedboolean
policy_pack_matcher_backendstring

One of: rust_wasm, js_hybrid, legacy_fallback

policy_pack_scan_profilestring

One of: expected_languages, auto_detected, global_high_priority, core_en_fallback

policy_pack_scan_modestring

One of: full, segmented

exotic_language_detectedboolean
langid_primarystring
langid_confidencestring

One of: high, medium, low

langid_secondaryarray<string>
langid_mixedboolean
langid_sourcestring

One of: input_detection, input_detection_with_hint

guard_metadataobject

Diagnostic summary of the decision. Its fields may change.

transparencyobject

Present when transparency metadata injection is enabled for the system.

›Show child attributes
is_ai_generatedboolean

Value: true

disclosurestring
articlestring
injection_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
allowedbooleanrequired

Whether you may call the model.

reasonstring

Why 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 as Policy violation: Term blocked by admin. Legacy reasons that can still be returned: database_access_blocked, code_execution_blocked.

detected_piiboolean

Whether personal data or secrets were detected in the input or attachments.

checkedboolean
bypassedboolean

True when the check was skipped because of a dependency failure in a fail-open system.

transformed_inputstring

The text to send to the model. Equal to input when nothing was masked.

input_char_countinteger

Length of the received input, so you can confirm nothing was cut.

min 0

transformed_input_completeboolean

True when transformed_input covers the whole input.

transformed_attachmentsarray<object>
›Show item attributes
filenamestringrequired
transformed_textstringrequired
mime_typestring
sourcestring

One of: inline_text, base64_file

extraction_errorstring | null
requires_ocrboolean
ocr_usedboolean

Additional properties are accepted.

attachment_resultsarray<object>

Present when the request sent attachment_delivery.

›Show item attributes
indexintegerrequired

Position of the file in attachments.

filenamestringrequired

Name to use; masked placeholders use the bracket form, e.g. Contract [PERSON_NAME_1].docx.

deliverystringrequired

One of: original, masked_native, masked_text, blocked, unscanned

delivery_reasonstringrequired

For 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 | null
kindstring

Detected format, e.g. docx, xlsx, pptx, markdown, pdf, image.

filename_maskedboolean
delivered_extensionstring

Extension of the masked file when it differs from the original, e.g. docx for 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
formatstring

One of: markdown, text

filenamestring
textstring
masked_fileobject
›Show child attributes
encodingstring

One of: base64, signed_url

content_base64string
urlstring
expires_atstring<date-time>
sha256string
byte_lengthinteger
mime_typestring
detectionsobject

Counts by type, in the filename, and the types excluded from masking.

coveragestring

One of: full, partial, none

verificationobject
›Show child attributes
statusstring

One of: passed, failed, skipped

residual_countinteger

Additional properties are accepted.

client_deanonymization_enabledboolean

Whether this allowed response permits restoring placeholders for the end user.

client_substitute_stylestring

Always tokens (typed placeholders).

Value: tokens

client_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_continuityobject

Signed 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_msinteger

min 0

shadow_modeboolean

True when the system runs in Shadow Mode; nothing is blocked or masked.

simulated_decisionstring

In Shadow Mode, what Active Guard would have done.

One of: allowed, masked, blocked

shadow_blockedboolean
policy_pack_matcher_backendstring

One of: rust_wasm, js_hybrid, legacy_fallback

policy_pack_scan_profilestring

One of: expected_languages, auto_detected, global_high_priority, core_en_fallback

policy_pack_scan_modestring

One of: full, segmented

exotic_language_detectedboolean
langid_primarystring
langid_confidencestring

One of: high, medium, low

langid_secondaryarray<string>
langid_mixedboolean
langid_sourcestring

One of: input_detection, input_detection_with_hint

guard_metadataobject

Diagnostic summary of the decision. Its fields may change.

transparencyobject

Present when transparency metadata injection is enabled for the system.

›Show child attributes
is_ai_generatedboolean

Value: true

disclosurestring
articlestring
injection_modestring

Additional properties are accepted.

{
  "allowed": false,
  "reason": "unauthorized"
}

403Blocked by a guardrail, a content policy or the kill switch.

›Response schemaGuardResponse
allowedbooleanrequired

Whether you may call the model.

reasonstring

Why 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 as Policy violation: Term blocked by admin. Legacy reasons that can still be returned: database_access_blocked, code_execution_blocked.

detected_piiboolean

Whether personal data or secrets were detected in the input or attachments.

checkedboolean
bypassedboolean

True when the check was skipped because of a dependency failure in a fail-open system.

transformed_inputstring

The text to send to the model. Equal to input when nothing was masked.

input_char_countinteger

Length of the received input, so you can confirm nothing was cut.

min 0

transformed_input_completeboolean

True when transformed_input covers the whole input.

transformed_attachmentsarray<object>
›Show item attributes
filenamestringrequired
transformed_textstringrequired
mime_typestring
sourcestring

One of: inline_text, base64_file

extraction_errorstring | null
requires_ocrboolean
ocr_usedboolean

Additional properties are accepted.

attachment_resultsarray<object>

Present when the request sent attachment_delivery.

›Show item attributes
indexintegerrequired

Position of the file in attachments.

filenamestringrequired

Name to use; masked placeholders use the bracket form, e.g. Contract [PERSON_NAME_1].docx.

deliverystringrequired

One of: original, masked_native, masked_text, blocked, unscanned

delivery_reasonstringrequired

For 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 | null
kindstring

Detected format, e.g. docx, xlsx, pptx, markdown, pdf, image.

filename_maskedboolean
delivered_extensionstring

Extension of the masked file when it differs from the original, e.g. docx for 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
formatstring

One of: markdown, text

filenamestring
textstring
masked_fileobject
›Show child attributes
encodingstring

One of: base64, signed_url

content_base64string
urlstring
expires_atstring<date-time>
sha256string
byte_lengthinteger
mime_typestring
detectionsobject

Counts by type, in the filename, and the types excluded from masking.

coveragestring

One of: full, partial, none

verificationobject
›Show child attributes
statusstring

One of: passed, failed, skipped

residual_countinteger

Additional properties are accepted.

client_deanonymization_enabledboolean

Whether this allowed response permits restoring placeholders for the end user.

client_substitute_stylestring

Always tokens (typed placeholders).

Value: tokens

client_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_continuityobject

Signed 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_msinteger

min 0

shadow_modeboolean

True when the system runs in Shadow Mode; nothing is blocked or masked.

simulated_decisionstring

In Shadow Mode, what Active Guard would have done.

One of: allowed, masked, blocked

shadow_blockedboolean
policy_pack_matcher_backendstring

One of: rust_wasm, js_hybrid, legacy_fallback

policy_pack_scan_profilestring

One of: expected_languages, auto_detected, global_high_priority, core_en_fallback

policy_pack_scan_modestring

One of: full, segmented

exotic_language_detectedboolean
langid_primarystring
langid_confidencestring

One of: high, medium, low

langid_secondaryarray<string>
langid_mixedboolean
langid_sourcestring

One of: input_detection, input_detection_with_hint

guard_metadataobject

Diagnostic summary of the decision. Its fields may change.

transparencyobject

Present when transparency metadata injection is enabled for the system.

›Show child attributes
is_ai_generatedboolean

Value: true

disclosurestring
articlestring
injection_modestring

Additional properties are accepted.

{
  "allowed": false,
  "reason": "prompt_injection_blocked"
}

413Request body exceeds 4 MiB.

›Response schemaGuardResponse
allowedbooleanrequired

Whether you may call the model.

reasonstring

Why 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 as Policy violation: Term blocked by admin. Legacy reasons that can still be returned: database_access_blocked, code_execution_blocked.

detected_piiboolean

Whether personal data or secrets were detected in the input or attachments.

checkedboolean
bypassedboolean

True when the check was skipped because of a dependency failure in a fail-open system.

transformed_inputstring

The text to send to the model. Equal to input when nothing was masked.

input_char_countinteger

Length of the received input, so you can confirm nothing was cut.

min 0

transformed_input_completeboolean

True when transformed_input covers the whole input.

transformed_attachmentsarray<object>
›Show item attributes
filenamestringrequired
transformed_textstringrequired
mime_typestring
sourcestring

One of: inline_text, base64_file

extraction_errorstring | null
requires_ocrboolean
ocr_usedboolean

Additional properties are accepted.

attachment_resultsarray<object>

Present when the request sent attachment_delivery.

›Show item attributes
indexintegerrequired

Position of the file in attachments.

filenamestringrequired

Name to use; masked placeholders use the bracket form, e.g. Contract [PERSON_NAME_1].docx.

deliverystringrequired

One of: original, masked_native, masked_text, blocked, unscanned

delivery_reasonstringrequired

For 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 | null
kindstring

Detected format, e.g. docx, xlsx, pptx, markdown, pdf, image.

filename_maskedboolean
delivered_extensionstring

Extension of the masked file when it differs from the original, e.g. docx for 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
formatstring

One of: markdown, text

filenamestring
textstring
masked_fileobject
›Show child attributes
encodingstring

One of: base64, signed_url

content_base64string
urlstring
expires_atstring<date-time>
sha256string
byte_lengthinteger
mime_typestring
detectionsobject

Counts by type, in the filename, and the types excluded from masking.

coveragestring

One of: full, partial, none

verificationobject
›Show child attributes
statusstring

One of: passed, failed, skipped

residual_countinteger

Additional properties are accepted.

client_deanonymization_enabledboolean

Whether this allowed response permits restoring placeholders for the end user.

client_substitute_stylestring

Always tokens (typed placeholders).

Value: tokens

client_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_continuityobject

Signed 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_msinteger

min 0

shadow_modeboolean

True when the system runs in Shadow Mode; nothing is blocked or masked.

simulated_decisionstring

In Shadow Mode, what Active Guard would have done.

One of: allowed, masked, blocked

shadow_blockedboolean
policy_pack_matcher_backendstring

One of: rust_wasm, js_hybrid, legacy_fallback

policy_pack_scan_profilestring

One of: expected_languages, auto_detected, global_high_priority, core_en_fallback

policy_pack_scan_modestring

One of: full, segmented

exotic_language_detectedboolean
langid_primarystring
langid_confidencestring

One of: high, medium, low

langid_secondaryarray<string>
langid_mixedboolean
langid_sourcestring

One of: input_detection, input_detection_with_hint

guard_metadataobject

Diagnostic summary of the decision. Its fields may change.

transparencyobject

Present when transparency metadata injection is enabled for the system.

›Show child attributes
is_ai_generatedboolean

Value: true

disclosurestring
articlestring
injection_modestring

Additional properties are accepted.

{
  "allowed": false,
  "reason": "payload_too_large"
}

429Rate limit or quota exceeded.

Headers

Retry-Afterinteger

Seconds to wait before retrying.

min 1

X-RateLimit-Limitinteger

Maximum requests allowed in the current window.

X-RateLimit-Remaininginteger

Requests remaining in the current window.

›Response schemaGuardResponse
allowedbooleanrequired

Whether you may call the model.

reasonstring

Why 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 as Policy violation: Term blocked by admin. Legacy reasons that can still be returned: database_access_blocked, code_execution_blocked.

detected_piiboolean

Whether personal data or secrets were detected in the input or attachments.

checkedboolean
bypassedboolean

True when the check was skipped because of a dependency failure in a fail-open system.

transformed_inputstring

The text to send to the model. Equal to input when nothing was masked.

input_char_countinteger

Length of the received input, so you can confirm nothing was cut.

min 0

transformed_input_completeboolean

True when transformed_input covers the whole input.

transformed_attachmentsarray<object>
›Show item attributes
filenamestringrequired
transformed_textstringrequired
mime_typestring
sourcestring

One of: inline_text, base64_file

extraction_errorstring | null
requires_ocrboolean
ocr_usedboolean

Additional properties are accepted.

attachment_resultsarray<object>

Present when the request sent attachment_delivery.

›Show item attributes
indexintegerrequired

Position of the file in attachments.

filenamestringrequired

Name to use; masked placeholders use the bracket form, e.g. Contract [PERSON_NAME_1].docx.

deliverystringrequired

One of: original, masked_native, masked_text, blocked, unscanned

delivery_reasonstringrequired

For 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 | null
kindstring

Detected format, e.g. docx, xlsx, pptx, markdown, pdf, image.

filename_maskedboolean
delivered_extensionstring

Extension of the masked file when it differs from the original, e.g. docx for 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
formatstring

One of: markdown, text

filenamestring
textstring
masked_fileobject
›Show child attributes
encodingstring

One of: base64, signed_url

content_base64string
urlstring
expires_atstring<date-time>
sha256string
byte_lengthinteger
mime_typestring
detectionsobject

Counts by type, in the filename, and the types excluded from masking.

coveragestring

One of: full, partial, none

verificationobject
›Show child attributes
statusstring

One of: passed, failed, skipped

residual_countinteger

Additional properties are accepted.

client_deanonymization_enabledboolean

Whether this allowed response permits restoring placeholders for the end user.

client_substitute_stylestring

Always tokens (typed placeholders).

Value: tokens

client_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_continuityobject

Signed 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_msinteger

min 0

shadow_modeboolean

True when the system runs in Shadow Mode; nothing is blocked or masked.

simulated_decisionstring

In Shadow Mode, what Active Guard would have done.

One of: allowed, masked, blocked

shadow_blockedboolean
policy_pack_matcher_backendstring

One of: rust_wasm, js_hybrid, legacy_fallback

policy_pack_scan_profilestring

One of: expected_languages, auto_detected, global_high_priority, core_en_fallback

policy_pack_scan_modestring

One of: full, segmented

exotic_language_detectedboolean
langid_primarystring
langid_confidencestring

One of: high, medium, low

langid_secondaryarray<string>
langid_mixedboolean
langid_sourcestring

One of: input_detection, input_detection_with_hint

guard_metadataobject

Diagnostic summary of the decision. Its fields may change.

transparencyobject

Present when transparency metadata injection is enabled for the system.

›Show child attributes
is_ai_generatedboolean

Value: true

disclosurestring
articlestring
injection_modestring

Additional properties are accepted.

{
  "allowed": false,
  "reason": "rate_limited"
}

500Internal processing failure.

›Response schemaGuardResponse
allowedbooleanrequired

Whether you may call the model.

reasonstring

Why 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 as Policy violation: Term blocked by admin. Legacy reasons that can still be returned: database_access_blocked, code_execution_blocked.

detected_piiboolean

Whether personal data or secrets were detected in the input or attachments.

checkedboolean
bypassedboolean

True when the check was skipped because of a dependency failure in a fail-open system.

transformed_inputstring

The text to send to the model. Equal to input when nothing was masked.

input_char_countinteger

Length of the received input, so you can confirm nothing was cut.

min 0

transformed_input_completeboolean

True when transformed_input covers the whole input.

transformed_attachmentsarray<object>
›Show item attributes
filenamestringrequired
transformed_textstringrequired
mime_typestring
sourcestring

One of: inline_text, base64_file

extraction_errorstring | null
requires_ocrboolean
ocr_usedboolean

Additional properties are accepted.

attachment_resultsarray<object>

Present when the request sent attachment_delivery.

›Show item attributes
indexintegerrequired

Position of the file in attachments.

filenamestringrequired

Name to use; masked placeholders use the bracket form, e.g. Contract [PERSON_NAME_1].docx.

deliverystringrequired

One of: original, masked_native, masked_text, blocked, unscanned

delivery_reasonstringrequired

For 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 | null
kindstring

Detected format, e.g. docx, xlsx, pptx, markdown, pdf, image.

filename_maskedboolean
delivered_extensionstring

Extension of the masked file when it differs from the original, e.g. docx for 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
formatstring

One of: markdown, text

filenamestring
textstring
masked_fileobject
›Show child attributes
encodingstring

One of: base64, signed_url

content_base64string
urlstring
expires_atstring<date-time>
sha256string
byte_lengthinteger
mime_typestring
detectionsobject

Counts by type, in the filename, and the types excluded from masking.

coveragestring

One of: full, partial, none

verificationobject
›Show child attributes
statusstring

One of: passed, failed, skipped

residual_countinteger

Additional properties are accepted.

client_deanonymization_enabledboolean

Whether this allowed response permits restoring placeholders for the end user.

client_substitute_stylestring

Always tokens (typed placeholders).

Value: tokens

client_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_continuityobject

Signed 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_msinteger

min 0

shadow_modeboolean

True when the system runs in Shadow Mode; nothing is blocked or masked.

simulated_decisionstring

In Shadow Mode, what Active Guard would have done.

One of: allowed, masked, blocked

shadow_blockedboolean
policy_pack_matcher_backendstring

One of: rust_wasm, js_hybrid, legacy_fallback

policy_pack_scan_profilestring

One of: expected_languages, auto_detected, global_high_priority, core_en_fallback

policy_pack_scan_modestring

One of: full, segmented

exotic_language_detectedboolean
langid_primarystring
langid_confidencestring

One of: high, medium, low

langid_secondaryarray<string>
langid_mixedboolean
langid_sourcestring

One of: input_detection, input_detection_with_hint

guard_metadataobject

Diagnostic summary of the decision. Its fields may change.

transparencyobject

Present when transparency metadata injection is enabled for the system.

›Show child attributes
is_ai_generatedboolean

Value: true

disclosurestring
articlestring
injection_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
allowedbooleanrequired

Whether you may call the model.

reasonstring

Why 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 as Policy violation: Term blocked by admin. Legacy reasons that can still be returned: database_access_blocked, code_execution_blocked.

detected_piiboolean

Whether personal data or secrets were detected in the input or attachments.

checkedboolean
bypassedboolean

True when the check was skipped because of a dependency failure in a fail-open system.

transformed_inputstring

The text to send to the model. Equal to input when nothing was masked.

input_char_countinteger

Length of the received input, so you can confirm nothing was cut.

min 0

transformed_input_completeboolean

True when transformed_input covers the whole input.

transformed_attachmentsarray<object>
›Show item attributes
filenamestringrequired
transformed_textstringrequired
mime_typestring
sourcestring

One of: inline_text, base64_file

extraction_errorstring | null
requires_ocrboolean
ocr_usedboolean

Additional properties are accepted.

attachment_resultsarray<object>

Present when the request sent attachment_delivery.

›Show item attributes
indexintegerrequired

Position of the file in attachments.

filenamestringrequired

Name to use; masked placeholders use the bracket form, e.g. Contract [PERSON_NAME_1].docx.

deliverystringrequired

One of: original, masked_native, masked_text, blocked, unscanned

delivery_reasonstringrequired

For 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 | null
kindstring

Detected format, e.g. docx, xlsx, pptx, markdown, pdf, image.

filename_maskedboolean
delivered_extensionstring

Extension of the masked file when it differs from the original, e.g. docx for 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
formatstring

One of: markdown, text

filenamestring
textstring
masked_fileobject
›Show child attributes
encodingstring

One of: base64, signed_url

content_base64string
urlstring
expires_atstring<date-time>
sha256string
byte_lengthinteger
mime_typestring
detectionsobject

Counts by type, in the filename, and the types excluded from masking.

coveragestring

One of: full, partial, none

verificationobject
›Show child attributes
statusstring

One of: passed, failed, skipped

residual_countinteger

Additional properties are accepted.

client_deanonymization_enabledboolean

Whether this allowed response permits restoring placeholders for the end user.

client_substitute_stylestring

Always tokens (typed placeholders).

Value: tokens

client_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_continuityobject

Signed 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_msinteger

min 0

shadow_modeboolean

True when the system runs in Shadow Mode; nothing is blocked or masked.

simulated_decisionstring

In Shadow Mode, what Active Guard would have done.

One of: allowed, masked, blocked

shadow_blockedboolean
policy_pack_matcher_backendstring

One of: rust_wasm, js_hybrid, legacy_fallback

policy_pack_scan_profilestring

One of: expected_languages, auto_detected, global_high_priority, core_en_fallback

policy_pack_scan_modestring

One of: full, segmented

exotic_language_detectedboolean
langid_primarystring
langid_confidencestring

One of: high, medium, low

langid_secondaryarray<string>
langid_mixedboolean
langid_sourcestring

One of: input_detection, input_detection_with_hint

guard_metadataobject

Diagnostic summary of the decision. Its fields may change.

transparencyobject

Present when transparency metadata injection is enabled for the system.

›Show child attributes
is_ai_generatedboolean

Value: true

disclosurestring
articlestring
injection_modestring

Additional properties are accepted.

{
  "allowed": false,
  "reason": "system_failure"
}