Follow Discord
Sweep 03 Nov 2026 · 22:27Z Build v2.1.318 536 read Stable v2.1.311 Latest v2.1.318 Next v2.1.318 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

handle-streaming-refusals changedtest-and-evaluate/strengthen-guardrails/handle-streaming-refusals

Recorded here
Lines+2added
Lines−2removed
From line 33 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits19to this page, all time

The whole hunk

from line 33, old and new numbered
/
lines
from line 33
3333**API support**: Usage differs by product.
3434 
3535* **Messages API**: The stream ends with `stop_reason` `"refusal"`, and `stop_details` (`category` and `explanation`) arrives on the `message_delta` event.
36* **Managed Agents**: A refused turn ends, and the session goes idle with `stop_reason.type` `"refusal"`.
36* **Managed Agents**: A refused turn ends, and the session goes idle. Treat a turn as refused if `stop_details.type` or `stop_reason.type` is `"refusal"`.
3737 
3838Starting with Claude 4 models, streaming responses from Claude’s API return **`stop_reason`: `"refusal"`** when streaming classifiers intervene to handle potential policy violations. This safety feature helps maintain content compliance during real-time streaming.
3939 
from line 388
388388#### [Managed Agents](https://platform.claude.com/docs/en/managed-agents/overview)
389389 
390390* Availability: Always on
391* Usage: A refused turn ends, and the session goes idle with `stop_reason.type` `"refusal"` and `stop_details` (`category` and `explanation`) on the `session.status_idle` event.
391* Usage: A refused turn ends, and the session goes idle. Treat a turn as refused if `stop_details.type` or `stop_reason.type` on the `session.status_idle` event is `"refusal"`. On a refused turn, `stop_reason.type` can be `"end_turn"`. `stop_details` is `null` on any other turn, and can be `null` on a refused turn too.
392392 
393393| Status | Cloud platforms |
394394| ------ | ------------------------------------------------------------------------------------------------------------------ |
Feedback