Most enterprises that use Salesforce Agentforce also run Microsoft 365 and Microsoft Entra. Sooner or later an Agentforce agent needs something from the Microsoft side: a colleague’s profile, the user’s own mail, a file. The usual answer is a connected app with a client secret and broad Graph permissions, owned by nobody in particular. Nothing in Entra knows that an agent is calling, nobody can tell one agent from another in the sign-in logs, and switching the agent off means finding the secret.

Microsoft Entra Agent ID and Agent 365 are meant to fix that: every agent gets its own identity, with a sponsor, its own permissions, Conditional Access for agents, a kill switch and an audit trail. The question this article answers is whether an agent that runs inside Salesforce can have one, without moving it out of Salesforce.

It can. This article shows the complete path, built and tested end to end:

  • Two Agentforce agents with their own Entra agent identities: one acts as itself (app-only), one acts on behalf of the signed-in user (OBO).
  • No bridge service. Apex runs the Entra Agent ID token exchange in-process. The credential is a certificate whose private key never leaves Salesforce.
  • Least privilege, with the defaults the tooling grants tightened afterwards.
  • Telemetry from both agents sent to Agent 365, attributed to each agent identity.
  • Registry sync, so the Agentforce agents are also listed in the Agent 365 registry through the Salesforce connected platform.
  • No credential held in Entra at all, as an option: Salesforce becomes the federated issuer and Entra trusts its tokens through workload identity federation.

The focus is on the calls and the configuration, in the order they have to be made, and why.

Status of the APIs. Entra Agent ID, the Agent 365 CLI and SDKs, Agent 365 connected platforms, Conditional Access for agents and the Salesforce External Client App and Agent Script features used here were in preview or recently released when this was written (November–December 2026). Names, permissions, defaults and endpoints may change; check the current Microsoft and Salesforce documentation before relying on them.

Licensing and availability. Microsoft licensing for Agent 365, Entra Agent ID and Conditional Access for agents, and Salesforce licensing for Agentforce, change often, and some capabilities depend on preview enrolment. Nothing in this article is licensing advice. Confirm what your tenant and org need, and what is available to them, with your account teams before you plan or build.

Conventions

Values in angle brackets are placeholders: <tenant-id>, <blueprint-app-id>, <agent-identity-id>, <my-domain> (your Salesforce My Domain host, for example yourorg.my.salesforce.com) and so on. Nothing in this article is specific to one environment.

Constants published by Microsoft, the same in every tenant:

ConstantValue
Token-exchange scopeapi://AzureADTokenExchange/.default
Agent 365 observability API (scope)api://9b975845-388f-4429-889e-eab1ef63949c/.default
Microsoft Graph (app-only scope)https://graph.microsoft.com/.default

The idea in one paragraph

An Entra agent identity is a child of an agent identity blueprint. The blueprint proves who it is with a credential, asks Entra for a short-lived exchange token for one of its agent identities (fmi_path), and the agent identity uses that exchange token to get the token it actually needs: as itself, or for a user. None of that requires the agent to run in Azure. Salesforce can store the blueprint’s certificate with a non-exportable private key, Apex can sign the client assertion with Crypto.signWithCertificate, and three HTTP calls later an Agentforce action holds a Microsoft Graph token issued to its own agent identity. Entra, Conditional Access, the sign-in logs and Agent 365 see the agent, not a shared app.

Two ways in: registry sync, or an identity of its own

Agent 365 offers two kinds of integration for a third-party platform, and they are not alternatives so much as layers.

Registry sync (connected platform)Own Entra agent identity (what most of this article builds)
What it doesAgent 365 reads the list of Agentforce agents from Salesforce and shows them in its registryEach Agentforce agent gets an Entra agent identity and uses it to call Microsoft APIs
Configured inAgent 365 admin center + a Salesforce External Client AppEntra (blueprint, agent identity, grants) + Apex in Salesforce
Entra identity per agentNoYes, with sponsor, permissions and lifecycle
Conditional Access, kill switch, sign-in logs for the agentNoYes
Agent acts on behalf of a user in Microsoft 365NoYes (OBO)
Telemetry attributed to the agentNoYes, sent by the agent with its own identity
EffortMinutesA day, the first time

