POST /v2/agent_gateways/{id}/policies creates one. This policy runs the guardrails of baseline and a custom code check, on requests for GLM-5.3-Flash:
Inheritance
A policy that builds on a base policy starts with the base’s guardrails, then adds and removes its own. Astrict policy can build on a baseline policy that masks personal data, and add a custom code check, so both run.
Conditions
A policy can apply only to some models, named exactly or by a regular expression. Its guardrails then run only on requests for those models.Attachments
POST /v2/agent_gateways/{id}/policy_attachments applies a policy to every request, or to requests for the models it names. A model name in an attachment can use * as a wildcard:
"default": true, applies only to the requests that no other attachment matches.
A request can also add policies by name, in policies:
Pipelines
A policy can run its guardrails as ordered steps instead. Each step says what happens when its guardrail passes, fails, or errors:nextgoes on to the next step.allowallows the request.blockblocks the request.respondreplaces the response with the step’smessage.