Run the workflow only from a route that depends on `require_auth`. The first step stops when the subject is missing, including a direct `workflow.run()` that skipped the route.

Getting started, including the planned sample, is [LlamaIndex Workflows](/docs/agent-frameworks/llamaindex).

## What fails closed

`POST /invoke` with no token is `401`. `workflow.run()` with no subject returns `unauthorized` and does not contain `subject:`.

The same POST with a bearer userinfo accepts returns `{"reply":"subject:<id>"}`.

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