> ## 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`.

export const ReleaseStageNotice = ({feature, stage, plans, contact, terms}) => {
  const stageTextMap = {
    "beta": "Beta",
    "ea": "Early Access"
  };
  const stageText = stageTextMap[stage] || "a product release stage";
  const prsLink = "/docs/troubleshoot/product-lifecycle/product-release-stages";
  const linkify = (text, url) => {
    return <a href={url} target="_blank" rel="noreferrer" class="link">{text}</a>;
  };
  const includeDetails = (plans, contact, terms) => {
    const hasDetails = terms || plans || contact;
    if (!hasDetails) return null;
    return <span data-as="p">
            {plans && <>This feature is available for {linkify(`${plans} plans`, "https://auth0.com/pricing")}. </>}
            {contact && "To participate, contact " + contact + ". "}
            {terms && <>By using this feature, you agree to the applicable Free Trial terms in Okta's {linkify("Master Subscription Agreement", "https://www.okta.com/legal")}.</>}
        </span>;
  };
  return <Warning>
            <span data-as="p">
                <strong>The {feature} feature is in {linkify(stageText, prsLink)}.</strong>
            </span>

            {includeDetails(plans, contact, terms)}
        </Warning>;
};

<ReleaseStageNotice feature="Agents as Principal" stage="ea" contact="Auth0 Support" terms="true" />

When a token is issued for an agentic interaction, Auth0 includes the `agent_id` (or `external_agent_id`, when 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](/docs/deploy-monitor/logs/log-search-query-syntax) and [Log Streams](/docs/customize/log-streams).
