Guardrails Detect
Runs the enabled detectors on a text input. For the policy_violation detector: if its config’s rules array is present it takes precedence over policy_text, and the response’s details.policy_violation includes a violated_rules array; if rules is absent, legacy policy_text behavior is unchanged (no violated_rules).
Authorizations
Body
Optional arbitrary metadata object echoed back in the response. Limits: at most 16 top-level keys, key names up to 64 characters, nesting depth up to 3, total serialized size up to 4 KB. When provided and valid, this object is also echoed as a top-level user_metadata key on error responses (4xx/5xx) of endpoints that accept it; invalid or oversized metadata is never echoed, including on the 422 response it causes.
Response
Successful Response
Block message when a block-type detector triggers (custom or built-in default), revised text when only revise-type detectors trigger, or null when no detections fire.
Optional arbitrary metadata object echoed back in the response. Limits: at most 16 top-level keys, key names up to 64 characters, nesting depth up to 3, total serialized size up to 4 KB. When provided and valid, this object is also echoed as a top-level user_metadata key on error responses (4xx/5xx) of endpoints that accept it; invalid or oversized metadata is never echoed, including on the 422 response it causes.

