An AI SRE for Microsoft Teams is an incident investigation bot you @mention in a channel or message directly: it runs a read-only investigation and answers in the same thread. Aurora SRE, an open source AI SRE agent, has done this in Teams since v1.5.10, for teams whose incident response runs in Teams and not Slack. Teams needs three things Slack hides behind one install button: an Entra app for reading channels, an Azure Bot for receiving @mentions and posting, and a Teams app package installed in every team. It is not at full Slack parity: on v1.5.31 Teams has no live progress updates, no per-sender permissions and no buttons.
We found out how different the two platforms are the day the connector reached our hosted deployment. Mentions arrived at POST /teams/messages, the Bot Framework token verified, and every message was dropped with one log line: Teams message from unknown tenant. The tenant was connected. Our own row-level security was hiding it from us.
What a Slack-first AI agent has to change for Microsoft Teams
Aurora's chat behaviour was written for Slack: a policy memory the agent reads before it speaks, a registry of channels with generated descriptions, and a routing agent that decides where a finished investigation gets posted. Before any Teams code, PR 689 pulled the generic mechanics out and left only wording and parsing in the Slack modules. Its test for "nothing changed" was a golden file of the Slack-only routing prompt.
What a platform has to declare ended up small. This is the whole Teams entry in team_routing.py:
"teams": PlatformRoutingSpec(
platform="teams",
display_name="Microsoft Teams",
surface_noun="Microsoft Teams channel",
list_channels_tool="get_connected_teams_channels",
history_tool="get_teams_channel_history",
post_tool="post_teams_message",
thread_param="reply_to_id",
scope_examples="'in Team Checkout only', 'frontend incidents only'",
mapping_example="\"<service> -> <channel name>\"",
connected_check=("chat.backend.agent.tools.teams_tool", "is_teams_connected"),
),
A platform needs a matching entry in four registries (routing specs, memory identities, memory seed text, channel providers), and test_platform_registries_stay_in_step fails the build if they disagree. Teams channels share a table with Slack channels, still called slack_channels.
The design choice settled in review was one routing agent or one per platform. We went with one: a single background run gets the incident once, plus one instruction section and policy memory per connected platform. PR 705 then had to move the trigger. Routing used to fire from the Slack completion notifier, so a Teams-only org would never have been routed at all. It now fires once per incident from the dispatcher when Slack or Teams is connected.
How do you install an AI SRE bot in Microsoft Teams?
Slack gives one OAuth flow that both installs the bot and grants its scopes. Teams splits that into pieces owned by different portals, and finishing one does not imply the next:
| Piece | Where | What it is for |
|---|---|---|
| Entra app registration | Azure Portal | OAuth Connect in Aurora, Microsoft Graph reads (channel list, history) |
| Azure Bot with the Teams channel enabled | Azure Portal | Messaging endpoint /teams/messages, receives @mentions, posts as the bot |
| Teams app (manifest zip) | Teams Developer Portal | What users see under Teams → Apps |
| Install per team | Teams client | Microsoft only delivers @mentions where the app is installed |
The Graph side uses delegated scopes, listed in oauth.py: Team.ReadBasic.All, Channel.ReadBasic.All, ChannelMessage.Read.All, Chat.Read, plus offline_access, openid and profile. Of the four Graph scopes, Microsoft's permissions reference marks only ChannelMessage.Read.All as needing admin consent for delegated use. Chat.Read is requested, and on v1.5.31 no code path calls a Graph chat endpoint with it. Nothing is posted with that token. Outbound messages go through the Bot Framework as the app, so replies never appear under the name of whoever clicked Connect.
The app package is a zip with three files at its root: manifest.json, color.png and outline.png. The package we publish declares the bot for the team, groupChat and personal scopes and requests no resource-specific consent, which matters for the next section. Until an admin publishes the app to the org catalog, it is uploaded as a custom app. A Teams admin has to allow that first: in the Teams admin center, Teams apps → Setup policies → Upload custom apps.
The zip produced the least expected bug. Safari opens "safe" downloads, so the package landed as a folder and the zip was gone. For PR 730 we tried serving it as application/octet-stream, with Content-Disposition: attachment, from a URL without .zip, and with a .ZIP name. Safari unzipped all of them. Re-zipping the folder in Finder nests manifest.json under a top-level folder, and Teams rejects it. The fix was documentation: download with Chrome or Edge, turn off Safari's setting, or compress the three files and not the folder.
Why the Teams bot dropped every @mention: tenant mapping and row-level security
A Teams activity carries an Entra tenant id and no user session, and has to be mapped to one organization in a multi-tenant database.
On Connect, Aurora takes the tenant from the tid claim of the id_token after checking its signature, audience and that the issuer names the same tenant, falls back to Graph /organization, and refuses to store the connection if neither works. The tenant id is saved on the org's token row. On each inbound activity the handler looks that row up by tenant.
The first version ran that lookup as a plain SELECT on user_tokens. That table has FORCE ROW LEVEL SECURITY, policies key on a session variable, and a Bot Framework webhook sets none, so the query returned zero rows for every tenant. The tests passed because the fake cursor returned rows regardless of context. PR 731 walks the orgs instead, the way the Slack lookup already did, and changed the fake so rows are hidden unless the owning org is set:
def _teams_token_matches(tenant_id: str) -> list[tuple]:
"""(org_id, user_id, timestamp) for every org with an active token for this tenant."""
# FORCE RLS hides user_tokens without an org set, and an inbound activity has none
with db_pool.get_admin_connection() as conn, conn.cursor() as cur:
cur.execute("SELECT DISTINCT org_id FROM users WHERE org_id IS NOT NULL")
org_ids = [row[0] for row in cur.fetchall()]
# One tenant can be connected in more than one org; the org list has no order
matches = []
for org_id in org_ids:
cur.execute("SET myapp.current_org_id = %s", (org_id,))
cur.execute(
"""SELECT user_id, timestamp FROM user_tokens
WHERE provider = 'teams' AND subscription_id = %s AND is_active = TRUE
ORDER BY timestamp DESC LIMIT 1""",
(tenant_id,),
)
row = cur.fetchone()
if row:
matches.append((org_id, row[0], row[1]))
return matches
The same lookup served conversationUpdate events, so installs and removals had been silently skipped too.
Review of that fix surfaced a second question: what if two orgs connect the same tenant? The first answer was that the newest connection takes over. We dropped it for new connects. Delegated sign-in with prompt=select_account does not prove the person administers the tenant, so a takeover would let any tenant member redirect a company's bot traffic to a new Aurora org. On v1.5.31 a second connect is refused with tenant_already_connected. If two orgs already hold the same tenant, the next inbound activity settles it: copies strictly older than the newest are disconnected and that org's Teams page says why, and a timestamp tie is routed to neither.
What is unsolved: the walk costs one query per org on every inbound activity. A review comment proposed a short TTL cache and we declined, because a cache would keep delivering to an org whose token was just removed.
Slack vs Microsoft Teams bot APIs: what differs for an incident response agent
Mentions. Microsoft documents that bots in channels and group chats only receive messages that @mention them unless the manifest requests RSC permissions. Aurora checks the entities array for a mention of its own app id, strips <at> markup with a bounded regex (the first pattern was flagged as polynomial on attacker-controlled text), and answers direct messages without a mention.
Threading. Slack threads are a thread_ts parameter. In the Bot Framework a thread is a different conversation id, and our client records that Create Conversation ignored the replyToId we sent. From bot_client.py:
# Create Conversation ignores replyToId, so a thread reply is posted into
# the root message's own conversation id instead.
if reply_to_id:
return send_reply_in_conversation(
service_url=svc,
conversation_id=thread_conversation_id(channel_id, reply_to_id),
text=text,
text_format=text_format,
)
thread_conversation_id builds <channel id>;messageid=<root id>. Microsoft's current threading guide (in preview) says to treat conversation.id as opaque and not parse it, and recommends a newer /replyChains endpoint for new code, while allowing existing integrations to keep posting through /activities. We are on the older route, and we both build and split that id ourselves.
Message edits. Both platforms let a bot edit its own message, so both get a placeholder (Thinking... on Slack, Thinking… on Teams) that is replaced by the answer: chat.update on Slack, a PUT on the activity on Teams. If the Teams update fails, Aurora posts a new reply. The placeholder call has a 5 second timeout so a slow Teams API cannot hold the webhook open until the Bot Framework retries, and retries are dropped by activity id in Redis for an hour. Slack's Events API expects a 2xx within three seconds.
Rate limits. Teams limits a bot to 7 sends per second and 60 per 30 seconds in one conversation, then returns HTTP 429. Slack's chat.update is a Tier 3 method. Aurora's Graph client retries a 429 twice, honouring Retry-After up to 30 seconds. The bot client that posts messages does not retry.
Formatting. Teams replies are converted to plain text, which strips code fences from command output. Incident cards are HTML with a link, not Adaptive Cards.
AI SRE in Slack vs Microsoft Teams: what works on v1.5.31
| Capability | Slack | Microsoft Teams |
|---|---|---|
| @mention in a channel starts a read-only investigation | Yes | Yes |
| Direct message to the bot | No | Yes, no mention needed |
Thinking placeholder replaced by the answer | Yes | Yes, falls back to a new reply |
| Live progress edits while it works | Yes, every 30 s by default | No |
| Runs with the sender's Aurora role and connector access | Yes, matched by email | No, runs as the user who connected the tenant |
| Refuses guests, toggle for people without an account | Yes | No, the sender is not checked |
| Thread or channel context added to the question | Last 10 thread messages, or 5 channel messages | No, the agent can call a thread-reading tool |
| Follow-up in a thread continues the same session | Yes | No, each mention is a new session |
| Where a finished root cause analysis lands | Reply in the original alert's thread (alerts posted by the CloudWatch, Sentry, PagerDuty and incident.io apps) | HTML card with a summary and link in the chosen incident channel |
| Investigation started and failed cards | No | Yes |
| Buttons (run a suggestion, continue an investigation) | Yes | No |
| Routing agent posts to the owning team's channel | Yes | Yes, in the same run |
| Policy memory, channel descriptions, read and post tools | Yes | Yes |
| Works without a public inbound URL | Yes, Socket Mode | No, needs a public HTTPS endpoint |
PR 721 added progress edits because a static placeholder on a long investigation made people re-ask, which started parallel runs. The reporter is gated on the source in task.py:
def _build_slack_progress_reporter(user_id: str, trigger_metadata: Optional[Dict[str, Any]], wf):
"""Reporter for the Slack placeholder, or None when this turn has no placeholder to edit."""
meta = trigger_metadata or {}
# slack_button's placeholder says what is executing; a generic note would replace it
if meta.get("source") != "slack":
return None
# ...
A Teams run has an editable placeholder and a rate limit that allows a 30 second cadence. We have not built it.
Identity is the larger gap. Since PR 743 a Slack mention runs as the Aurora user whose email matches the sender, so role and per-team connector access apply, guests are refused, and a workspace member with no Aurora account is answered as a general viewer unless an admin turns that off. Every Teams mention runs as the one Aurora user who connected the tenant. The handler never looks at who sent the message, so this holds for anyone in any team where the app is installed. Mentions run in Ask mode, which blocks write tools, so the exposure is what that user can read, not a way to change infrastructure. Connecting needs the connectors write permission, which the Editor and Admin roles hold. Connect the tenant from an Editor account whose connector access you would give to everyone in those teams, not from an Admin: an Admin's runs also get the org chat-history audit tools, which are Admin-only by default. Then install the Teams app only in teams where that read scope is acceptable.
Two more limits: Aurora lists channels from the teams the connecting user has joined, and registers only those where the bot is installed, so a team that person is not in is invisible. And Microsoft's channel documentation, linked above, says bots cannot post messages in private channel conversations.
Try it
A self-hosted install has its own Entra app id, so it builds its own package; the downloadable zip only works with the hosted bot.
- Self-hosted only: register an Entra app with redirect URI
https://your-api.example.com/teams/callback, add the delegated Graph scopes above and grant admin consent. - Self-hosted only: create an Azure Bot with "Use existing app registration", set the messaging endpoint to
https://your-api.example.com/teams/messages, and enable the Microsoft Teams channel. - Self-hosted only: in the Teams Developer Portal create the app, link the bot by Microsoft App ID, leave "Only send notification" unchecked, select the Team scope, then publish to your org or download the zip.
- Self-hosted only: set
TEAMS_CLIENT_ID,TEAMS_CLIENT_SECRETandTEAMS_TENANT_ID(your tenant GUID for a single-tenant app, nevercommon), then restartaurora-serverandcelery_worker.TEAMS_APP_IDis only for a bot on a different Entra app. - In Aurora: Connectors → Microsoft Teams → Connect. Do this before testing a mention.
- In Teams: Apps → Manage your apps → Upload an app → Upload a custom app, select the zip, then Team ··· → Manage team → Apps → Install.
- Send
@Aurora helloin a channel. The getting-started steps on Teams → Manage clear once Aurora receives it. Then activate channels and set the incident card channel.
The full steps are in the connector docs. Related: open source AI SRE agents compared, top AI SRE tools, self-hosted AI SRE, and what a read-only agent may run.
Aurora is open source at github.com/Arvo-AI/aurora, hosted at aurora-ai.net, and you can book a demo.
Verified against Aurora v1.5.31 on 2026-12-02. Microsoft and Slack documentation checked the same day.