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

# テナントログのエージェント ID

> `agent_id` または `external_agent_id` を使って、Auth0 のテナントログでエージェントのアクティビティを追跡します。

export const ReleaseStageNotice = ({feature, stage, plans, contact, terms}) => {
  const stageTextMap = {
    "beta": "Beta",
    "ea": "早期アクセス"
  };
  const stageText = stageTextMap[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 && <>この機能は{linkify(`${plans}プラン`, "https://auth0.com/pricing")}でご利用いただけます。 </>}
            {contact && "参加をご希望の場合は、" + contact + "までお問い合わせください。 "}
            {terms && <>この機能を使用することにより、Oktaの該当する無料トライアル規約および{linkify("Master Subscription Agreement", "https://www.okta.com/legal")}に同意したものとみなされます。</>}
        </span>;
  };
  return <Warning>
            <span data-as="p">
                <strong>{feature}機能は現在、{linkify(stageText, prsLink)}です。</strong>
            </span>

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

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

エージェントによる操作に対してトークンが発行されると、Auth0は生成されるテナントログのエントリに、`agent_id`と、設定されている場合は`external_agent_id`の両方を含めます。

<h2 id="supported-grant-types">
  サポートされる付与タイプ
</h2>

Auth0は、次の付与タイプについてエージェントのアイデンティティをログに記録します：

* エージェントに紐付けられたクライアントからの`client_credentials`付与
* エージェントに紐付けられたクライアントに対する`refresh_token`付与
* OBOトークン交換の付与
* クライアントがエージェントに紐付けられている場合の標準的なログインの付与

<h2 id="query-logs">
  ログのクエリ
</h2>

Management API のログエンドポイントから `agent_id` をクエリできるため、エージェント単位の監査や異常検知が可能になります。

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

テナントログのクエリとストリーミングについて詳しくは、[ログ検索クエリ構文](/docs/ja-jp/deploy-monitor/logs/log-search-query-syntax)と[ログストリーム](/docs/ja-jp/customize/log-streams)をご覧ください。
