Skip to content

feat(teams): enforce typed scope and mention routing - #1497

Draft
NeoHsu wants to merge 11 commits into
openabdev:mainfrom
NeoHsu:stack/teams-05-typed-scope-routing
Draft

feat(teams): enforce typed scope and mention routing#1497
NeoHsu wants to merge 11 commits into
openabdev:mainfrom
NeoHsu:stack/teams-05-typed-scope-routing

Conversation

@NeoHsu

@NeoHsu NeoHsu commented Aug 20, 2026

Copy link
Copy Markdown

Important

Stacked draft: logical base stack/teams-04b-reactions-preview is PR #1496. GitHub requires an upstream PR base to exist in openabdev/openab, so this draft temporarily targets main and may show preceding stack layers. Do not merge it until #1496 is merged and this branch is rebased onto current main; then review only its single incremental commit.

What problem does this solve?

Make Teams trust and mention admission depend on authenticated typed scope rather than structural string heuristics.

Discord Discussion URL: https://discord.com/channels/1491295327620169908/1491365158868619404/1531339032527765655
Microsoft Teams roadmap discussion.

Review Contract

Goal

Make Teams trust and mention admission depend on authenticated typed scope rather than structural string heuristics.

Non-goals

This PR does not validate every client UI, enable ambient channel reading, persist routes, or add attachments.

Accepted Residual Risks

Older peers use the documented legacy shape and cannot prove all typed properties. GroupChat and Team-channel presentation still requires tenant access for live validation.

Acceptance Criteria

Personal messages do not require a mention; group/channel rules use typed recipient entities; malformed or contradictory shapes fail closed before session, attachment, or agent work; Unified and Standalone apply the same policy.

Follow-ups

Complete the unavailable GroupChat/channel live matrix and revisit ambient reading only under a separate permission ADR.

At a Glance

Authenticated Teams activity / operator target
                    │
                    ▼
            [this PR’s bounded layer]
                    │
                    ▼
          explicit outcome or fail-closed stop

Prior Art & Industry Research

OpenClaw: its Microsoft Teams extension separates access checks, Bot Framework route context, and outbound operations. For this slice the relevant comparison is Teams access checks and conversation-scope admission.

Hermes Agent: its Teams platform adapter keeps Teams-specific transport and message shaping behind a platform adapter. It does not provide OpenAB’s negotiated Core/Gateway outcome contract, so this PR keeps the useful adapter boundary but adds explicit fail-closed semantics.

Proposed Solution

  • Publish typed Teams Personal, GroupChat, and Team-channel scope metadata.
  • Enforce kind-aware mention and structural routing before Core side effects.
  • Fail closed on invalid scope switches while retaining an explicit legacy fallback.

Why this approach?

Typed authenticated scope avoids structural guesses and allows Personal, GroupChat, and channel policy to diverge safely.

Alternatives Considered

Infer scope from IDs or parent fields (rejected: structurally ambiguous) or require mentions in Personal chat (rejected: incorrect Teams UX).

Validation

  • cargo check -p openab-core
  • cargo check -p openab-gateway --features teams

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant