# Auth Users and Agent Invokers

An Auth User is the person signed in to your app. An Agent Invoker is the trusted caller who started one Agent Invocation (one run of an Agent). Agent and Capability code read it from `context.invoker`.

## Choose the identity you need

| | Auth User | Agent Invoker |
| --- | --- | --- |
| Scope | The application session | One Agent Invocation |
| Source | An auth provider | A trusted entry point or Auth bridge |
| Used by | Routes and application authorization | Agent and Capability code |
| Required | Only where the application requires auth | Every invocation, including anonymous calls |

## Auth can provide the invoker

A Channel, schedule, webhook, service account, CLI command, or local development can also start an Agent. These need no Auth User, but still give an invoker.

```ts [server/agents/support.ts]
import { defineAgent } from 'vite-hub/agent'
import { authenticated } from 'vite-hub/auth/agent'

export default defineAgent({
  invoker: authenticated(),
  driver: {
    run: ({ invoker }) => ({ invoker }),
  },
})
```

`authenticated()` makes the signed-in user the Agent Invoker. Auth alone does not make every Agent require a user session.

## The invoker carries trusted caller data

| Field | Meaning |
| --- | --- |
| `id` | Stable caller ID. |
| `kind` | Caller type such as `authUser`, `chat`, or `anonymous`. |
| `label` | Optional label shown in inspection. |
| `meta` | App data for Capabilities and callbacks. |

Do not put secrets or raw session payloads in `meta`.

Read [Auth](https://vitehub.dev/docs/auth) to set up sessions and [Access](https://vitehub.dev/docs/agents/capabilities/access) to allow or deny by invoker.

<!-- vitehub-docs:section-links -->
## In this section

- [Start](https://vitehub.dev/raw/docs/agents.md)
- [Define and run](https://vitehub.dev/raw/docs/agents/agent-definitions.md)
- [Instructions and tools](https://vitehub.dev/raw/docs/agents/instructions.md)
- History and context
  - [Chat History and sessions](https://vitehub.dev/raw/docs/agents/chat-history-sessions.md)
  - [Workspace context](https://vitehub.dev/raw/docs/agents/workspace-context.md)
  - [Auth Users and Agent Invokers](https://vitehub.dev/raw/docs/agents/invokers.md) (this page)
  - [Agent Actors](https://vitehub.dev/raw/docs/agents/actors.md)
- [Channels](https://vitehub.dev/raw/docs/agents/channels.md)
- [Inspect and evaluate](https://vitehub.dev/raw/docs/agents/observability.md)
- [Advanced](https://vitehub.dev/raw/docs/agents/agent-presets.md)
- [Recipes](https://vitehub.dev/raw/docs/agents/support-agent.md)
- [Presets](https://vitehub.dev/raw/docs/agents/presets.md)
- [Capabilities](https://vitehub.dev/raw/docs/agents/capabilities/access.md)

Next: [Agent Actors](https://vitehub.dev/raw/docs/agents/actors.md)

All pages: [llms.txt](https://vitehub.dev/llms.txt)
