Sub topic 2
Granting Access with Permission Sets
Assume you know Salesforce users, objects, fields, sharing, Agentforce topics, and basic Apex or Flow. This chapter connects those controls into one permission model.
Granting Access with Permission Sets
A permission set is a reusable collection of permissions that supplements a user’s profile. Assign the smallest permission set that supports the agent’s job. Do not grant broad administrator access because an agent may be able to use every action available to its user.
For example, an agent that only reports order status needs read access to Order and its Status field:
<?xml version="1.0" encoding="UTF-8"?>
<PermissionSet xmlns="http://soap.sforce.com/2006/04/metadata">
<label>Agent Order Read</label>
<hasActivationRequired>false</hasActivationRequired>
<objectPermissions>
<allowCreate>false</allowCreate>
<allowDelete>false</allowDelete>
<allowEdit>false</allowEdit>
<allowRead>true</allowRead>
<modifyAllRecords>false</modifyAllRecords>
<object>Order</object>
<viewAllRecords>false</viewAllRecords>
</objectPermissions>
<fieldPermissions>
<editable>false</editable>
<field>Order.Status</field>
<readable>true</readable>
</fieldPermissions>
</PermissionSet>Sharing Rules and Field-Level Security
Object permission answers “may this user read orders?” Sharing answers “which order records may this user read?” Field-level security answers “which fields on those records may this user see?”
A permission set does not automatically bypass sharing. Avoid View All Data and broad object permissions. Test with records owned by different users and with fields that contain sensitive information.
> callout note > Granting object read access does not guarantee that the agent can return every record or every field.
Scoping an Agent with Topics
A topic defines a supported area of conversation. Use narrow topics, such as “Check My Order Status,” instead of a general customer-service topic. Attach only the actions needed by that topic.
Writing Instructions That Constrain Behavior
Instructions guide behavior but do not replace security permissions. Make them specific and testable:
- Answer only about the customer’s own orders.
- Never disclose another customer’s information.
- If the order is not found, ask for the order number again.
- Escalate refund, price, and account-change requests to a human.
Use permissions to enforce access, topics to limit capability, and instructions to define the expected response.
Exercise
An agent has read access to Order but should not answer refund requests. Which control should enforce access, and which should guide the refusal?
Show answer
Permission sets and sharing enforce data access. Topic actions and instructions should exclude refunds and direct the customer to a human.