Sub topic 7
Employee agents: assistants for internal users
This chapter assumes you know basic Salesforce concepts (objects, records, permission sets) and have read the earlier chapters on topics, instructions, and actions. Here you will see how an employee agent differs from a service agent and how to write a topic for one.
What an employee agent is
An employee agent is an Agentforce agent that helps people inside your company. Employees ask it questions or ask it to do tasks, such as summarizing their open cases or finding a policy. A service agent, by contrast, talks to customers.
The building blocks are the same: topics, instructions, and actions. The differences are who the user is and what data the agent may return.
Identity: the user's own permissions
A service agent usually runs as a dedicated agent user with its own permissions. An employee agent works on behalf of the employee who is chatting with it. The employee's permissions decide what each action can return.
This has a practical effect. Two employees can ask the same question and get different answers, because each can see different records. The agent adds no access that the employee lacks.
Where employee agents run
Employee agents run in places where employees already work, such as Salesforce apps and internal messaging tools. They do not run on public customer channels. Because the user is already signed in, the agent does not need to ask who they are.
Writing a topic for an employee agent
A topic has a classification description, a scope, and instructions. The description helps the agent decide when to use the topic. The instructions tell it which action to call and where its limits are.
Topic: My Open Cases
Classification description: An employee asks about support cases assigned to them or their team.
Scope: Summarize cases the employee already has permission to view.
Instructions:
- Use the Get Open Cases action to retrieve cases for the current user.
- Present each case with its number, subject, and status.
- If the employee asks about data they cannot access, say that you cannot show it and suggest contacting their administrator.Notice three things:
- The scope names a limit: only cases the employee may already view.
- The instructions name the action to call, so the agent does not guess.
- The last instruction gives a clear response for blocked data, instead of leaving the agent to improvise.
Common errors
- Treating the agent as a permission boundary. Instructions guide behavior, but access is enforced by permissions and sharing. Fix access in permission sets and sharing, not in the prompt.
- Actions that skip sharing. An Apex action declared
without sharingcan expose records. Usewith sharingunless you have a reviewed reason not to. - Vague classification descriptions. If two topics sound alike, the agent may pick the wrong one. Make each description specific to one kind of request.
- Copying service wording. Phrases such as "ask the customer to check the number" do not fit employees. Write instructions for an internal audience.
Exercise
An employee asks your agent for cases owned by another team. The employee's profile cannot view those cases. What should happen, and where is that enforced?
Show answer
The action returns no data for those cases, and the agent says it cannot show them and suggests contacting an administrator. Access is enforced by the employee's permissions and sharing rules, together with with sharing in the Apex action. The topic instructions only shape the wording of the reply.
Exercise
How does the identity of an employee agent differ from that of a typical service agent?
Show answer
A service agent typically runs as a dedicated agent user with its own permissions. An employee agent acts for the signed-in employee, so that employee's permissions govern what actions return.