---
title: How do you audit Agentforce agent sessions with Session Tracing?
url: https://opencontroller.lyzr.com/blog/audit-agentforce-sessions-with-session-tracing
published: 2026-11-13
updated: 2026-11-13
author: Lyzr
---

# How do you audit Agentforce agent sessions with Session Tracing?

**Turn on Agentforce Session Tracing and Salesforce writes every agent session to Data 360 as linked records: the session, each conversational turn, each step inside the turn (user input, LLM call, action) and each message. You audit by querying those objects. Steps hold the action name, its input and output, and any error.**

When an Agentforce agent updates a case or issues a refund, an auditor will ask three things: what was asked, what the agent decided, and what it changed. Session Tracing is the native source for all three. This guide covers enablement, the data model and query patterns.

## How do you enable Session Tracing?

1. Confirm **Data 360** (Data Cloud) and **Einstein** are enabled in the org.
2. Check the **Salesforce Standard Data Model** is version 1.130 or higher.
3. Go to **Setup → Einstein Audit, Analytics, and Monitoring Setup** and turn on **Agentforce Session Tracing**.
4. Make sure the admins who will query the data hold the Data Cloud Architect permission set.
5. Optionally install **Agent Analytics** for dashboards on effectiveness, usage, quality and trust.

Data lands in Data 360, so check how storage and processing are metered under your contract before you turn it on in every org.

## What does the data model look like?

Session Tracing uses a hierarchy of data model objects (DMOs):

| Object | API name | One record per | Key fields |
|---|---|---|---|
| AI Agent Session | `ssot__AiAgentSession__dlm` | Conversation | Channel, start and end time, end type (resolved, escalated, deflected), owner, linked messaging session or voice call |
| AI Agent Session Participant | `ssot__AiAgentSessionParticipant__dlm` | Human or agent in the session | Participant identity and role |
| AI Agent Interaction | `ssot__AiAgentInteraction__dlm` | Turn | Topic API name, start and end time, telemetry trace ID, previous interaction |
| AI Agent Interaction Step | `ssot__AiAgentInteractionStep__dlm` | Step within a turn | Step type, name, input, output, error, GenAI gateway request and response IDs |
| AI Agent Interaction Message | `ssot__AiAgentInteractionMessage__dlm` | Message | Input or output, content text, sent time, participant |

Step types include **UserInputStep**, **LLMExecutionStep** and **FunctionStep**. For a FunctionStep, `ssot__Name__c` is the action name, which is the field auditors care about most.

`ssot__PreviousSessionId__c` on the session links hand-offs between agents, so multi-agent conversations can be stitched together.

## What queries make a useful audit trail?

Run these in Data 360 Query Editor or through the Query API.

**1. Every action an agent ran in the last 7 days**

```sql
SELECT s.ssot__Id__c, st.ssot__Name__c, st.ssot__StartTimestamp__c,
       st.ssot__ErrorMessageText__c
FROM ssot__AiAgentInteractionStep__dlm st
JOIN ssot__AiAgentInteraction__dlm i ON st.ssot__AiAgentInteractionId__c = i.ssot__Id__c
JOIN ssot__AiAgentSession__dlm s ON i.ssot__AiAgentSessionId__c = s.ssot__Id__c
WHERE st.ssot__AiAgentInteractionStepType__c = 'FunctionStep'
  AND st.ssot__StartTimestamp__c >= current_date - INTERVAL '7' DAY
```

**2. Failed actions.** Filter the same query on `ssot__ErrorMessageText__c IS NOT NULL`.

**3. Topic drift.** Count interactions by `ssot__TopicApiName__c` per week. A new topic appearing, or a sudden shift, is worth a look.

**4. Escalation rate.** Group sessions by `ssot__AiAgentSessionEndType__c`.

**5. Full replay of one session.** Pull messages ordered by `ssot__MessageSentTimestamp__c`, then steps ordered by start time.

