Sub topic 8
Controlling what the agent and user see
This chapter assumes you can create an action in Agentforce Builder and know what an action output is. You should also know that an agent uses a large language model to write its replies.
Two separate audiences
An action output can reach two places:
- The agent. The agent reads the output, reasons over it, and uses it to write its reply or to choose its next step.
- The conversation. The user sees the output directly, for example as a card or a formatted block in the chat.
These are independent choices. An output can go to the agent only, to the user only, or to both. In Agentforce Builder, each output has two settings that control this: Filter from agent and Show in conversation. Exact names can differ slightly between releases, so check your org's builder.
What each setting does
- Filter from agent hides the value from the agent's reasoning. The agent cannot quote it, summarize it, or use it to decide what to do.
- Show in conversation displays the value to the user as part of the chat, whether or not the agent mentions it.
| Filter from agent | Show in conversation | Result |
|---|---|---|
| Off | Off | The agent reads the value and may mention it in its own words. The user sees nothing directly. |
| Off | On | The agent reads the value, and the user also sees it as shown content. |
| On | On | The user sees the value, but the agent does not. |
| On | Off | Neither sees it. The output is only useful if something else in the action consumes it. |
Choosing a setting
Use these rules of thumb:
- Return values the agent must explain to the agent only. A status such as
Activatedand a short message are good examples. The agent can phrase them naturally. - Show values the user must see exactly. Examples are a tracking link, a legal disclosure, or a table of line items. A model might paraphrase these or drop details. Showing them in the conversation avoids that.
- Filter large or sensitive payloads from the agent when the user should still see them. This keeps the agent's context small and keeps raw data out of its reasoning.
- Remove outputs nobody needs. If the agent never uses a value and the user never sees it, delete the output from the action. This is simpler than hiding it.
Common errors
- The agent contradicts what the user sees. The agent cannot see a filtered value, so it may guess about it. If you show a value but filter it from the agent, add a sentence to the topic instructions such as "The order details are shown to the customer. Do not describe them."
- The agent repeats a long value word for word. A large text output that the agent can read invites quoting. Return a short summary to the agent and send the long version to the conversation.
- A needed value is hidden. If the agent keeps asking the user for something the action already returned, check that the output is not filtered.
- The agent reads data it does not need. Extra outputs add noise. They also give the model more chances to mention something irrelevant.
Checking your choices
Test with the Builder's conversation preview. Run the action and compare three things: the reply text, the content shown in the conversation, and the reasoning trace. If a value appears in the trace, the agent can see it. If it appears in the chat as its own element, it is shown in the conversation. Change one setting at a time and rerun the same prompt.
Exercise
An action returns a Tracking Link that the customer must receive exactly as generated, and a Result Message such as "Your order shipped on Monday." How would you set visibility for each output, and why?
Show answer
Set Tracking Link to Show in conversation, so the exact URL reaches the user without the agent rewording it. Filter it from the agent only if the agent has no reason to refer to it. Otherwise leave it visible so the agent can say "your tracking link is below". Leave Result Message visible to the agent and do not show it in the conversation, so the agent restates it naturally.