Sub topic 3
Audit trail and feedback data
This chapter covers the data the Einstein Trust Layer records about each model call, and the feedback signals users leave. It sits between the conversation data from the previous chapter and the analytics chapter that follows. I assume you know what a prompt, grounding, and an Agentforce action are, and that you have Setup access in an org with Agentforce. Feature names and object names change between releases, so check them against your org before you rely on them.
What the audit trail is and why it exists
A conversation record tells you what the customer and the agent said, and which topic and actions ran. It does not show what was actually sent to the large language model (LLM) or how the Trust Layer treated it on the way. The Trust Layer audit trail fills that gap.
The Einstein Trust Layer is the set of controls that sit between Salesforce and the LLM. For each model call, the audit trail can record:
- The original prompt, after grounding data was merged in.
- The masked prompt, in which sensitive values such as names or emails were replaced with placeholders before leaving Salesforce.
- The raw LLM response and the final response shown to the user.
- Safety scores, such as toxicity detection results, for the prompt and the response.
- Feedback, such as a thumbs up or thumbs down and any comment, tied to the generation it refers to.
The audit trail is storage and evidence. It is not a dashboard. You read it with queries or reports, and the analytics chapter covers how to turn it into trends.
How the data flows
The audit and feedback data is stored in Data 360 (formerly Data Cloud). That has two consequences. First, you must turn the feature on and have Data 360 provisioned before any data exists. Second, access to the data is controlled through Data 360 permissions, not through ordinary object sharing on a Salesforce record.
Notice that feedback arrives later than the audit records and as a separate event. Your analysis has to join the two on a generation identifier. It will not find them in the same row.
Turning it on
Setup steps vary by release, but the pattern is stable:
- Confirm that Data 360 is provisioned in the org.
- In Setup, find the Einstein Generative AI settings and enable the audit and feedback data option. This is often named something like "Einstein Generative AI Audit and Feedback Data".
- Grant the right people access to the Data 360 objects that hold the records.
- Run a few test conversations and confirm that rows appear.
What the records look like
The data lands in Data Model Objects (DMOs). A DMO is a standard table-like structure in Data 360. The generative AI audit data is split across several DMOs. Names usually start with GenAI, for example for gateway requests, gateway responses, generations, content quality, and feedback. Treat that naming as a pointer. Open the Data 360 data explorer in your org to see the exact objects and fields you have.
The records relate roughly like this:
| Record kind | Answers the question | Typical use |
|---|---|---|
| Request | What prompt went to the model, after masking? | Checking that grounding was present and that sensitive values were masked |
| Response | What did the model return? | Comparing raw output with what the user saw |
| Content quality | Did safety checks flag the prompt or response? | Finding toxic or blocked outputs |
| Feedback | Did a user rate the response? | Locating responses users disliked |
Feedback data and its limits
Feedback is an explicit signal. A user rates a response, and may add a comment. It is valuable because it is the user's own judgment, and it points at a specific generation.
It also has well-known weaknesses:
- Low volume. Most users never click anything, so a feedback count is a small sample.
- Self-selection. People who are annoyed rate more often than people who are satisfied.
- Ambiguity. A thumbs down on an accurate but unwelcome answer, such as a refusal of a refund, is not a bug.
- No cause. Feedback says that something was wrong, not why. You still need the reasoning trace from a later chapter to find the cause.
Because of this, use feedback to choose which conversations to read. Do not use it as your success metric by itself. Pair it with outcome measures such as resolution and escalation, which the metrics chapter covers.
Joining feedback to conversations
In practice you export or query the feedback and conversation data, then join them. The sketch below shows the idea on made-up records. The field names are illustrative and are not an Agentforce schema. In your org, replace them with the real field names you found in the data explorer.
from collections import defaultdict
# Hypothetical exports. Field names are illustrative only.
generations = [
{"generation_id": "g1", "session_id": "s1", "topic": "Order Status"},
{"generation_id": "g2", "session_id": "s2", "topic": "Returns"},
{"generation_id": "g3", "session_id": "s3", "topic": "Returns"},
{"generation_id": "g4", "session_id": "s4", "topic": "Order Status"},
]
feedback = [
{"generation_id": "g2", "rating": "down", "comment": "Gave a delivery date"},
{"generation_id": "g3", "rating": "down", "comment": ""},
{"generation_id": "g4", "rating": "up", "comment": ""},
]
by_generation = {g["generation_id"]: g for g in generations}
down_by_topic = defaultdict(list)
for f in feedback:
gen = by_generation.get(f["generation_id"])
if gen is None:
continue # feedback with no matching generation record
if f["rating"] == "down":
down_by_topic[gen["topic"]].append(gen["session_id"])
rated = len({f["generation_id"] for f in feedback})
print(f"Rated generations: {rated} of {len(generations)}")
for topic, session_ids in down_by_topic.items():
print(f"{topic}: {len(session_ids)} thumbs down -> review sessions {session_ids}")The output gives you a review queue: Returns has two thumbs-down sessions to open first. It also shows that only three of four generations were rated, which is a reminder of how thin feedback coverage can be.
Common mistakes
- Assuming the audit trail is on by default. If the feature was never enabled, queries return nothing, and the empty result looks like "no problems".
- Reading counts as rates. Ten thumbs down means little without the number of generations that had a chance to be rated.
- Treating masked text as the user's words. The masked prompt contains placeholders. To see what the customer wrote, use the conversation record, within your access rules.
- Skipping the join key. Feedback tied to a generation, not a session, can match several generations in one session. Decide how you will count per session before you compare topics.
- Ignoring retention. Check how long your org keeps this data. A monthly review that needs three months of history will fail if older records were removed.
What to carry forward
The audit trail answers "what exactly happened at the model boundary", and feedback answers "which responses did users dislike". Together they feed the analytics dashboards and give you a ranked list of conversations to review. They do not diagnose a failure on their own.
Exercise
A team enabled the audit and feedback option two weeks after launch. In week three, a manager asks you to count thumbs-down ratings for the first week and says feedback shows the Returns topic is fine because it has few thumbs down. Give two reasons the conclusion is unsafe.
Show answer
First, no audit or feedback records exist for the first two weeks, because data is only recorded after the feature is enabled, so the first-week count cannot be produced. Second, a low thumbs-down count is not evidence of quality. Feedback has low volume and self-selection bias, and the count must be compared with the number of generations that could have been rated. Check resolution and escalation rates for Returns and review sample conversations before concluding anything.