Repository navigation
Add Agentic User support to Socket Mode - #702
Draft
teddy arida-moody (teddyam) wants to merge 1 commit into
Draft
teddy arida-moody (teddyam) wants to merge 1 commit into
teddy arida-moody (teddyam) wants to merge 1 commit into
Conversation
Mirrors microsoft/teams.ts#928 and microsoft/teams.py#626: opt-in agentic options, agent-instance negotiate token, and inbound botKey/recipient validation before dispatch. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Socket Mode currently only supports the classic bot identity. This adds opt-in Agentic User (AU) support, mirroring microsoft/teams.ts#928 and microsoft/teams.py#626 while following C# conventions.
Approach
SocketModeOptionsgainsAgenticAppId,AgenticTokenScope(required when agentic, no default audience), andAgenticTenantId. Setting scope or tenant without an app ID is invalid.BotTokenProvider.GetAgenticAppTokenAsync(Microsoft.Identity.WebWithAgentIdentity). It is acquired on every negotiate, so reconnects and refreshes reuse it.botKeydoes not matchClientId, or if the recipient lacks non-empty, unpaddedagenticAppBlueprintId,agenticAppId,tenantId(plusagenticUserIdforrole == "agenticUser"or when present), or if the blueprint does not matchClientId. The recipient identity is never modified, so replies go out as each activity's recipient.Decisions worth reviewing
BotTokenProvider.GetAgenticAppTokenAsync. Core has noInternalsVisibleTofor Apps; the alternative is adding one and keeping it internal.ArgumentExceptionat host start (existing C# pattern), not at construction like TS/PY.botKeyand blueprint comparisons useOrdinalIgnoreCase(GUIDs; consistent with fix: validate caller app on Entra inbound Agent ID tokens #695 and issuer checks). TS/PY use strict equality.Testing
SocketModeAgenticTestsandBotTokenProviderAgenticAppTests; added agentic cases to transport and hosting tests, including an end-to-end reply-as-recipient test.