Skip to main content
Published policies scoped to All projects or Selected projects apply automatically to matching project traffic. Keep using your existing API key and /v1 endpoint; no policy-specific URL or header is required.

Test in Playground

Open Playground and select Policies. The count shows policies affecting that run. The picker distinguishes policies already applied by project scope from policies you can add for this run. Select any additional policies and choose Apply policies, then send a test prompt. If you have no policies, create one from Console → Policies.

Select policies in an API request

Pass the IDs of published, selectable policies in the top-level policy_ids array. Policies that apply automatically do not need to appear in this array. The same field is accepted by Chat Completions, Responses, and Messages.
Use the policy’s ID, not its display name. A policy must be published and available to the project making the request. An unavailable ID is rejected rather than silently ignored. See Policies in API requests for endpoint details.

Streaming and response checks

Request policies run before model generation. Response policies evaluate generated content and tool calls. When a response policy uses Block mode, output is held until the check finishes; a streaming request still uses its normal endpoint-specific stream format, but the response content is released after evaluation rather than token by token as it is generated. If a policy blocks or cannot be evaluated, handle the policy error in your client. Do not assume that a streamed response always ends with a normal completion event.
Last modified on October 1, 2026