Sub topic 16
Choosing Between a Service Agent and an Employee Agent
This chapter assumes you know the basics from earlier chapters. You should know how topics, instructions, and actions fit together, and what an agent user and a running user are. You should also know how channels and escalation work. Here you use that knowledge to decide which agent type fits a business use case.
Start with the audience
The first question is who talks to the agent.
- A service agent talks to customers or other people outside your company. They are often anonymous or only lightly verified.
- An employee agent talks to signed-in internal users. Each one is a known Salesforce user.
Most other differences follow from this answer. The audience decides which identity the agent uses, which channels can reach it, how much data it can safely return, and what happens when it gets stuck.
The four decision factors
Identity and access
A service agent runs as an agent user. This is a dedicated user record with its own permission sets. Every customer who talks to the agent gets the same access, because the agent user's permissions define the ceiling.
An employee agent acts as the running user, the employee who is chatting. The employee's own profile, permission sets, and sharing rules decide what the actions can return. Two employees asking the same question can get different answers.
This is why the Apex example in the spine uses with sharing. Under an employee agent, the class respects the employee's record access. Under a service agent, it respects the agent user's access.
| Factor | Service agent | Employee agent |
|---|---|---|
| Who runs the actions | Agent user | Running user (the employee) |
| Data visibility | Fixed by the agent user's permissions | Varies by employee |
| Risk if over-permissioned | Data exposed to any customer | Data exposed to the employee who already has access |
| Main control | Least-privilege permission sets on the agent user | Existing user permissions and sharing |
Channels
Service agents run on customer-facing channels such as an Experience Cloud site or messaging. Employee agents run where employees already work, such as inside Salesforce or an internal collaboration tool. Check the channel list in your org before you commit, because channel support differs by agent type and changes between releases.
Escalation
A service agent needs a way out. When it cannot resolve a request, it hands off to a human through Omni-Channel, so the customer is not stuck. You must plan queues, routing, and agent availability.
An employee agent usually has no handoff. If it fails, the employee can open the record, run the report, or ask a colleague. The instructions typically tell the agent to say it cannot help and suggest contacting an administrator, as in the My Open Cases example.
Tone and risk
A customer-facing agent represents your brand. Its instructions should be tight, its scope narrow, and its refusals clear. An employee agent can be more permissive about what it summarizes, because the user is trusted and already authorized.
Decision flow
Worked example: order status
Take the Get Order Status action from the spine. It is the same Apex method in both cases, but the surrounding design changes.
As a service agent. A customer asks, "Where is my order?" The agent user must be able to read Order records, but only what a customer should see. You grant that permission set to the agent user and nothing more. You also decide how to stop a customer from guessing order numbers. The topic asks for an order number, and escalation applies when the action returns Order not found.
Topic: Order Status
Classification description: Customer asks where an order is or what state it is in.
Scope: Look up the status of a single order using the Get Order Status action.
Instructions:
- Ask for the order number if the customer has not given one.
- Call the Get Order Status action with that order number.
- Report only the status returned by the action.
- If the action returns 'Order not found', ask the customer to check the number once, then offer to connect them with a human agent.
- Do not discuss refunds or cancellations in this topic.As an employee agent. A support rep asks the same question. The rep's own sharing rules decide whether the order is visible. If the rep cannot see it, the query returns nothing and the action reports Order not found. No agent user permission set is needed for this topic, and no handoff exists. The instructions would replace "connect them with a human agent" with a suggestion to check with a manager or administrator.
Topic: Order Status (Employee)
Classification description: An employee asks where a customer's order is or what state it is in.
Scope: Look up the status of a single order using the Get Order Status action.
Instructions:
- Ask for the order number if the employee has not given one.
- Call the Get Order Status action with that order number.
- Report only the status returned by the action.
- If the action returns 'Order not found', say the order may not exist or may not be visible to the employee, and suggest contacting their administrator.The action code is identical. Identity, instructions, and escalation are what change.
Edge cases and common mistakes
- Reusing a service agent for staff. Employees get the agent user's narrow access instead of their own. They may see too little, and you cannot tell users apart in the results.
- Reusing an employee agent for customers. The running-user model assumes a signed-in Salesforce user. External users do not fit it. Use a service agent for them.
- Over-permissioning the agent user. Granting broad access "so the demo works" exposes that data to every customer conversation. Start with no access, then add object and field permissions as tests fail.
- Ignoring
with sharing. A custom action declaredwithout sharingbypasses record access rules. It can leak data under either agent type, so review each custom Apex class. - Missing handoff capacity. A service agent that escalates into an empty queue only moves the failure to a later point. Confirm that staffed Omni-Channel queues exist before activation.
- Copying topics unchanged. Instructions that mention "the customer" or "connect with a human" read oddly and behave wrongly for employees. Rewrite them for the audience.
When you need both
Many organizations deploy both types for the same business area. A retail company might have a service agent that answers order questions for shoppers and an employee agent that lets support reps summarize their open cases. They share a Get Order Status action, which is built once and reused. They differ in topics, identity, channels, and escalation. Plan shared actions as reusable building blocks and keep each agent's topic instructions separate.
Quick checklist
- Name the audience: external or internal.
- Choose the identity model: agent user or running user.
- List the data the agent must read and write, and check it against the permissions of that identity.
- Pick channels that reach the audience.
- Decide the failure path: human handoff or a message that points to an administrator.
- Test with a realistic user of that audience before activation.
Exercise
A company wants one assistant that shows managers a summary of their own team's cases. Cases are visible only to the owner's management chain through sharing rules. Which agent type fits, and why?
Show answer
An employee agent. The audience is internal and signed in. The actions run as the running user, so sharing rules limit each manager to cases they are allowed to see. A service agent would use one agent user for everyone and could not enforce the per-manager rules.
Exercise
You are building a service agent for order status. The first test works, but you realize the agent user has the "View All Data" permission. What should you do, and what could happen if you leave it?
Show answer
Remove the broad permission and give the agent user a permission set with only the object and field access that order status needs. Leave it in place and any customer could get data the agent can reach, because the agent user's permissions apply to every conversation.
Exercise
Name two instruction changes you would make when moving the Order Status topic from a service agent to an employee agent.
Show answer
Change the wording from "the customer" to "the employee", and replace the handoff to a human agent through Omni-Channel with a suggestion to contact an administrator. You could also add that an empty result may mean the order is not visible to that employee.