Sub topic 1
What Agentforce is and how its pieces fit together
Agentforce is Salesforce's platform for building AI agents that work inside your org. An agent reads a user's message, decides what the user wants, and then answers or runs an action against your data. This chapter explains the parts and how a request moves through them. Later chapters build each part in your own Developer Edition org.
Prerequisites
This chapter assumes you know:
- Basic Salesforce concepts: objects, records, and the Setup menu.
- How to move around Lightning Experience.
You do not need to write code yet. Apex appears only in the custom action chapter.
The building blocks
An agent is made of five things. Each one answers a different question.
| Piece | Question it answers | Example |
|---|---|---|
| Agent | Who is this assistant and what is its job? | A service agent for support questions |
| Topic | What category of request is this? | Case Status Questions |
| Instructions | How should the agent behave inside a topic? | "Ask for the account if none was named" |
| Action | What can the agent actually do? | Look up open cases for an account |
| Einstein Trust Layer | How is data protected on the way to the model? | Masking sensitive values in prompts |
Topics and instructions
A topic is a bounded area of work. It has a description, which the agent uses to decide whether a request belongs there, and a set of instructions written in plain language. The agent only considers actions attached to the topic it selected. A narrow topic therefore limits what the agent can do, as well as what it talks about.
Actions
An action is a unit of work the agent can call. Four kinds matter for this tutorial:
- Standard actions, which Salesforce ships, such as answering questions or summarizing a record.
- Custom actions that wrap an Apex invocable method.
- Flows, which you may already use for automation.
- Prompt templates built in Prompt Builder.
The Einstein Trust Layer
The Trust Layer sits between your org and the large language model (LLM). It is the part you configure least, but it shapes every request. It masks sensitive data, applies safety checks, and keeps an audit record. Its details get their own chapter.
How a request flows
The agent does not follow a fixed script. A reasoning step chooses a topic, then chooses actions, and then writes a reply from the results.
For example, a user asks, "How many open cases does Acme have?" The agent matches the Case Status Questions topic. The instructions tell it to call the case count action. The action returns a number from your org, and the agent phrases the reply. If the user asks about something outside the topic, the instructions should make the agent decline.
Common early mistakes
- Treating instructions as code. They are guidance for a language model, so write short, specific, numbered steps and test them.
- Writing one broad topic. Vague descriptions cause the agent to pick the wrong topic or the wrong action.
- Assuming the agent can reach any data. It can only use what its actions and its running user's permissions allow. Permission sets are covered in a later chapter.
- Expecting identical output every time. Replies are generated, so wording varies between runs even when the behavior is correct.
Where we go next
The next chapters follow the order of dependencies: get an org, enable the features, assign permissions, then build a topic with instructions and actions.
Exercise
A user asks your agent to reset their password, but the agent only has a "Case Status Questions" topic. What should happen, and which building block controls it?
Show answer
The agent should decline or say it cannot help. The topic's scope and instructions control this, because the agent only uses the topic and actions that match the request. Without a matching topic, it has no action to run.