Registry sync gives inventory. An identity of its own gives control. I did both; the rest of the article is mostly about the second.

Why not a bridge?

My first build put a small Python “bridge” agent in Azure, registered with Agent 365, that forwarded requests to Agentforce. It worked, and it was the wrong shape: the identity, the permissions and the telemetry belonged to the bridge, a custom agent running in Azure, not to the Agentforce agent. The Agentforce agent itself was still anonymous to Entra. Moving the token exchange into Apex removed the bridge entirely and put the identity where the agent actually runs.

The moving parts

PartWhat it is
Agent identity blueprint (one per agent here)Entra application of type agentIdentityBlueprint. Holds the credential; parent of the agent identity.
Agent identityService principal of type agentIdentity: who the agent is in Entra, Conditional Access and Agent 365.
Certificate in SalesforceSelf-signed, created in Certificate and Key Management, private key not exportable. Its public part is the blueprint’s key credential.
EntraAgentIdTokenProvider (Apex)Builds and signs the client assertion, runs the exchange, caches tokens per transaction. About 200 lines.
Custom metadata Entra_Agent_Identity__mdtTenant, blueprint and agent identity IDs, certificate name and thumbprint, telemetry switch. One record per agent.
Invocable Apex actionsWhat the agents call: get a profile, read the user’s recent mail, explain how the agent authenticated.
Agentforce agentsMicrosoft 365 Helper (autonomous, classic service agent) and Microsoft 365 Helper (OBO) (employee agent built with Agent Script).
Custom Auth. Provider (OBO only)Links a Salesforce user to their Entra account and stores a user token audienced to the OBO blueprint.
Agent365Telemetry (Apex)Sends invoke_agent and execute_tool spans to the Agent 365 observability service with the agent’s own token.
Remote Site Settingslogin.microsoftonline.com, graph.microsoft.com, agent365.svc.cloud.microsoft.

The token flows

Show codeHide code14 lines
                                        Salesforce (Apex)                                   Microsoft Entra
 1  blueprint   sign RFC 7523 assertion with the Salesforce-held certificate (x5t header)
                POST /token  client_credentials, client_id=<blueprint-app-id>,
                scope=api://AzureADTokenExchange/.default, fmi_path=<agent-identity-id>  ─────▶  T1

 2a autonomous  POST /token  client_credentials, client_id=<agent-identity-id>,
                client_assertion=T1, scope=https://graph.microsoft.com/.default      ─────▶  app-only token (roles)

 2b on-behalf   POST /token  grant_type=jwt-bearer, requested_token_use=on_behalf_of,
                client_id=<agent-identity-id>, client_assertion=T1,
                assertion=<user token, aud = OBO blueprint>, scope=User.Read Mail.Read ─────▶  delegated token (scp, user)

 3  telemetry   POST /token  as 2a, scope=api://9b975845-.../.default                ─────▶  app-only token
                POST agent365.svc.cloud.microsoft/.../agents/<agent-identity-id>/traces

Step 1 is the part that usually hides in an SDK or sidecar. fmi_path tells Entra which of the blueprint’s agent identities the exchange token is for; T1 is only usable as a client assertion by that one agent identity.

Prerequisites

  • A Microsoft tenant with Entra Agent ID and Agent 365 available, and an administrator who can create blueprints, grant API permissions and consent (Application Administrator or Cloud Application Administrator plus Privileged Role Administrator, or Global Administrator in a lab).
  • A Salesforce org with Agentforce. A Developer Edition org is enough to build everything here, including Agent Script employee agents. Registry sync needs a user with an Agentforce license to run as (more on that below).
  • The Agent 365 CLI (a365), the Azure CLI, and the Salesforce CLI (sf) with an API version that supports the metadata you deploy (Agent Script employee agents and agentAccesses in permission sets needed API 68).
  • A sponsor for each agent (a user).

Phase 1: Register the agents in Entra and Agent 365

1.1 Create a blueprint and agent identity per agent

I used the Agent 365 CLI, once per agent:

a365 setup all --agent-name "Salesforce Agentforce M365 Helper"            # autonomous
a365 setup all --agent-name "Salesforce Agentforce M365 Helper OBO" --authmode obo

