Acting for Someone
Tento obsah zatím není dostupný ve vašem jazyce.
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.
Her consent, and a narrow note
Section titled “Her consent, and a narrow 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.
For how long
Section titled “For how long”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.
Whose name is on the change
Section titled “Whose name is on the change”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).
Ask again before the risky step
Section titled “Ask again before the risky step”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.
What’s next
Section titled “What’s next”Module 4: across the hops. When one agent calls another, does the person’s identity go with it?
What an architect decides here
Section titled “What an architect decides here”- 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.
Explore
Section titled “Explore”- Agent Execution Context and Data Access by Type (opens in a new tab) (Salesforce Help; checked 2026-11-21)
- Security Best Practices (Hosted MCP Servers) (opens in a new tab) (Salesforce Developers; checked 2026-11-21)
- Trust for the Agentic Enterprise (opens in a new tab) (Salesforce Architects, Well-Architected; checked 2026-11-21)
