Service identity or on-behalf-of for MCP downstream calls

Default MCP downstream authentication to service identity per tool. Use on-behalf-of OAuth only where Salesforce or Google permissions and audit matter.

Chatis Santos · October 19, 2026 · 6 min read · For engineers and leaders

When an MCP tool reaches Salesforce, Databricks or Google, it has to call as somebody. My default is service identity: the tool's backend holds its own credential, every caller acts as the same principal and the gateway's per-tool policy decides who may call it. On-behalf-of, where the tool acts as the signed-in engineer, is reserved for the systems whose own permissions or audit trail matter, which at Northfield means Gmail, Drive and Calendar, plus Salesforce writes and anything where "who did this" has to be a person. The manifest declares the credentials per MCP and each tool uses the one it needs. This is never a platform-wide choice.

This is also the decision that sets whether a token vault, the store for each engineer's delegated Google or Salesforce tokens, gets built in phase 1 or waits until phase 3.

The two modes

Service identity is the two-legged flow. The backend holds a client-credentials grant, an API key or an AWS Secrets Manager secret: a Salesforce integration user, a Databricks service principal, a database role. Whoever calls the tool, the downstream system sees that one principal.

On-behalf-of is the three-legged flow. The engineer grants the platform access to their Google or Salesforce account once. A token vault stores and refreshes the token, and the tool calls the API as that person. Salesforce sharing rules and Google ACLs still apply, and the downstream audit log names the engineer.

Service identity On-behalf-of
Credential The backend's own: integration user, service principal, database role The user's delegated token, held in a vault
Downstream permissions Whatever the service account has. Gateway tool policy is the only control The user's own. The downstream system's rules still apply
Downstream audit trail Shows the service user Shows the person
Unattended agents Yes No, unless the agent runs as a specific person
Build cost Low: one secret reference per backend Consent flow, vault, refresh handling, a per-user "connect" step
Main risk Over-privilege, since a prompt-injected call acts with full service rights Consent fatigue, and not every system supports it
Fits Databricks and database reads, internal APIs, Salesforce reads with a scoped integration user Gmail, Drive and Calendar, Salesforce writes, anything attributed to a person

Why service identity is the default

It costs almost nothing to build and it covers most of what Northfield's teams will ship first. A manifest names a credential, the platform resolves it from Secrets Manager at runtime and the tool works, with nothing built for consent, token storage or refresh and no "connect your account" step for an engineer to see inside Claude.ai or Cursor. It also fits unattended AgentCore agents and scheduled jobs. They have no person to act for.

The first real MCP in the plan is the data platform, and the plan puts its Databricks reads on the service identity side: a read-only service principal behind role-gated tools, with the gateway log recording who asked. Databricks can enforce per-user permissions, but for the first read-only analytics tools that isn't worth building a vault. If your warehouse already enforces per-user permissions your team relies on, treat it like Salesforce and decide tool by tool.

It has costs that need an answer in the design. The downstream audit shows the service account, so the gateway's audit log has to record the human on every call: subject, roles, gateway, tool, argument hash, decision, result status and latency. That log is the one record that covers every team. And the tool has to enforce authorization itself, because the service account's rights are the ceiling and nothing downstream will narrow them. A tool open to every engineer (the eng-all role) behind a broad service account is the confused deputy problem: anyone with a token gets the account's full power, and a prompt-injected call gets it too.

The guardrails are ordinary. Scope the service account as tightly as the tool needs (a read-only integration user, a read-only warehouse role). Keep read and write tools separate with separate access lists, so sharing a read with other teams is one config line. Give each backend (a target, in AgentCore terms) one execution role scoped to its team's secrets prefix (/mcp/<team>/*). Let CI's policy lint flag a broad allow on a tool that holds a write credential.

Where to use on-behalf-of

Gmail, Drive and Calendar are always per user. There is no service account that should be reading an engineer's inbox or their Drive, and Google's ACLs are the permission model you want. Salesforce writes should prefer on-behalf-of as well, so a case update or an account change shows up in Salesforce's own audit log under the engineer who made it, with their sharing rules applied. The rule I put in Northfield's architecture paper is to use on-behalf-of where the downstream system has permissions worth inheriting, or where a person has to be the name in the record.

It costs more, in a few places. Each engineer consents once per provider, and the first call to a tool that needs a token returns a consent link. Tokens have to be stored and refreshed somewhere, which is the vault. Not every system supports the flow (plain Postgres does not). And an unattended agent can't use it unless it runs as a specific person, which is usually the wrong design.

Declaring it in the manifest

The choice lives in the manifest's credentials block, so one MCP can mix both modes. The data-warehouse manifest I drafted for Northfield does exactly that: a service secret for the warehouse and a pre-created on-behalf-of provider for Salesforce.

credentials:
  - name: warehouse
    secret: arn:aws:secretsmanager:...:/mcp/team-data/warehouse-ro
  - name: salesforce
    provider: salesforce-user  # on-behalf-of; provider pre-created by platform

The platform team pre-creates the credential providers for common SaaS, one Salesforce connected app and one Google OAuth client with the Gmail and Drive scopes they're willing to grant, and teams reference them by name. A new provider type is the one request that still goes to the platform team. It should be rare.

Rules that hold in both modes

  • Never pass the FusionAuth token downstream. The MCP spec forbids token passthrough. Each backend uses its own credential or a token minted for it. I wrote up why in Never pass the user's token to a downstream system.
  • Secrets never appear in manifests, only secret references (AWS ARNs) and provider names, and a secret scanner blocks the PR.
  • Databases without OAuth use IAM database authentication or a connection proxy, and the tool maps FusionAuth roles to database roles itself.
  • Agents get their own roles, never a human's. When an agent acts for a person, the person rides along as a separate claim and the gateway authorizes on the intersection.

The token vault question

Service identity needs a secret or a client-credentials grant the backend can reach (AWS Secrets Manager, or an AgentCore Identity credential provider if you're on AgentCore). On-behalf-of needs a per-user vault, and which vault depends on the gateway decision.

If Northfield goes with AgentCore, its Identity service is the vault: OAuth credential providers for Google and Salesforce, a three-legged consent flow for users, API-key or service credentials for backends and workload identity for agents. That is a large part of why the platform fits the stack the team already chose. If they don't adopt AgentCore, FusionAuth does not cover this part at all. It authenticates engineers and it doesn't hold their Salesforce tokens. They'd run a small token broker of their own, which is real work.

That's why this decision moves the phase plan. The current plan ships the first MCP on service identity in phase 1 and puts the vault, the Google and Salesforce consent flows and agent workload identity in phase 3. The plan leaves phase 3 open-ended. If the first teams need Gmail tools or Salesforce writes, the vault, the consent flows and the connect step move into phase 1, and I wouldn't promise phase 1's month.

Verify a couple of things before promising on-behalf-of to anyone. The first is how the consent link reaches a chat client: when a tool first needs an engineer's Salesforce token from inside Claude.ai, what does that look like? Prototype it with one tool. The second is whether FusionAuth-issued users map cleanly onto AgentCore Identity's notion of a user. Both go on the phase 0 list, since I haven't checked either against the current AgentCore docs. The full list is in Mapping an MCP platform onto Bedrock AgentCore.

If you're deciding this

Take Salesforce, Databricks and Google one at a time and ask which of them needs "who did this" to be a person. Databricks usually doesn't for read-only analytics, Google always does and Salesforce splits by read and write. Write the answer into each MCP's manifest, ship the service-identity tools first and don't build the vault until a team has a concrete tool that needs it. Your list of downstream systems is the thing I'd want to see if we talked this through.

More in this series

All articles in the series