## What should an audit check?

1. **High-impact actions.** List every FunctionStep that writes data, such as updating records, sending email or issuing credits. Confirm each maps to an approved action.
2. **Inputs and outputs.** Sample FunctionSteps weekly and confirm the inputs match the user's request.
3. **Errors.** Track error rate per action. Repeated failures often mean a permission or data problem.
4. **LLM linkage.** Use the GenAI gateway request IDs on LLMExecutionSteps to join to Einstein Trust Layer records when you need the prompt and response detail. See our explainer on the [Einstein Trust Layer](/blog/salesforce-einstein-trust-layer-explained).
5. **Retention.** Confirm how long trace data is kept in your org and export what your policies require to longer-term storage.
6. **Evidence pack.** Save the queries, their outputs and the reviewer's sign-off. That is the artefact an audit asks for.

## Where does Session Tracing stop?

It covers agents running inside Salesforce. It does not show agents on other platforms that call Salesforce APIs, or developers' coding agents touching Salesforce metadata. It is also a record, not a control: it tells you what happened, after it happened. Pre-deployment testing is covered in our guide to [testing Agentforce agents](/blog/test-agentforce-agents-before-deployment).

## How Opencontroller does this

Opencontroller connects to Salesforce as a third-party agent platform. Agentforce agents appear in the same governed registry as agents on AWS, Azure, Google Cloud, SAP, Databricks and HubSpot, with owners and versions. Posture flags risky permissions and configuration, LLM judges can score production traffic, and per-agent Block and Quarantine act through the connected platform. Policy as code maps controls to OWASP, MITRE ATLAS, NIST and ISO 42001 as evidence. See the [Agentforce governance guide](/blog/govern-salesforce-agentforce-agents), the [cross-platform pillar](/blog/how-to-govern-ai-agents-across-platforms), or [book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Does Session Tracing capture the agent's reasoning?**
It captures steps, including LLM execution steps with input and output values, and links to GenAI gateway records. Treat it as a record of what the agent did, not a full explanation of why.

**Can I trace one conversation across several agents?**
Yes. The session's previous-session field links hand-offs, and interactions chain through a previous-interaction field.

**Is Session Tracing enough for audit evidence?**
It is strong evidence for Salesforce-hosted agents. You still need an inventory of agents elsewhere; see [how to find shadow AI agents](/blog/how-to-find-shadow-ai-agents).

## Key facts

Agentforce Session Tracing records agent activity in Salesforce Data 360 (Data Cloud). Enable it in Setup under Einstein Audit, Analytics, and Monitoring Setup; prerequisites are Data 360 and Einstein enabled and Salesforce Standard Data Model v1.130 or higher. Core data model objects: AI Agent Session (ssot__AiAgentSession__dlm), AI Agent Session Participant, AI Agent Interaction (ssot__AiAgentInteraction__dlm, one per turn, with topic and telemetry trace ID), AI Agent Interaction Step (ssot__AiAgentInteractionStep__dlm: UserInputStep, LLMExecutionStep, FunctionStep, with input, output, error and GenAI gateway request IDs) and AI Agent Interaction Message (ssot__AiAgentInteractionMessage__dlm). Opencontroller by Lyzr connects to Salesforce as a third-party agent platform for discovery, registry and per-agent Block and Quarantine. Pricing starts from $250K per deployment per year.

## Related

- [How do you govern Salesforce Agentforce agents?](https://opencontroller.lyzr.com/blog/govern-salesforce-agentforce-agents.md)
- [What does the Salesforce Einstein Trust Layer cover for agents?](https://opencontroller.lyzr.com/blog/salesforce-einstein-trust-layer-explained.md)
- [How do you test Salesforce Agentforce agents before deployment?](https://opencontroller.lyzr.com/blog/test-agentforce-agents-before-deployment.md)
- [More on Platform Guides](https://opencontroller.lyzr.com/blog/cluster/platform-guides)
