Agentforce
Citations in Agentforce: showing where the answer came from
An Agentforce agent gives a confident, well-worded answer and the customer asks where it got that. Citations are how it answers. How platform-generated citations work, the May 2025 cutoff that decides whether you get them for free, what can and can't be cited, and why a web citation is the least trustworthy link your agent will ever show.
An Agentforce agent gives a fluent, confident answer. The customer reads it, half-believes it, and asks the obvious question: where did that come from? Most agents, out of the box, cannot say.
Citations are how an agent answers that question. A citation attaches the source behind a response, a knowledge article, a PDF, a page on your site, so the reader can check the claim instead of trusting the tone. Salesforce frames the feature plainly: the point is to build trust in Agentforce responses by including citations to the source information (Salesforce Developers, citations guide).
My opinion: turn citations on for any agent that answers from knowledge, and turn them on early. They are the cheapest trust feature Agentforce has. They are also the only part of the UI where you can see, per answer, whether grounding fired or whether the model is writing from its own memory. That second use, as a debugging surface for you, is worth as much as the first.
There is one catch that decides whether this is a toggle or a rebuild, and it is a date. I will get to it.
What a citation is under the hood
A citation is not a footnote the model writes into its prose. It is structured data that travels alongside the response.
For a Service Agent on Messaging for In-App and Web, platform-generated citations arrive in the outbound message payload as a citationContent field. Your messaging client reads that field and renders the inline markers and the sources list however your UI wants them (Salesforce Developers, add citations in agent responses). The agent does not hallucinate a link into the sentence. The platform tells you which grounded sources produced the answer, and you display them.
That structure is the whole value. Because the citation is data, not text, you can trust it the way you cannot trust a URL the model typed. If the citationContent is empty, the answer was not grounded, and that is a signal, not a cosmetic gap.
The date that decides everything
Here is the catch. Platform-generated citations are only available for agents created after May 26, 2025 (Salesforce Developers, citations guide). The agent also has to be activated and enabled.
If you stood up an agent before that cutoff, you do not get platform citations by flipping a setting. You get them by rebuilding the agent. For an early adopter sitting on a production agent from the first wave, that is the real cost of this feature, and it is worth knowing before you promise citations to a compliance stakeholder. A newer agent gets them with far less work.
No separate capability registration is required to use citations, so once you are on a qualifying agent, the lift is configuration rather than a provisioning request.
Turning them on
For the common case, grounding on Salesforce Knowledge, citations ride on the action that answers the question.
The standard Answer Questions with Knowledge action is the usual path. It comes preloaded in the General FAQ standard topic, so an agent that uses that topic already has it. The action runs on a standard prompt template, and you can override that template if you need to change how answers and sources are shaped (Lane Four, custom topics and actions).
When you build the behaviour into a prompt-template action yourself, you tell the agent when to cite in the action’s description, the same place you tell it anything else.
Then you confirm it in the Agentforce Builder Preview panel: send a grounded question, check that the citation appears, and click it to confirm it links to the right knowledge article or page (Salesforce Developers, ground Agentforce on your website). Preview is where you catch a citation that points at the wrong article, which is worse than no citation at all.
What can be cited, and what can’t
Citations draw on unstructured sources: knowledge articles, data from PDFs, and external web pages. Structured CRM fields are not what gets cited.
The Answer Questions with Knowledge action is specific about its inputs, and the specifics matter when a citation silently goes missing:
- It only uses knowledge articles the requesting user can access, so sharing settings bound what the agent can retrieve and therefore cite. A missing citation is sometimes a sharing problem wearing a grounding costume.
- It reads custom knowledge fields of type Text, Text Area, Text Area (Long), and Text Area (Rich). Text (Encrypted) and URL fields are not supported (Salesforce Help, Answer Questions with Knowledge).
- For uploaded sources it handles text, HTML, and PDF, with size caps of up to 4 MB for text or HTML and up to 100 MB for PDF.
- It depends on Data Cloud. Indexing begins when Agentforce is provisioned in an org that has Knowledge, and if you have not set Data Cloud up, the retrieval the citation describes has nothing to point at.
If you are grounding on more than Knowledge, the same discipline applies: the quality of a citation is the quality of the retrieval behind it, which is a retriever and index question before it is a UI one.
The web citation you should trust least
Grounding on your own website can generate inline citations that link straight to the source page. That is useful, and it is also the citation to treat with the most suspicion.
A knowledge article is content you wrote, reviewed, and version-controlled. A live web page is content that changed last Tuesday and nobody told the agent.
The Search the Web action makes this sharper still: a web result is the least governed thing your agent will ever say, and a citation on it only tells you where the claim came from, not whether the page was right. Citations make a web answer auditable. They do not make it safe.
Fence the web sources the same way you would without citations, and lean on the Trust Layer for the governance a citation cannot provide.
When you write the action in Apex
If you build custom actions, you can produce citations in code. Two Apex classes do the work. GenAiCitationInput hands the reasoning engine a set of candidate citations and lets it decide which to use for the answer. GenAiCitationOutput supplies citations directly, when your action already knows the source it drew from (Salesforce Developers, citations in Apex).
The choice mirrors how much you trust the reasoning engine with attribution. If your action retrieves several documents and the model composes across them, GenAiCitationInput lets the engine attribute to the right one. If your action answers from one known record, GenAiCitationOutput is the straight line. Either way the citation reaches the client as the same structured citationContent, so your custom Apex action and the standard Knowledge action present sources the same way to the user.
What I’d do first
Check the age of the agent. If it was created after May 26, 2025, you are a configuration away from citations. If it was created before, decide now whether citations are worth a rebuild, and plan it rather than discovering the cutoff mid-project.
Then ground a single topic on Knowledge, enable the citing action, and test it in Preview as a user with real sharing, not as an admin who can see everything. Ask a question you know the answer to, confirm the citation appears, and click it. Then ask a question you know is not in your knowledge base and confirm the citation is absent, because an answer with no source on a question you can’t ground is exactly the answer you want your team to be able to spot. That is citations doing their second job.
A first service agent whose answers are grounded and whose sources you can click is a far easier thing to put in front of a customer, and a governance team, than one that sounds sure of itself and can’t show its work.
Understanding the basics
What is a citation in Agentforce?
A citation is the source behind an agent’s answer, such as a knowledge article, a PDF, or a web page, attached to the response so a reader can verify the claim. For a Service Agent on Messaging for In-App and Web, platform-generated citations arrive in the message payload as a citationContent field, which your client renders as inline markers and a sources list.
Do I need to do anything special to enable citations?
Platform-generated citations require no separate capability registration, but the agent must have been created after May 26, 2025, and be activated and enabled. For Knowledge grounding you enable the citing action, such as Answer Questions with Knowledge, and confirm citations appear in the Agentforce Builder Preview panel. An agent created before the cutoff needs to be rebuilt to get platform citations.
Why are citations missing from a grounded answer?
Check three things. The answer may not have been grounded at all, in which case there is no source to cite. The requesting user may lack access to the knowledge article, since the Knowledge action only uses articles the user can see. Or the source may be an unsupported type, such as a URL or encrypted field, which the action does not read.
Can Agentforce cite external web pages?
Yes. Grounding on your own website can produce inline citations that link to the source page, and the Search the Web action can surface web sources too. Treat these as the least trustworthy citations you show, because a live page can change without the agent knowing. A citation makes a web answer auditable, not accurate, so keep the governance you would apply to any ungrounded web result.
Citations are a small feature that exposes a big one: whether your agent is grounded or just fluent. If you want an Agentforce agent whose answers are sourced, governed, and safe to show a customer, we build and tune service agents for exactly that.