Summary

Fixes #1411 /claim #1411

When a tool call is blocked due to untrusted data, the error message was incorrectly displaying [object Object] instead of the actual JSON arguments.

Changes

  • Added JSON.stringify() to toolCall.custom.input in openai.ts (lines 482 and 760)
  • Added unit test to verify refusal messages contain properly serialized JSON

Root Cause

For function tool calls, toolCall.function.arguments is already a string from OpenAI’s SDK. However, for custom tool calls, toolCall.custom.input is an object. When passed directly to evaluatePolicies(), the object was converted to [object Object] via JavaScript’s default string conversion.

Claim

Total prize pool $30
Total paid $0
Status Pending
Submitted December 06, 2025
Last updated December 06, 2025

Contributors

EX

Excellencedev

@Excellencedev

100%

Sponsors

AR

Archestra

@archestra-ai

$30