Sub topic 6
Assigning permission sets
This chapter assumes you have a Developer Edition org with Agentforce enabled in Setup, and that you can open Setup as a System Administrator. It also assumes you know what a permission set is: a bundle of permissions you add to a user without changing their profile.
Why permissions come before the builder
Agentforce Builder is hidden from users who lack the right permissions. The Setup menu simply doesn't show it. An agent also runs as a user, and that user's access limits what the agent can read and do. You therefore deal with two kinds of access:
- The builder: the admin who creates, edits, and tests agents.
- The agent user: the identity the agent runs as when it calls actions and reads records.
Find the permission sets in your org
Permission set names change between releases, so look them up in your org instead of copying a name from a blog post. In Setup, open Users, then Permission Sets, and search for "Agent" and "Prompt". You can also query them with the Salesforce CLI, using the alias from the earlier login step:
sf data query \
--query "SELECT Name, Label FROM PermissionSet WHERE Label LIKE '%Agent%' OR Label LIKE '%Prompt%'" \
--target-org agentforce-devName is the API name you need for CLI assignment. Label is what you see in Setup. Look for sets that cover building and managing agents, sets for the agent user, and Prompt Builder access (usually a set with "Prompt Template" in its name). Read each set's description before you assign it.
Assign a permission set in Setup
- Go to Setup > Users > Permission Sets.
- Click the permission set name.
- Click Manage Assignments, then Add Assignment.
- Select your admin user and click Next, then Assign.
Repeat for each set your admin needs. Log out and back in if the builder doesn't appear straight away.
You can also assign from the terminal. Replace Your_PermSet_ApiName with a Name value from the query above:
sf org assign permset --name Your_PermSet_ApiName --target-org agentforce-devGive the agent user access to your data and code
Assigning builder permissions doesn't give the agent access to your custom work. When you add the Apex action from a later chapter, the agent user needs the following:
- Access to the
GetOpenCaseCountActionApex class, through a permission set or profile. - Read access to the Case and Account objects and the fields the action queries.
The class is declared with sharing, so record visibility also follows the agent user's sharing access. If an action returns nothing or a "not authorized" error, check these grants first. Create a small custom permission set for them instead of editing the agent's profile. That keeps the access easy to review and remove.
Common problems
| Symptom | Likely cause | Fix |
|---|---|---|
| Agentforce Builder is missing from Setup | Admin lacks the builder permission set, or Agentforce isn't enabled | Assign the set, then confirm the toggle from the previous chapter |
| Prompt Builder is missing | No Prompt Builder permission set | Assign the prompt template permission set |
| Action fails with an access error | Agent user can't reach the Apex class or fields | Grant class and object access through a custom permission set |
| Assignment is rejected | The permission set needs a license your org lacks | Check the set's license requirement and your org's licenses |
Exercise
Your admin user can open Setup but can't find Agentforce Builder, and Agentforce is enabled. Name the first thing to check and one way to find the correct permission set name.
Show answer
Check whether the admin user has the permission set that grants access to build agents. Find its name in Setup > Users > Permission Sets by searching for "Agent", or run a SOQL query on PermissionSet with sf data query. Then assign it under Manage Assignments.