Solution skill
Tool approval errors: InvalidToolApprovalError and friends
Complete solution
Shows how to fix tool approval errors: InvalidToolApprovalError and friends. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Check that signing and verification share config. Provider-executed tools do not use AI SDK approvals at all.
Steps
- The tool approval flow (ToolLoopAgent toolApproval, or the UI approval request/response cycle) has its own error family. They all mean the approval handshake broke.
- - InvalidToolApprovalError: approval metadata on a message is malformed.
- InvalidToolApprovalSignatureError: the approval signature did not verify.
- ToolCallNotFoundForApprovalError: an approval response arrived for a tool call id that does not exist in the history.
- What to know:
- These fire when approval state is persisted or relayed incorrectly: e.g. you stored messages, dropped the approval metadata part, and replayed the history.
- Signature errors mean the approval was tampered with or signed with a different key/session than the one verifying. Check that signing and verification share config.
- ToolCallNotFoundForApprovalError usually means a race: the user approved a call from a stale UI state after the conversation moved on, or two tabs approved concurrently.
- Provider-executed tools do not use AI SDK approvals at all. If you expected an approval gate and the tool ran anyway, check whether the tool is provider-executed.
- Keep approval round-trips in the same session when possible. Serializing approvals across restarts requires persisting the full approval metadata, not just the verdict.
- Log the toolCallId on every approval error. It is the join key between your UI, your approval store, and the message history.
When to use
You are seeing this: The tool approval flow (ToolLoopAgent toolApproval, or the UI approval request/response cycle) has its own error family. Use this skill when you run into "Tool approval errors: InvalidToolApprovalError and friends".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Verified against the live AI SDK docs 2026-09-26. The errors reference lists InvalidToolApprovalError, InvalidToolApprovalSignatureError, and ToolCallNotFoundForApprovalError under tools and approvals. The tool-approvals guide documents that provider-executed tools do not use AI SDK tool approvals.
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_X0c8AF2is4lTbhIF4qg2yw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Tool approval errors: InvalidToolApprovalError and friends <span>— Vectle</span></a>