コンテンツにスキップ

Agents at the Door

このコンテンツはまだ日本語訳がありません。

Module 2 of 6 in the chapter Agents and Identity, chapter 17 of Securing Salesforce: Identity and Access. Each module stands on its own.

The question this module answers: An agent outside Salesforce needs in. Which door does it use?

Module 1’s agents lived inside Salesforce. They ran in Lightning, or in a chat window on a Salesforce site, and Salesforce knew who was signed in. But a lot of agents don’t live there. A company’s own mobile app has an agent behind its chat. A coding assistant on a developer’s laptop reads and changes records. A nightly agent in another cloud reconciles deliveries with a partner’s system. Each one has to get into Salesforce from outside.

Here’s the good news, and it’s the reason this chapter comes at the end of the course. There are no new doors. An agent signs in through the same OAuth flows you’ve already learned. What’s new is choosing the right one, because an agent can look like a person, a system, or both.

Salesforce’s architects make this the second zone of their threat model, between the app the agent lives in and Salesforce: “Does the host prove its own identity, and does it pass the end user’s identity through?” (S1). Two questions again. Who is the app? And who is it acting for?

In chapter 5, every choice of door started with one question: who starts it? A person in a browser, a person through an app, no person at all, a device. Ask it again about the agent, and then ask module 1’s second question: who is the agent acting for?

Put those together and you get the table Salesforce’s own architects publish, in their guide to trust for agents (S1). I’ve added the chapter where each flow was taught.

The connectionSalesforce’s recommendation (S1)Taught in
A system connects to an agent, as itselfClient credentials flow, running as a dedicated integration userChapter 8
A system connects, carrying a user’s contextOAuth 2.0 Token Exchange: the user’s existing identity provider token is exchanged for a Salesforce one, and “the user’s identity carries across the hop rather than collapsing to a shared account”Chapter 11, module 4
An internal user’s app with no browserJWT bearer flow, “which maintains the specific user’s context”Chapter 11, module 2
An external customer or partner’s app with no Salesforce screenHeadless Identity Authorization Code and Credentials Flow, with PKCEChapter 15, module 3
An external user talks to an agentA dedicated, least-privilege agent userModule 1

And one more row that Salesforce’s own MCP servers add, for an AI client where a person is there to approve: the authorization code flow with PKCE, the web server flow from chapter 9 (S5, S7). The person signs in, sees what the app is asking for, and says yes. Module 5 comes back to it.

Five ways in for an agent Six ways an agent might come in, and the chapter that taught each. As itself, with no person, its own work: client credentials, as its own integration user, chapter 8, the base pattern. Carrying a user who already signed in elsewhere: token exchange, her token swapped for a Salesforce one, chapter 11, module 4. For an employee, with no browser: JWT bearer, signed by the app and naming the user, chapter 11, module 2. For a customer or partner, in the company's own app: headless, the authorization code and credentials flow with PKCE, chapter 15, module 3. With a person approving, who signs in and says yes: the web server flow with PKCE, also used by Salesforce's MCP servers, chapter 9 and module 5. Marked amber: with a password, or a secret on a laptop: never; a public client uses PKCE; chapter 5, module 4. Footnote: after Salesforce Architects, Trust for the Agentic Enterprise, checked 2026-11-20. {"author": "Steve Simpson", "blueprint": "1.0.0", "builder": "standard 1.59.0", "built": "2026-11-20", "id": "DGM-IAM-AGI-03", "rights": "\u00a9 2026 Twinshark LLC. All rights reserved.", "template": "cells 0.5.0", "theme": "stevetecharc 1.4.0"} THE AGENT ACTS THE DOOR TAUGHT IN As itself no person: its own work Client credentials as its own integration user Chapter 8 the base pattern Carrying a user signed in elsewhere already Token exchange her token swapped for a Salesforce one Chapter 11 module 4 For an employee no browser JWT bearer signed by the app, names the user Chapter 11 module 2 For a customer or partner in the company's own app Headless, with PKCE authorization code and credentials Chapter 15 module 3 With a person approving she signs in and says yes Web server flow, PKCE Salesforce's MCP servers too Chapter 9 and module 5 With a password or a secret on a laptop Never a public client uses PKCE Chapter 5 module 4 uses see uses see uses see uses see uses see uses see After Salesforce Architects, Trust for the Agentic Enterprise, checked 2026-11-20. HOW TO READ IT never for an agent © 2026 Twinshark LLC · stevetecharc.com
Click to enlarge

Look at the first two rows side by side, because that’s the decision that matters most.

An agent that signs in as itself gets one identity, its integration user, for every request. That’s right when the work isn’t anyone’s in particular: reconciling deliveries every night, checking stock, summarizing yesterday’s cases for a dashboard. Salesforce’s advice is to give it its own dedicated user, not to share one (S1). Chapter 8 called this the base pattern, and for work that belongs to nobody, it’s still the right one.

An agent that signs in as someone carries that person. Every read is limited by her access, and every change has her name on it. That’s right when the work is hers: her cases, her orders, her approvals.

The trap is using the first for the second. An agent in a customer app signs in with client credentials, gets one powerful identity, and then decides for itself which customer’s records to show. Now the agent’s judgment is the only thing between one customer and another. Salesforce’s architects name exactly this pitfall for the app-to-Salesforce zone: “Client-credential tokens exposed in the browser, since they represent one shared service identity” (S1). Their lesson: “Authenticate the host explicitly, pass user identity through when required, and keep client credentials server-side” (S1).

Two rules from earlier chapters matter even more for agents.

Never a password. An agent should never hold a person’s username and password. The username-password flow is retiring on 2027-02-20 for a reason (chapter 5, module 4), and an agent that types a password is that flow with less supervision. If a person must be there, they sign in themselves and approve; if they aren’t, the JWT bearer or token exchange flow carries them without a password.

Never a shared secret where it can be read. A client secret belongs on a server. Salesforce’s own setup guide for its MCP servers says to require a secret only for web-based clients “where the secret can be securely stored on the server side,” and to avoid it in desktop apps, because “embedded secrets in desktop applications can potentially be exposed through decompilation” (S6). An agent on a laptop or in a browser is a public client (chapter 15, module 3): PKCE, not a secret.

Module 3: acting for someone. When the agent carries a person, how much of the person should it carry?

  • For each agent: as itself, or as someone. Decided by whose work it is.
  • Which flow, from Salesforce’s connection table and chapter 5’s map.
  • A dedicated integration user for every agent that acts as itself, never a shared one.
  • Where the secret lives, and PKCE wherever it can’t be kept.