@ai-sdk/provider-utils
Advanced tools
+10
-0
| # @ai-sdk/provider-utils | ||
| ## 4.0.28 | ||
| ### Patch Changes | ||
| - 942f2f8: fix(security): re-validate tool approvals from client message history before execution | ||
| The approval-replay path in `generateText`/`streamText` reconstructed approved tool calls from the client-supplied messages array and executed them without re-validating input against the tool's schema or re-checking that the tool actually requires approval. A client could forge an assistant message with a pre-approved tool-call part and have the server execute a tool with attacker-chosen arguments. | ||
| The replay path now verifies the HMAC signature (when `experimental_toolApprovalSecret` is configured), re-validates tool-call input against the tool's input schema, and re-resolves whether the tool requires approval before execution. | ||
| ## 4.0.27 | ||
@@ -4,0 +14,0 @@ |
+5
-0
@@ -877,2 +877,7 @@ import { LanguageModelV3FunctionTool, LanguageModelV3ProviderTool, ImageModelV3File, AISDKError, JSONSchema7, JSONParseError, TypeValidationError, JSONValue, APICallError, LanguageModelV3Prompt, SharedV3ProviderOptions, JSONObject, TypeValidationContext } from '@ai-sdk/provider'; | ||
| toolCallId: string; | ||
| /** | ||
| * HMAC-SHA256 signature binding this approval to its tool call. | ||
| * Present only when `experimental_toolApprovalSecret` is configured. | ||
| */ | ||
| signature?: string; | ||
| }; | ||
@@ -879,0 +884,0 @@ |
+5
-0
@@ -877,2 +877,7 @@ import { LanguageModelV3FunctionTool, LanguageModelV3ProviderTool, ImageModelV3File, AISDKError, JSONSchema7, JSONParseError, TypeValidationError, JSONValue, APICallError, LanguageModelV3Prompt, SharedV3ProviderOptions, JSONObject, TypeValidationContext } from '@ai-sdk/provider'; | ||
| toolCallId: string; | ||
| /** | ||
| * HMAC-SHA256 signature binding this approval to its tool call. | ||
| * Present only when `experimental_toolApprovalSecret` is configured. | ||
| */ | ||
| signature?: string; | ||
| }; | ||
@@ -879,0 +884,0 @@ |
+1
-1
| { | ||
| "name": "@ai-sdk/provider-utils", | ||
| "version": "4.0.27", | ||
| "version": "4.0.28", | ||
| "license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
@@ -16,2 +16,8 @@ /** | ||
| toolCallId: string; | ||
| /** | ||
| * HMAC-SHA256 signature binding this approval to its tool call. | ||
| * Present only when `experimental_toolApprovalSecret` is configured. | ||
| */ | ||
| signature?: string; | ||
| }; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
873415
0.15%12100
0.08%