コンテンツにスキップ

Acting for Someone

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

Module 3 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: When an agent acts for a person, how much of the person does it carry?

A power of attorney, not a copy of her keys

Section titled “A power of attorney, not a copy of her keys”

When you let someone act for you, you don’t usually give them everything. A friend who collects a parcel for you gets a note that says “collect this parcel.” Not your house keys, your bank card and your signature. An agent acting for Priya should carry the same kind of note: what it may do for her, for how long, and nothing more.

Chapter 11 asked the questions for the impersonation flows: whose name is on the change, and who said this app could act as her? For agents, they’re the everyday questions. And OAuth already has the tools to answer them, because it was built for exactly this: an app acting for a person, with a limited note.

When a person is there, she approves. The authorization screen from chapter 9 isn’t a formality for an agent: it’s Priya agreeing that this app may act for her. That’s why Salesforce’s own MCP servers use the authorization code flow and nothing else, so every action traces back to a person who said yes (S7).

Then the note itself: the scopes. An agent doesn’t need full. Salesforce’s setup for its MCP servers asks for two: mcp_api, to use the MCP servers, and refresh_token, to keep working without asking again (S6). That’s the shape to copy: the scope that does the job, and nothing beside it.

The scopes say what kind of thing the app may do. What it may reach is still Priya’s own access, because the agent runs as her. Salesforce says it plainly for its MCP servers: “Every MCP tool call runs with the same permissions as the user who authorized the connection” (S7). So an agent acting for Priya can never see more than Priya. But it can see everything Priya can, which is usually more than the job needs. Module 1’s point again: the job decides the boundary, and for that, the Data Architect course’s module on agents goes further.

A note should expire. In chapter 13, the refresh token was the re-entry pass, and its policy decided how long it lasts. For agents, that policy matters more, because an agent’s refresh token sits in a tool, on a server or a laptop, often long after anyone thinks about it.

Here’s Salesforce’s own warning, in its MCP setup guide: “By default, refresh tokens remain valid indefinitely” (S6). Its recommendation: a refresh token validity of “30 days or less,” and refresh token rotation on (S6). And if the person leaves, single logout ends the agent’s session with hers (S6). Set those on every app an agent uses.

When an agent acts as Priya, the record says Priya changed it. That’s the point: Salesforce’s MCP servers attribute “all actions… to the named user in audit trails” (S7). It’s also a responsibility. Priya is now accountable for what her agent did, so she has to be able to see it and stop it.

When an agent acts as itself, through a shared identity, the record says the integration user changed it, and the person who asked is gone. Salesforce’s architects say this about outbound connections: with a shared system identity, “your audit trail at the external system shows the integration user, not the individual end user” (S1). Their fix, if you must use a shared identity, is to write the real user into your own logs before the call (S1). Module 4 is about not losing her in the first place.

Customer agents: know who it is before acting

Section titled “Customer agents: know who it is before acting”

A customer agent is harder, because the customer often isn’t logged in. Salesforce’s service agent sees three kinds of customer (S4):

  • Unidentified. Someone asking about the returns policy. No identity at all.
  • Identified, or verified. Amara has a contact record. She’s typed her email and a one-time code sent to it. She’s verified, “but they aren’t logged in” (S4).
  • Authenticated. Amara is logged in to the site, and credential-based user verification passes her login to the agent (S4). Module 1’s third case: the agent runs as her.

For the first two, the agent runs as its agent user. So how does it keep Amara to Amara’s records? Salesforce’s answer is a verified ID. After a customer verification step succeeds, the agent stores her ID in a variable called VerifiedCustomerId. Then every action that reads her data is scoped to it, WHERE ContactId = VerifiedCustomerId, and the subagents and actions that need it are filtered to run only when it’s there (S3). Salesforce adds: “you should carefully test and customize each action to meet your security needs” (S3).

Salesforce’s architects give this a name worth using. Public actions are ones you’d run for anyone, like answering from the public returns policy. Private actions act on a specific customer’s behalf, like changing her delivery or reading her orders. Their rule: “You must put a verification step… in front of every private action. A private action reachable without verification is a spoofing threat: anyone who claims to be the customer gets the customer’s data” (S1).

A customer agent and three kinds of customer A customer agent and three kinds of customer. Unidentified, someone asking a question: the agent runs as its agent user, with no customer identity; it may do public actions only, like answering from the returns policy. Verified, Amara typed her email and a one-time code but isn't logged in: the agent still runs as its agent user, with her ID stored as VerifiedCustomerId; it may do private actions scoped to her, where ContactId equals her ID. Authenticated, Amara logged in to the site: with credential-based user verification, the agent runs as Amara, the site user, and may do private actions within her own access. Marked amber: someone who claims to be Amara with nothing verified, while the agent runs with the agent user's full access; if a private action is reachable, that's a spoofing threat. Footnote: Agentforce service agents, as Salesforce Help and Salesforce Architects describe them, checked 2026-11-20. {"author": "Steve Simpson", "blueprint": "1.0.0", "builder": "standard 1.59.0", "built": "2026-11-20", "id": "DGM-IAM-AGI-04", "rights": "\u00a9 2026 Twinshark LLC. All rights reserved.", "template": "cells 0.5.0", "theme": "stevetecharc 1.4.0"} THE CUSTOMER THE AGENT RUNS AS IT MAY DO Unidentified asking a question Its agent user no customer identity Public actions only like the returns policy Verified email and a one-time code; not logged in Its agent user her ID in VerifiedCustomerId Private actions, scoped WHERE ContactId = her ID Authenticated logged in to the site Amara, the site user credential-based user verification Private actions within her own access Claims to be Amara nothing verified Its agent user the agent user's full access A spoofing threat if a private action is reachable so so so so so so so risks Agentforce service agents, as Salesforce Help and Salesforce Architects describe them, checked 2026-11-20. HOW TO READ IT allowed by design what verification is there to stop © 2026 Twinshark LLC · stevetecharc.com
Click to enlarge

One more tool from earlier chapters: step-up. In chapter 13, a high-assurance session made an app ask for stronger proof. For agents, Salesforce’s architects say the same thing for high-risk tools, “deletes, updates, and access to sensitive data”: design “a re-authentication step before the operation completes,” for example a verification subagent in the conversation (S1). Without it, they warn, “a hijacked session or a successful prompt injection can do whatever the connection’s credential can do” (S1).

So for every agent that acts for a person, three lists: what it may do without asking, what it may do after verifying who she is, and what needs her to prove it again, or a person to approve.

Module 4: across the hops. When one agent calls another, does the person’s identity go with it?

  • The scopes for every agent app: the job’s, nothing beside it.
  • Refresh token policy: 30 days or less, rotation on, single logout.
  • Public and private actions for every customer agent, with verification in front of every private one.
  • What needs step-up, or a person’s approval, before it runs.