# detectAiAgent

**Kind:** Function

**Source:** [`atloria-monorepo/apps/api/src/events/agent-detect.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/apps/api/src/events/agent-detect.ts#L42)

Classify a User-Agent for agent-read recording.
 - Known AI bot           → its normalized vendor name.
 - Empty / scripted UA    → 'Other bot' (record it — it's not a human).
 - Real browser           → null (don't record; that's page-view analytics).
 - Anything else unknown  → 'Other bot' (better to log than to lose the signal).

## Signature

```ts
function detectAiAgent(userAgent: string | null): string | null
```

## Parameters

| Name | Type |
|---|---|
| `userAgent` | `string | null` |

**Returns:** `string | null`
