The tool reads `toolsContext`. `require_auth` on your API is the gate. The AI SDK does not decide who the caller is.

Getting started, including the planned sample, is [Vercel AI SDK](/docs/agent-frameworks/ai-sdk).

## What fails closed

The route with no token is `401`. `execute` with an empty token does not return a subject.

The route with a bearer userinfo accepts returns `{ subject: "<id>" }`. That string is the tool result.

A resolved subject is not authorization. Scopes and allowed tools are a later check. The [trust-store sample](https://github.com/authdog/agents-samples/tree/main/trust-store/python) is that later check for MCP. This page stops at admission.

## Related

| Read | To learn how to |
| --- | --- |
| [Vercel AI SDK](/docs/agent-frameworks/ai-sdk) | See the hook |
| [API keys and M2M for Vercel AI SDK](/docs/ai/ai-sdk/api-keys-and-m2m) | Where the secret is allowed to live |
| [Authorizing tool calls for Vercel AI SDK](/docs/ai/ai-sdk/authorize-tool-calls) | What happens after the subject is known |
