What changed
ai 7.0.178 came out on November 20, 2026. It fixes a hole in signed tool approvals.
With experimental_toolApprovalSecret set, generateText and streamText also signed the approval request of a tool call that your approval policy had denied automatically. A client that controls the message history could send that request back marked as approved, and the denied tool call would run.
Now approval requests for automatically denied tool calls are not signed. Such a response is rejected with AI_InvalidToolApprovalSignatureError.
Signatures that older versions issued for automatic denials stay valid until you rotate the secret.
On the same day, @ai-sdk/policy-opa 1.0.178 fixed a related gap. opaPolicy judged each tool call of one model response on its own, so rules like a budget or "only one delete" could be exceeded by several tool calls in one response. It now checks each later call with the earlier calls of that response included, and applies the stricter decision.
Other changes in ai 7.0.178: each step now gets its own copy of the messages array returned by prepareStep, preliminary results of provider-executed tools (such as OpenAI image generation previews) are no longer recorded as final, and file URLs are redacted from download errors sent to telemetry.
Prerequisites
- A project on
ai 7 that uses tool approvals with experimental_toolApprovalSecret
- The signing secret in
TOOL_APPROVAL_SECRET, as the AI SDK docs set it up
@ai-sdk/policy-opa if you write approval rules with opaPolicy
Steps
- Update the AI SDK.
If you use OPA policies:
npm install @ai-sdk/policy-opa@1.0.178
- Rotate the secret so signatures issued for earlier automatic denials stop working. The docs generate one like this:
Put the new value in TOOL_APPROVAL_SECRET on every server instance. Approval requests still waiting for a user decision will have to be requested again.
- Keep passing the secret as before. The docs example:
const agent = new ToolLoopAgent({
model: __MODEL__,
tools: { deleteFile, runQuery },
toolApproval: { deleteFile: 'user-approval', runQuery: 'user-approval' },
experimental_toolApprovalSecret: process.env.TOOL_APPROVAL_SECRET,
});
Test it
Set up a tool that your policy denies automatically. Take the approval request from the response, change it to approved and send it back. On 7.0.178 with a rotated secret, the call fails with AI_InvalidToolApprovalSignatureError and the tool does not run.
Not confirmed
- The notes do not say whether
ai 6 or 5 had the same issue. ai 5.0.292, released the same day, lists only dependency updates.
- The notes do not say whether
WorkflowAgent (@ai-sdk/workflow) needed the same fix. Its 2.0.110 release lists only dependency updates.