> ## Documentation Index
> Fetch the complete documentation index at: https://auth0.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent ID in Tenant Logs

> Track agent activity through Auth0 tenant logs using `agent_id` or `external_agent_id`.

> [!WARNING]
>
> **The Agent as Principal feature is in .**

When a token is issued for an agentic interaction, Auth0 includes both the `agent_id` and `external_agent_id`, if set, in the resulting tenant log entry.

## Supported grant types

Auth0 records agent identity in logs for the following grant types:

* `client_credentials` grants from agent-linked clients
* `refresh_token` grants for agent-linked clients
* OBO token exchange grants
* Standard login grants where the client is agent-linked

## Query logs

You can query the `agent_id` via the Management API log endpoints, enabling per-agent audit and anomaly detection:

```http theme={null}
GET /api/v2/logs?q=agent_id:agt_72jbvv7LfRKYp59gtRLtkn
```

To learn more about querying and streaming tenant logs, read [Log Search Query Syntax](https://auth0.com/docs/deploy-monitor/logs/log-search-query-syntax.md) and [Log Streams](https://auth0.com/docs/customize/log-streams.md).
