Sub topic 17
Access, Masking, and Governance
This chapter assumes you know Salesforce permission sets and sharing basics, and that you have built a search index and retriever over Knowledge content. Here you will see which controls shape what a grounded answer can contain, and where those controls stop.
Who can see what
A retriever returns chunks from a search index. The index is built from Data Cloud data, not read live from Salesforce Knowledge. That has a direct consequence: Knowledge visibility rules, such as data categories and channel settings, do not automatically follow the content into Data Cloud.
Treat the index as a copy with its own access model. Check three layers:
- Source selection. Only articles that pass your ingestion criteria enter Data Cloud. Publish only what is meant for the audience, and keep internal-only articles out of the ingested set.
- Retriever filters. A filter on a field such as language, channel, or a custom audience field narrows results at query time. This is your main tool for separating customer-facing from internal content inside one index.
- Who runs the agent. The agent's running user and the Data Cloud permission sets decide who can use the retriever and the data behind it.
SELECT Id, Title, IsVisibleInPkb, IsVisibleInCsp, IsVisibleInPrm
FROM Knowledge__kav
WHERE PublishStatus = 'Online'
AND Language = 'en_US'This query shows which published articles are marked visible in the public knowledge base, the customer portal, and the partner portal. Use it to decide which flags to map into the index and filter on.
Masking and the Trust Layer
Retrieved text can contain personal data, such as an email address in an example. The Einstein Trust Layer can mask sensitive values before the prompt reaches the large language model (LLM), then restore them in the response. It also supports zero data retention agreements with the model provider, and it records an audit trail.
Masking depends on configuration. Review which data types are masked in Einstein Trust Layer setup, and test with realistic text. Masking protects the prompt in transit to the model. It does not replace deciding what belongs in the index.
Governance habits
- Keep ingestion and the source in sync. When you unpublish or archive an article, confirm it also leaves the index. A stale chunk can still be retrieved and quoted.
- Limit returned fields. Return only the fields the prompt needs. Fewer fields mean less data in the prompt and in logs.
- Review audit data. Use Trust Layer audit records to check what was sent and what came back when a customer disputes an answer.
- Test as different users. Run the same question as each audience and compare the results.
Common errors
| Symptom | Likely cause |
|---|---|
| Customer sees internal guidance | Internal articles were ingested and no audience filter was set |
| Archived article still quoted | Index not yet refreshed after the source change |
| Personal data appears in answer text | The data is in the article itself, so it is returned legitimately |
Exercise
An article marked internal-only is unpublished from the customer channel, but the agent still quotes it. Name two places to check and one control that would have prevented it.
Show answer
Check whether the article is still in the ingested Data Cloud data and whether the search index has refreshed since the change. An audience filter on the retriever, or excluding internal articles at ingestion, would have prevented it.