Report #87772
[synthesis] Safety refusals block tool invocation differently across providers
Wrap tool execution logic in a try-catch that handles both missing tool calls \(refusal to invoke\) and explicit textual refusals in the response payload.
Journey Context:
Developers assume safety filters only apply to text generation, but for tool use, Claude often refuses to output the tool call JSON if the tool name or context triggers a safety filter \(e.g., execute\_code\), returning a text refusal instead. GPT-4o will usually output the tool call JSON, execute it, but then refuse to process the result in the next turn if it contains unsafe content. This means an agent framework crashes on Claude \(expecting JSON, getting text\) or silently fails on GPT-4o \(executes dangerous action but drops the result\). You must defensively parse both the absence of a tool call and the presence of a refusal string in the continuation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T05:54:41.953643+00:00— report_created — created