AI tool callbacks often arrive as webhooks. The model asked your app to call a vendor. The vendor finishes later and posts a result to your URL. If that URL accepts any POST, an attacker can fake a success, inject a tool result into the next prompt, or trigger a write the user never approved.

Signing webhooks is how you prove the callback came from the party you called. Verification belongs on your server before any tool result touches the model or the database.

What to sign and verify

Require a shared secret or asymmetric key per integration. The sender computes a signature over a stable payload. You recompute and compare with a constant-time check.

Reject requests with a missing signature, a bad signature, or a stale timestamp before you parse business fields. Return a generic 401 or 403. Do not echo why the check failed in a way that helps an attacker tune the forge.

Tie the callback to the original turn

When you start a tool call, store a server-side job record: user id, session id, tool name, idempotency key, and expected callback window. The webhook must present that job id. After signature checks, load the job and confirm the actor still matches.

Never trust a user id or account id inside the webhook body alone. The body can claim anything. Your job table is the source of truth.

Common mistakes

Tests and rollout

Unit-test good signatures, bad signatures, replayed event ids, and expired timestamps. Integration-test a forged body that would otherwise look like a successful tool result. The model must never see that forge.

Ship behind a flag. Start with read-only tool callbacks. Add write callbacks only after confirm and job binding are in place. Alert on signature failures by tenant; a sudden spike can mean a misconfigured client or an attack.

Signed webhooks keep async AI tools honest. Verify the signature. Bind the job. Only then let the result enter your app or the next model turn.

When you buy or sell an app that relies on AI tool callbacks, ask how webhooks are signed, how secrets are rotated, and whether unsigned deliveries can reach the model. Missing verification is a security debt. Price the work to fix it into the deal, or walk.

Ship the verifier with the first AI callback, not after the first strange POST lands.