Skip to main content
Policy metadata injection only runs on /policy/* endpoints and requires a Policy Gateway plan.
When you stream from a /policy/* endpoint, every SSE frame carries a policy field describing the current enforcement state. This lets clients render compliance UI (warning banners, “why was this blocked” tooltips, audit links) without a second API call.

Enabling

Metadata injection is automatic on any /policy/* streaming response. /v1/* endpoints never inject.

Frame shape

Standard Anthropic SSE frame, unmodified:
Same frame on /policy/messages:
The policy object appears on every SSE data: line — message_start, content_block_start, content_block_delta, message_delta, message_stop. The values are stable across the stream unless a rule fires mid-stream (e.g., output classifier).

Fields

See the event shape for the full field list — the streaming policy object is a subset of the enforcement event.

Client example

Last modified on May 3, 2026