Sub topic 15
Audit Trail and Feedback Data
This chapter assumes you know the earlier steps in the Trust Layer pipeline: grounding, data masking, the LLM gateway, toxicity detection, and demasking. Audit is the last recorded step before the user sees the response.
What the audit trail records
The audit trail is a log of each generative AI interaction that passes through the Trust Layer. It helps an admin answer questions after the fact. What did the user ask? What data was added to the prompt? What came back? Did any safety check fire?
Typical audit data includes:
- The original prompt, before masking.
- The masked prompt that was sent to the model.
- The raw response from the model.
- The toxicity score and category results.
- The final response after demasking.
- Feedback signals, if the user gave any.
The exact fields, storage location, and retention period depend on your edition, features, and release. Check current Salesforce documentation before you promise a specific field to an auditor.
Where it sits in the flow
Toxicity results are part of the record, so a response that scored badly is still traceable. The audit entry holds both masked and unmasked versions, so you can see what left Salesforce and what the user saw.
Feedback data
Feedback data is the user's own reaction to a response, such as a thumbs up or thumbs down, and sometimes a free-text comment. It is stored with the interaction it refers to. This gives you a way to find weak prompts, poor grounding, or agent instructions that confuse the model.
Audit data and feedback data answer different questions:
| Data | Question it answers | Who creates it |
|---|---|---|
| Audit trail | What happened in this interaction? | The Trust Layer, automatically |
| Feedback data | Was the result useful? | The user, optionally |
Using the data as an admin
A practical review routine looks like this:
- Filter for interactions with negative feedback.
- Open the matching audit record and compare the masked prompt with the final response.
- Check whether the grounding data was missing, stale, or wrong.
- Check whether toxicity detection flagged the response.
- Change the prompt template, agent instructions, or data, then test again.
Common errors
- Assuming the audit trail proves the answer was correct. It records what happened, not whether the content was accurate.
- Ignoring feedback because few users give it. Low volume still points to real problems.
- Granting broad access to audit data for convenience.
Exercise
A user gives a thumbs down to an agent's case summary. Which two pieces of audit data would you compare first to find the cause, and why?
Show answer
Compare the masked prompt (which shows what grounding data the model actually received) with the final response. If the prompt lacked key case details, the problem is grounding or permissions. If the prompt was complete but the response was poor, the problem is the prompt template or agent instructions. Also check the toxicity result to rule out a safety flag.