That creates the blueprint, its service principal, the agent identity, the registration in Agent 365 and a set of default permissions. Two things to know before you run it:

  • It prints a client secret for the blueprint. Nothing in this design uses it. Delete it in Entra right away and scrub it from any file or log it landed in.
  • It grants a broad default set of delegated permissions (mail, files, chat read/write and more) and sets allAllowed inheritance from blueprint to agent identity. Phase 2 tightens both.

Run it in an interactive terminal: it stops at a consent prompt, and a non-interactive run cancels itself there.

1.2 Give the blueprint the Salesforce certificate

In Salesforce: Setup › Certificate and Key Management › Create Self-Signed Certificate, 2048-bit, Exportable Private Key unchecked. Download the public certificate (.crt).

In Entra, add it to the blueprint as a key credential. Entra wants the certificate’s SHA-1 thumbprint later, in the assertion’s x5t header, so compute it now:

# x5t = base64url(SHA-1 of the DER certificate)
openssl x509 -in entra_blueprint.crt -outform der | openssl dgst -sha1 -binary | basenc --base64url | tr -d '='
az rest --method PATCH \
  --url "https://graph.microsoft.com/beta/applications/<blueprint-object-id>" \
  --body '{"keyCredentials":[{"type":"AsymmetricX509Cert","usage":"Verify","key":"<base64 DER of the certificate>","displayName":"Salesforce Agentforce"}]}'

keyCredentials replaces the whole list, so include any credential you want to keep. The private key stays in Salesforce; there is nothing to rotate in Entra except the public certificate, before it expires.

Phase 2: Govern what each agent may do

This is where the two agents differ, and where the CLI defaults are too generous.

AgentPermissionTypeWhere it is granted
AutonomousMicrosoft Graph User.Read.AllApplication roleOn the agent identity only
Autonomous blueprintNoneDefault delegated grants and allAllowed inheritance removed
OBOMicrosoft Graph User.Read, Mail.ReadDelegated, admin-consentedOn the blueprint
OBO inheritanceenumerated: User.Read, Mail.ReadInheritable permissionsBlueprint → agent identity

Two gates apply to the OBO agent: what the blueprint may inherit to the agent identity, and what the user can see. The agent can never read mail the user can’t, and it can never use a scope outside the enumerated list, even if someone consents to more on the blueprint later.

Make these changes with a script an administrator runs, and read the result back after each change. I hit two traps doing exactly that in PowerShell: variable names are case-insensitive (a loop variable $g silently overwrote $G), and $ErrorActionPreference = 'Stop' does not stop on a failing native command such as az. Only the read-back caught both.

Re-running a365 setup all can restore the broad defaults. Re-check grants after every CLI run.

Phase 3: The token exchange in Apex

3.1 Configuration

One custom metadata record per agent:

FieldAutonomousOBO
Tenant_Id__c<tenant-id><tenant-id>
Blueprint_App_Id__c<blueprint-app-id><obo-blueprint-app-id>
Agent_Identity_App_Id__c<agent-identity-id><obo-agent-identity-id>
Certificate_Name__cunique name of the Salesforce certificatesame pattern
Certificate_Thumbprint__cthe x5t value from 1.2
Auth_Provider_Id__cthe Auth. Provider from Phase 5
Telemetry_Enabled__ctruetrue

Plus Remote Site Settings for https://login.microsoftonline.com, https://graph.microsoft.com and https://agent365.svc.cloud.microsoft.

3.2 The client assertion

Show codeHide codeapex · 15 lines
private String buildClientAssertion() {
    Long now = Datetime.now().getTime() / 1000;
    Map<String, Object> header = new Map<String, Object>{
        'alg' => 'RS256', 'typ' => 'JWT', 'x5t' => cfg.Certificate_Thumbprint__c };
    Map<String, Object> claims = new Map<String, Object>{
        'aud' => tokenEndpoint(),                      // https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token
        'iss' => cfg.Blueprint_App_Id__c,
        'sub' => cfg.Blueprint_App_Id__c,
        'jti' => UUID.randomUUID().toString(),
        'nbf' => now - 30, 'iat' => now, 'exp' => now + 300 };
    String signingInput = base64Url(Blob.valueOf(JSON.serialize(header)))
        + '.' + base64Url(Blob.valueOf(JSON.serialize(claims)));
    Blob signature = Crypto.signWithCertificate('RSA-SHA256', Blob.valueOf(signingInput), cfg.Certificate_Name__c);
    return signingInput + '.' + base64Url(signature);
}

