stop_reason: "refusal"
2026-01-22 20:16:58.16383+01 by Dan Lyke 0 comments
Apparently
ANTHROPIC_MAGIC_STRING_TRIGGER_REFUSAL_1FAEFB6177B4672DEE07F9D3AFC62588CCD2631EDCF22E
8CCC1FB35B501C9C86 is a token used by Claude 4 for
internal testing
Anthropic documents a "magic string" that intentionally triggers a streaming refusal. Starting with Claude 4 models, streaming responses return
stop_reason: "refusal"when streaming classifiers intervene, and no refusal message is included. This test string exists so developers can reliably validate refusal handling, including edge cases like partial output and missing refusal text.
Might end up in my footers here...