docs/documentation/platform/pam/product-reference/ai-session-insights.mdx
AI Session Insights is disabled by default and must be enabled per resource. Once enabled, it automatically generates a summary of what happened during a PAM session once it ends. Instead of manually reviewing raw logs, administrators get a concise, human-readable overview of the user's activity along with any flagged actions that may warrant further review.
<Warning> AI Session Insights are generated by a large language model and may not be fully accurate. Summaries and warnings should be used as a starting point for investigation, not as a definitive record of session activity. Always refer to the raw session logs for authoritative information. </Warning>When a session ends (whether the user disconnects, it times out, or an admin terminates it), Infisical asynchronously processes the session logs using the AI model configured for that resource. The model produces a structured output containing:
DROP TABLE on a production database or a rm -rf on a server). Each warning includes a short description and, for database sessions, a reference to the specific log entry.The insights are encrypted at rest using the same KMS key as the rest of your project's data.
AI Session Insights are currently supported for the following resource types:
AI Session Insights are configured per resource. To enable them:
<Steps> <Step title="Open the resource"> Navigate to your PAM project and click on the resource you want to configure. </Step> <Step title="Edit Session Recording settings"> On the resource detail page, click the **Edit** button in the **Session Recording** section. 
</Step>
<Step title="Enable AI Insights">
Toggle **AI Insights** on. Two additional fields will appear:
- **App Connection**: Select the Anthropic connection to use for generating summaries.
- **Model**: Choose the Claude model to use. We recommend **Claude Sonnet 4.6** for a balance of quality and cost, or **Claude Opus 4.6** for the most detailed analysis.

</Step>
<Step title="Save">
Click **Update Details** to save the configuration. AI Insights will be generated for all new sessions on this resource going forward.
</Step>
After a session ends, Infisical processes the logs and generates insights in the background. To view them:
For PostgreSQL sessions, each warning links directly to the relevant log entry so you can inspect the raw activity in context. SSH warnings do not include log entry references.