Crypto.signWithCertificate signs inside Salesforce; Apex never sees the private key.

3.3 Exchange token, then the token you need

Show codeHide codeapex · 26 lines
// Step 1: blueprint -> T1 for its child agent identity
Map<String, Object> t1 = postToken(new Map<String, String>{
    'client_id' => cfg.Blueprint_App_Id__c,
    'scope' => 'api://AzureADTokenExchange/.default',
    'fmi_path' => cfg.Agent_Identity_App_Id__c,
    'client_assertion_type' => 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer',
    'client_assertion' => buildClientAssertion(),
    'grant_type' => 'client_credentials' });

// Step 2a: autonomous, app-only
Map<String, Object> appOnly = postToken(new Map<String, String>{
    'client_id' => cfg.Agent_Identity_App_Id__c,
    'scope' => 'https://graph.microsoft.com/.default',
    'client_assertion_type' => 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer',
    'client_assertion' => (String) t1.get('access_token'),
    'grant_type' => 'client_credentials' });

// Step 2b: on behalf of the user (user token audienced to the blueprint)
Map<String, Object> delegated = postToken(new Map<String, String>{
    'client_id' => cfg.Agent_Identity_App_Id__c,
    'scope' => 'https://graph.microsoft.com/User.Read https://graph.microsoft.com/Mail.Read',
    'client_assertion_type' => 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer',
    'client_assertion' => (String) t1.get('access_token'),
    'grant_type' => 'urn:ietf:params:oauth:grant-type:jwt-bearer',
    'assertion' => userAssertion,
    'requested_token_use' => 'on_behalf_of' });

The provider caches T1 and the final tokens for the rest of the Apex transaction (expiry minus two minutes), surfaces Entra’s AADSTS error codes, and never logs a request body or a token. A Signer interface lets unit tests replace the certificate signing; with the callouts mocked, the tests cover the assertion, both flows, the cache and the failure paths.

Phase 4: The agents

Microsoft 365 Helper (autonomous) is a classic Agentforce service agent with one topic and two actions (GenAiFunctions over invocable Apex): look up a colleague’s Microsoft 365 profile by email, and explain how the agent authenticates. It acts as itself, so anyone who can talk to it gets what the agent is allowed to see. That is the right model for directory lookups, and the wrong one for anyone’s mailbox.

Microsoft 365 Helper (OBO) is an Agentforce employee agent written in Agent Script. Its actions point straight at Apex:

Show codeHide codeyaml · 12 lines
config:
    developer_name: "Microsoft_365_Helper_OBO"
    agent_type: "AgentforceEmployeeAgent"

subagent my_microsoft_365:
    actions:
        get_my_recent_emails:
            description: "Lists the signed-in user's most recent emails, read on behalf of the user."
            target: "apex://MyM365MailAction"
            inputs:
                count: integer
                    is_required: False

Deploy with sf agent publish authoring-bundle, then activate the new version explicitly (sf agent activate --version N): publishing creates a version but doesn’t activate it. Employee agents also need a permission set that grants the agent (agentAccesses), which needs metadata API 68.

Both agents also have an “explain my access” action. It decodes the Graph token the agent just used (claims only, never the token) and answers in plain language: token type, acting agent identity, the user it acts for, and the permissions in the token. It’s the most useful thing in the demo, because it turns an abstract identity design into a sentence the audience can read.

Phase 5: On-behalf-of: linking the user

