> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/maiagent-user-guide/ja/hook/execution-logs.md).

# Hook 実行ログ

各 Hook のインターセプトや書き換えの記録を確認し、元のメッセージ内容を記録するかどうかを制御し、対話から個別メッセージの Hook 実行詳細を追跡します。

Hook の各インターセプト、書き換え、通過はすべてログに記録されます。規制対象の業種（金融、医療、政府）にとって、**「追跡可能性」はそれ自体がコンプライアンス要件です**——問題が発生した際に「どのメッセージが、どのルールに、どのような処置を受け、いつ行われたか」を追跡できる必要があります。

## <mark style="color:blue;">一、実行ログの確認</mark> <a href="#view-logs" id="view-logs"></a>

左側メニューから <mark style="color:blue;">AgentOps</mark> → <mark style="color:blue;">Hook 実行ログ</mark> に進みます。各実行エントリについて以下の情報を確認できます：

* **時間**——発生日時
* **アシスタント**——どの AI アシスタントがトリガーしたか
* **ヒットルール**——どの Hook が処理したか
* **処置**——何が行われたか（マスキング・書き換え／ブロック／通過）
* **ステータス**——処理結果

**日付範囲、アシスタント、キーワード**でフィルタリングでき、**レポートのエクスポート**も可能で、さらなる監査分析に活用できます。ページ上部には**総実行回数、ヒット回数、ヒット率**の統計も表示されます。

### 個別ログの詳細確認 <a href="#log-detail" id="log-detail"></a>

任意のログエントリをクリックすると、その処置の完全なコンテキストが表示されます：**基本情報（Hook 名、タイプ、トリガーポイント、アクション、結果）、関連情報、メッセージ内容**が表示され、システムが何を行ったかを明確に把握できます。

## <mark style="color:blue;">二、元のメッセージを記録するかどうかの制御</mark> <a href="#log-privacy-toggle" id="log-privacy-toggle"></a>

実行ログはデフォルトで\*\*「処置結果」のみを記録し、元の機密コンテンツは保持しません\*\*——これは個人情報や機密メッセージがログ内に再び保存されることを防ぐためです。

デバッグ段階で「元の内容がどのようなものだったか」を確認する必要がある場合は、Hook の設定ページで <mark style="color:blue;">マスキング前の元の値を記録</mark> のスイッチを `off` から `on` に変更してください。有効にすると、ログにマスキング前・ブロック前の元のコンテンツが追加で保持され、問題の調査が容易になります。

{% hint style="warning" %}
**プライバシーのトレードオフ：**「元の値を記録」を有効にすると、元の個人情報やメッセージ内容が実行ログに保存されることになります。**セキュリティの観点から、通常はオフのままにしておくことを推奨します**。トラブルシューティングが必要な場合にのみ一時的に有効にしてください。
{% endhint %}

## <mark style="color:blue;">三、対話から Hook 実行詳細を確認する</mark> <a href="#from-conversation" id="from-conversation"></a>

集約された実行ログに加えて、**実際の対話から遡って追跡する**こともできます：<mark style="color:blue;">カスタマーサポート</mark> → <mark style="color:blue;">すべての対話</mark> に進み、任意の対話を開くと、その対話内のどのメッセージが Hook によって処理されたか（マスキングまたはブロック）と、対応する処置を確認できます。

これにより、顧客の対話を確認する際に「なぜこのメッセージがマスキング／ブロックされたのか」をその場で理解でき、ログを別途照合する必要がありません。

## <mark style="color:blue;">四、関連ページ</mark> <a href="#related" id="related"></a>

* [Hook メッセージインターセプト概要](/maiagent-user-guide/ja/hook/hook.md)——Hook とは何か、5 種類の標準テンプレート
* [Hook の追加と設定](/maiagent-user-guide/ja/hook/setup.md)——作成方法、パラメータ設定、AI アシスタントへの関連付け


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.maiagent.ai/maiagent-user-guide/ja/hook/execution-logs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
