Policy metadata injection only runs on
/policy/* endpoints and requires a Policy Gateway plan./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:/policy/messages:
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 policy event reference for the full field list — the streamingpolicy object is a subset of the enforcement event.