The OBO flow needs a user token whose audience is the OBO blueprint (scope api://<obo-blueprint-app-id>/access_agent_as_user). Agentforce doesn’t have one, so each user links their Microsoft account once:

  1. A custom Auth. Provider plugin (Auth.AuthProviderPluginClass) runs the authorization-code flow against Entra with a small sign-in app registration and requests access_agent_as_user on the blueprint, plus offline_access.
  2. The user opens Settings › Connections in Salesforce and links their Microsoft account. Salesforce stores the tokens against that user.
  3. At action time, Auth.AuthToken.getAccessToken(providerId, providerName) returns the user’s token. If it’s about to expire, Auth.AuthToken.refreshAccessToken refreshes it. If the user hasn’t linked, the action tells them how to.

A custom Auth. Provider stores tokens under its friendly name, not Open ID Connect; asking with the wrong provider name returns nothing.

If the user revokes the connection, the OBO agent stops working for that user and asks them to link again. That is the user consent boundary, and it makes a good demo.

Phase 6: Telemetry to Agent 365

There is no Agent 365 SDK for Apex, so Agent365Telemetry does what the SDK’s exporter does on its service-to-service route:

POST https://agent365.svc.cloud.microsoft/observabilityService/tenants/<tenant-id>/otlp/agents/<agent-identity-id>/traces?api-version=1
Authorization: Bearer <app-only token for the agent identity, scope api://9b975845-388f-4429-889e-eab1ef63949c/.default>
Body: OTLP JSON, one invoke_agent span with a child execute_tool span per action

I captured the payload shape from the SDK’s exporter and reproduced it. Telemetry is best effort: a failed export is logged and never breaks the agent’s action. The token is app-only for the agent identity in both agents, including the OBO one; telemetry is about the agent, not the user.

The service accepted the spans (HTTP 2xx). At the time of writing I had not yet seen them on the agents’ Activity tab in the admin center, so treat this part as “accepted by the service”, not “verified in the portal”.

Phase 7: Registry sync

Registry sync is configured in the Agent 365 admin center as a Salesforce connected platform. On the Salesforce side it needs an External Client App with the client credentials flow, and a Run As user whose permissions decide what the sync can see.

This took longer than everything else. The connection logged in successfully every time and still returned “Permission denied” (ConnectedPlatformUnauthorizedAcess) on sync. I tried a Salesforce Integration user, then a full-license user with View Setup, agent access and broad read permissions, then the Agentforce and Data Cloud permission sets. All failed the same way. The permission set that looked right couldn’t even be assigned: the org’s only Agentforce (Default) permission set license was already in use. With the admin (who holds that license) as Run As, the sync was healthy and listed both agents.

The takeaway: the Run As user needs an Agentforce license, not just permissions. In a Developer Edition org that usually means the admin; in production, buy a license for a dedicated integration user rather than running sync as an administrator. Also, I didn’t find an observability option in the connection settings; telemetry comes from the agents themselves (Phase 6).

Going further: no credential in Entra at all (Salesforce as the federated issuer)

The certificate design keeps the private key in Salesforce, but Entra still holds a credential: the public key. Workload identity federation removes even that. Instead of a certificate assertion, the blueprint presents a token signed by Salesforce, and Entra trusts Salesforce as an external OpenID Connect issuer through a federated identity credential (FIC) on the blueprint.

How it works

Show codeHide code10 lines
1  Apex signs a JWT bearer assertion with the app's certificate and posts it to https://<my-domain>/services/oauth2/token
   → Salesforce JWT access token for a dedicated integration user
     header  {"alg":"RS256","kid":"CORE_ATJWT.<org-id>.…","tty":"sfdc-core-token"}
     claims  {"iss":"https://<my-domain>","aud":["https://<my-domain>"],"sub":"uid:<18-char user id>","scp":"api", …}

2  POST Entra /token  client_credentials, client_id=<blueprint-app-id>, fmi_path=<agent-identity-id>,
   scope=api://AzureADTokenExchange/.default, client_assertion=<Salesforce JWT>          → T1
   (Entra checks iss/sub/aud against the FIC and validates the signature with keys from https://<my-domain>/id/keys)

3  T1 → agent identity app-only Graph token → Microsoft Graph                              (exactly as in Phase 3)

Configuration

Salesforce:

  1. A dedicated integration user (Salesforce Integration license, API-only profile, no data access). Its 18-character user Id becomes the token subject, uid:<user-id>.
  2. A permission set with no permissions, assigned only to that user. The External Client App is pre-authorized for this permission set and nothing else.
  3. A separate self-signed certificate for the app, not the blueprint’s, with a non-exportable key.
  4. An External Client App with the JWT bearer flow (that certificate), Issue JWT-based access tokens for named users on, scopes api and refresh_token, client credentials off, and Admin approved users are pre-authorized for the permission set above. In metadata, the policy file carries <permittedUsersPolicyType>AdminApprovedPreAuthorized</permittedUsersPolicyType> and <commaSeparatedPermissionSet>…</commaSeparatedPermissionSet>.
  5. A Remote Site Setting for your own My Domain, because Apex calls the org’s own token endpoint.

Check that Entra will be able to validate the token: https://<my-domain>/.well-known/openid-configuration must return your My Domain as issuer, and its jwks_uri (/id/keys) must list the CORE_ATJWT.* key id from the token header.

Entra:

Show codeHide codejson · 7 lines
POST https://graph.microsoft.com/beta/applications/<blueprint-object-id>/federatedIdentityCredentials
{
  "name": "salesforce-wif",
  "issuer": "https://<my-domain>",
  "subject": "uid:<integration-user-id>",
  "audiences": ["https://<my-domain>"]
}

Test results

TestResult
Integration user + app certificate, FIC present200 at all four steps; the Graph token was app-only for the agent identity, with the blueprint as its parent (xms_par_app_azp)
Same request, FIC removed401 AADSTS70025: the blueprint has no configured federated identity credentials
Administrator as the JWT subject400 invalid_app_access: user is not admin approved to access this app
Blueprint certificate instead of the app’s certificate400 invalid_client

Should you use it?

It works, and it removes the last credential from Entra. Before you make it the default, weigh three things:

  • The FIC matches only issuer, subject and audience. Entra can’t check which Salesforce app issued the token, so any Salesforce JWT access token for the subject user is accepted. That is why the subject must be a dedicated user that only this app can issue tokens for, never an administrator.
  • Salesforce access tokens live much longer than a five-minute client assertion: hours, set by the session timeout. Mint a fresh one for every exchange and never store it.
  • One key per trust. Don’t reuse the blueprint’s certificate for the Salesforce app. If one key leaks, the other trust should survive.

In my build the certificate flow stays the default and the FIC is added only for demos, then removed.

Proving it: the demo

StepWhat to doWhat the audience sees
Autonomous identityAsk the Microsoft 365 Helper: “How do you authenticate to Microsoft 365?”App-only token, acting agent identity by name, on behalf of nobody, application role User Read All
Delegated identityAsk the OBO agent: “How do you access my Microsoft 365 data?”Delegated token for this user and this agent, limited to User Read and Mail Read
Least privilegeAsk the OBO agent for someone else’s mailIt can’t: it only ever sees the user’s own mailbox
Proof in EntraSign-in logs, agent sign-insCertificate sign-ins by each agent identity; OBO sign-ins on behalf of the user
Kill switchSet the agent identity’s accountEnabled to false, ask againAADSTS7000112 … is disabled. Re-enable and it works again within seconds
Consent boundaryThe user revokes the connection in Salesforce, asks the OBO agentThe agent asks them to link their Microsoft account

The kill switch is the moment that lands with security teams. The agent runs in Salesforce; it is switched off in Entra.

How to know it worked

Decode the tokens (claims only) and check:

TokenClaimExpect
Autonomous Graph tokenidtypapp
appid / azp<agent-identity-id>, not the blueprint
roles["User.Read.All"] and nothing else
xms_par_app_azp<blueprint-app-id>
OBO Graph tokenscpUser.Read Mail.Read
azp<obo-agent-identity-id>
upn / oidthe signed-in user
Telemetry tokenaudthe Agent 365 observability API

Lessons learned

Entra and Agent 365

  • a365 setup all grants broad default delegated permissions and allAllowed inheritance. Tighten both afterwards, and re-check after every CLI run.
  • The CLI prints the blueprint’s client secret in plain text. If you don’t use it, delete it and scrub it from logs.
  • Run the CLI interactively; a non-interactive run cancels itself at the consent prompt.
  • Make admin changes with scripts an administrator runs, and confirm each one by reading the state back.
  • Disabling the agent identity blocks it immediately (AADSTS7000112), and re-enabling restores it within seconds. That makes a reliable, reversible governance demo.

Salesforce and Agentforce

  • The certificate must be created in the org that runs the code. Check Setup › View Setup Audit Trail if a “missing certificate” error makes no sense: mine had been created in another org.
  • .forceignore patterns that hide certificates or agent metadata from source tracking also hide them from sf agent publish. A bundle that publishes fine but loads as Invalid Config may simply not have been included.
  • Every Agent Script action needs a named, typed input, even an optional one. An action whose only input was a bare List<String> published without a schema and broke the agent.
  • sf agent create produced a service agent; employee agents came from Agent Script with agent_type: "AgentforceEmployeeAgent".
  • sf agent publish creates a version but doesn’t activate it. Activate explicitly.
  • The Agent Script router needs examples. “How do you access my Microsoft 365 data?” went to Off Topic until the router’s instructions listed authentication questions.
  • The Einstein Trust Layer masks dotted names such as Mail.Read as URL_Redacted in agent answers. Present scopes as “Mail Read”.
  • Auth.IntegratingAppType values are ECA and CA, and export is a reserved word in Apex.

Registry sync

  • Login success tells you nothing about sync. Permission denied with a working login means the Run As user lacks what the sync needs; in my case, an Agentforce license.

Workload identity federation

  • Salesforce issues opaque access tokens by default; only JWT-based access tokens for named users give Entra something to validate.
  • The JWT bearer flow on an External Client App fails with “refresh_token scope is required and the connected app should be installed and preauthorized” until the refresh_token scope is added and users are pre-authorized.
  • In the Salesforce token, iss and aud are both the My Domain URL and sub is uid:<user id>, not the username. Entra accepted the My Domain URL as the FIC audience; api://AzureADTokenExchange wasn’t required.
  • Self-signed certificates can’t be created with metadata. Create them in Setup and retrieve only the public part.
  • On Windows, az rest breaks on parentheses in Graph URLs such as applications(appId='…'). Look up the object Id first.
  • The FIC took effect within seconds, and the certificate credential and the FIC coexisted on one blueprint without affecting the running agents.

Common problems

SymptomLikely causeFix
AADSTS700027 / invalid client assertion at step 1x5t doesn’t match the certificate uploaded to the blueprint, or the assertion aud isn’t the token endpointRecompute the thumbprint from the same .crt; use https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token
AADSTS82001Asking for an app-only token as the blueprintRequest tokens as the agent identity, with T1
OBO fails: “account isn’t linked”The user hasn’t linked, or the code asks for the token with the wrong provider nameSettings › Connections; use the Auth. Provider’s friendly name
AADSTS65001 on OBOScope not consented on the blueprint, or not in the enumerated inheritance listConsent on the blueprint and add it to inheritable permissions
AADSTS7000112Agent identity disabledIntended, if you pulled the kill switch
Agent loads as Invalid ConfigBundle excluded by .forceignore, or an action without a typed inputFix the ignore file or the action and publish again
Registry sync: Permission denied, login OKRun As user without an Agentforce licenseAssign one, or run as a licensed user
AADSTS70025 (WIF)No FIC on the blueprintAdd it
AADSTS70021 (WIF)Issuer, subject or audience differs from the FICCompare the Salesforce token’s iss/sub/aud with the FIC

What this gives you

  • Agentforce agents with their own Entra agent identities, sponsors and owners, registered in Agent 365, and listed there by registry sync too.
  • No bridge and no secret: the private key never leaves Salesforce, and with federation Entra holds no credential at all.
  • An agent that acts as itself with one application role, and an agent that acts for the user with two delegated scopes, never more than the user can see.
  • Entra-side control of agents that run in Salesforce: Conditional Access for agents, sign-in logs, and a kill switch that works in seconds.
  • Telemetry sent by each agent under its own identity.

The agent stays where the business logic and the data are. The identity, the permissions and the off switch live where the security team already works.

Discussion

Comments are powered by Giscus / GitHub Discussions. They appear here once configured — see Configure Giscus in the project README and update GISCUS in src/consts.ts.