The tool reads the token from `RunContext`. `require_auth` on your API is the gate. Pydantic AI does not verify the bearer itself.

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

## What fails closed

`GET /whoami` with no token is `401`. The helper, given an empty token, does not return a subject.

The same call with a bearer userinfo accepts returns `{"subject":"<id>"}`. The tool result is that string.

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 |
| --- | --- |
| [Pydantic AI](/docs/agent-frameworks/pydantic-ai) | See the hook |
| [API keys and M2M for Pydantic AI](/docs/ai/pydantic-ai/api-keys-and-m2m) | Where the secret is allowed to live |
| [Authorizing tool calls for Pydantic AI](/docs/ai/pydantic-ai/authorize-tool-calls) | What happens after the subject is known |
